fix(drive): sync materializes the repo instead of assuming a clone - #10
Conversation
Every cloud tick died at step 1 with `fatal: 'origin' does not appear to be a git repository` (runs 9fc8d996, ff35187a, 06505b94, 4cf36ea7, b33c2c9a). The cause was not a misconfiguration — a cloud workflow sandbox never has a clone. The CLI uploads the `git ls-files` set with no `.git`, and the bootstrap runs `git init` over it: files yes, history and remotes no. Nothing in the launch path clones. `sync` now asserts materialization rather than assuming it, and branches on what the environment actually is: a real checkout with `origin` keeps the old fetch-and-checkout behavior; a sandbox snapshot commits itself as the base so `git diff main` has a `main`; an unmaterialized environment fails closed with SYNC_FAIL_NOT_MATERIALIZED naming the missing paths. `pr` names each delivery precondition before using it. A sandbox has no remote and no authenticated `gh`, so it now says PR_BLOCKED_NO_REMOTE in one typed line instead of dying opaquely after five agent steps. Proven in cloud run 404a8386-a129-40b0-9e5b-8ec9ad433038: sync green (SYNC_MODE=snapshot), assess green (ASSESS_DONE), build started on codex. Full evidence and the credential findings are in the audit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 50 minutes. View limit detailsLimit details: You’ve used the included review currently available. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (2)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/settings/billing. Comment |
…ops/reviews ops/reviews/ holds audits and fix summaries beside review transcripts. The verdict step took the newest *.md, which after merging PR #10 was an audit with no verdict — fail-closed for the wrong reason. Now matches *-review.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56f62c409b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Verified against `provider_credentials` for the flows workspace | ||
| `50587328-441d-4acb-b8f3-dbe1b3c5de99` and against the run log above. |
There was a problem hiding this comment.
Capture the credential-verification command and output
The assertion that the credential state was “Verified against provider_credentials” is a verification claim, but the report provides neither the literal query/command nor its captured rows; the subsequent bullets only summarize selected values and log lines. This makes the credential conclusion non-reproducible, so include the exact command/query and complete relevant output or narrow the claim to the evidence actually shown.
AGENTS.md reference: AGENTS.md:L51-L53
Useful? React with 👍 / 👎.
| set -eu | ||
| title=$(grep -m1 -oE "WP-[0-9]+[^|]*" ops/NEXT.md | sed "s/[[:space:]]*$//" || echo "work package") | ||
| git add -A | ||
| git commit -m "drive: $title" || echo "PR_NOTE: nothing new to commit" |
There was a problem hiding this comment.
Propagate real commit failures
When git commit fails for any reason other than an empty index—for example, a pre-commit hook or commit-signing failure in the supported laptop/fleet path—this fallback labels it as “nothing new to commit” and continues to push/open a PR from the previous HEAD. If the builder already made commits, that can create a PR while silently omitting the currently staged changes; check that the index is actually clean before skipping the commit and propagate every other failure.
AGENTS.md reference: AGENTS.md:L16-L18
Useful? React with 👍 / 👎.
What was broken
Every cloud tick died at the first step:
(runs
9fc8d996,ff35187a,06505b94,4cf36ea7,b33c2c9a)This was not a misconfiguration. A cloud workflow sandbox never has a clone. The CLI tars the
git ls-filesset — no.git— and the bootstrap runsgit initover it. Files yes, history and remotes no. Nothing in the workflow-launch path runsgit clone; the platform's clone helperbuildGitWorkspaceSyncShellhas two callers, neither of them workflows.What changed
workflows/drive.yaml, two steps.syncasserts materialization instead of assuming a clone, then branches on what the environment actually is:SYNC_FAIL_NOT_MATERIALIZED(exit 78), naming the missing pathsoriginexists (laptop, fleet node) →SYNC_MODE=remote, unchanged behaviororigin(cloud sandbox) →SYNC_MODE=snapshot: the uploaded snapshot is the base, committed sogit diff mainin the review step has amainprnames each delivery precondition before using it —PR_BLOCKED_NO_REMOTE/PR_BLOCKED_NO_GH_AUTHin one typed line, instead of dying opaquely after five expensive agent steps.Evidence
Cloud run
404a8386-a129-40b0-9e5b-8ec9ad433038, launch job9202f8cc-d206-4620-871d-e4e7895662c4, sandboxb02dd914-d10e-432d-af0d-5a809190019d:First cloud tick to get past step 1.
What this does NOT fix — read before merging
The cron runs a frozen spec.
agent-relay cloud schedulestores a copy of the YAML in the schedule row; the scheduled run never reads the repo. Both activeflows-driveschedules carry a spec from nine commits ago (workflow_bytes4871 and 4869 = commits053b93b3/3ebcff74;origin/mainis 7262). Merging this changes nothing about the scheduled tick until the schedule is re-registered. There are also two duplicateflows-driveschedules on the same cron, which is why 02:00Z produced two runs.A cloud sandbox cannot open a PR.
claudeandcodexauthenticate fine (proven above), but there is no GitHub token:ghis installed and unauthenticated,cloud runhas no--envflag, andWORKFLOW_GITHUB_WRITE_GRANTSis a hardcoded array of threeAgentWorkforce/cloudentries, all withenvTokenNames: []. Giving flows App-based write is a cloud-side change + deploy.Full trace, the fleet-node (sf-mini / finn-mini) comparison, and the exact remaining manual steps are in
ops/reviews/20260828-0127-cloud-execution.md.A human merges.
🤖 Generated with Claude Code