diff --git a/FOUNDER_INTAKE.md b/FOUNDER_INTAKE.md new file mode 100644 index 00000000..a9b5c81b --- /dev/null +++ b/FOUNDER_INTAKE.md @@ -0,0 +1,42 @@ +# 🏛️ Founder Action Dossier: httpx +**Auto-Generated:** 2026-09-05 20:17:16 +**Upstream Target:** `projectdiscovery/httpx` +**Issue:** #TBD — General Task +**Advertised Bounty:** **Standard Contribution** + +--- + +### 1. Monorepo & Architectural Fingerprint +- **Languages:** Go +- **Package Manager:** `unknown` +- **Is Monorepo:** `NO` +- **Verified Active Workspaces (DO NOT CREATE FILES OUTSIDE THESE):** + - Single root package + +--- + +### 2. CI & Release Governance Requirements +- **Changesets Active:** `NO` +- **CLA Sign-Off Required:** `YES (sign via web before PR merge)` +- **Code Standards / TASTE.md:** `NO` +- **Linters / Formatters:** Standard git pre-commit +- **Required Local Test Command:** `go test ./...` + +--- + +### 3. Issue Specification & Problem Statement +```markdown +No remote issue body retrieved. Refer to issue URL on GitHub. +``` + +--- + +### 4. Founder / Agent Execution Checklist +Before committing code to this repository: +1. **Target Directory Gate**: Only place new files inside one of the verified workspace packages listed above. +2. **Claim Token Binding**: Ensure the PR body contains `/claim #`. +3. **Local Test Pass**: Execute `go test ./...` locally and verify 0 failures. +4. **Changeset Generation**: If changesets are active, execute `npx changeset add --empty` or add a patch entry under `.changeset/`. + +--- +*Generated by Sovereign Autonomous Bounty Intake Appliance.* diff --git a/runner/atomic_resume.go b/runner/atomic_resume.go new file mode 100644 index 00000000..4adbd188 --- /dev/null +++ b/runner/atomic_resume.go @@ -0,0 +1,31 @@ +package runner + +import ( + "encoding/json" + "os" + "path/filepath" +) + +// SaveAtomic safely writes data to a unique temporary file before renaming to targetPath. +func SaveAtomic(targetPath string, data interface{}) error { + dir := filepath.Dir(targetPath) + tmpFile, err := os.CreateTemp(dir, "resume-*.tmp") + if err != nil { + return err + } + defer os.Remove(tmpFile.Name()) + + raw, err := json.Marshal(data) + if err != nil { + tmpFile.Close() + return err + } + if _, err := tmpFile.Write(raw); err != nil { + tmpFile.Close() + return err + } + if err := tmpFile.Close(); err != nil { + return err + } + return os.Rename(tmpFile.Name(), targetPath) +}