Skip to content

fix(auto-sync): unblock the pi 1.7.0 upgrade and dogfood the Action from main - #59

Merged
thxCode merged 5 commits into
mainfrom
fix/auto-sync-pi-1.7.0-budget-exhausted
Nov 30, 2026
Merged

thxCode merged 5 commits into
mainfrom
fix/auto-sync-pi-1.7.0-budget-exhausted

Conversation

@thxCode

@thxCode thxCode commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind bug
/area controller
/area agent-pi
/area github-app
/area docs

Summary

  • Why. A manual Auto Sync run that attempted the pi 1.6.0 → 1.7.0 upgrade ended in BUDGET_EXHAUSTED (admission /circuit-breaker/repairNoProgress) with most of its budget unspent. Two causes, one per layer.
  • Cause A (verification). @earendil-works/pi-ai 1.7.0 pruned legacy openai-responses entries, including gpt-4. packages/agent-pi/test/multi-provider.test.ts pinned gpt-4 as its "built-in catalog resolves cost" fixture, so auto-sync-verify failed on one test.
  • Cause B (exhaustion). The implementation-repair prompt carried only verdict.reason, which the local command gate reduces to stdio tails (256 code points). The structured check-out (detail, findings) that verify.sh wrote reached the evidence but never the prompt. The repair role could not name the failing test, made no edit in 10 turns, and the no-progress breaker stopped the run under a hard-coded BUDGET_EXHAUSTED label.
  • Fix 1. The test derives its fixtures from the shipped pi-ai catalog data and requires every declared cost to resolve. No model ID is pinned in those probes.
  • Fix 2. extractGateVerdictExcerpt prefers verdict.detail over reason and adds bounded findings (at most 8, evidence cut to 512 code points). The repair prompt carries both. Over the 16 KiB budget it strips detail, then findings, then drops entries. The run log's check summary now shows the check-out detail.
  • Fix 3. .github/workflows/auto-sync.yml uses gpustack/loopwright@main, so the repository dogfoods its own harness without an Action release. Third-party Actions stay pinned to commit SHAs. The workflow gate allows a 40-character SHA for any Action, or main for gpustack/loopwright only, and rejects ./, tags, other branches, and short SHAs, including on one-line steps.
  • Deliberate rule reversal. specs/2026-11-15-self-upgrade-dogfooding.md (lines 17, 44, 67, 77, 163, 197) asks for 40-character SHA pins on every Action in the self-upgrade workflow, for bootstrap provenance. This PR reverses that rule for the one gpustack/loopwright reference, by owner decision. Accepted risk: a mutable ref. main is the protected default branch, the run log records the resolved SHA, and the gate still accepts a rollback to a SHA. The spec stays as written; docs/walkthroughs/declarative-taskpack.md states the exception.
  • Also. report-and-t3.test.ts is renamed to report-repair-and-source-freeze.test.ts after its content. The scheduling weight key in scripts/run-tests.mjs moves with it.
  • Verification scope. Local and deterministic. The end-to-end confirmation (an Auto Sync run that reaches candidate) needs this change on main and the Action at main; it is not part of this PR.

Related Issues

None.

Verification

  • npm run build passed cleanly
  • npm run typecheck passed cleanly
  • npm run lint passed cleanly
  • npm run lint:docs passed cleanly
  • npm run site built and verified with zero broken links
  • Full suite passed (node scripts/run-tests.mjs: 1754 tests, 1748 pass, 0 fail, 6 skipped)
  • Focused tests passed on pi-ai 1.6.0 and 1.7.0 (multi-provider.test.js, 6/6 on each)
  • Verified .github/workflows/ maintains least-privilege permissions and remains protected against untrusted taskpack/sandbox writes
  • Signed-off-by Developer Certificate of Origin (DCO) included on all commits

Does this PR introduce a user-facing change?

Implementation-repair prompts now carry the structured check-out `detail` and `findings` from `command.v1` checks, so a failing test is named with its path and assertion instead of a stdio tail. The repository's own Auto Sync workflow now tracks `gpustack/loopwright@main`.

- Read model entries from the shipped pi-ai provider data file
- Require every declared cost to resolve; at least one positive
- Guard against empty catalog sections and costless catalogs
- Keep the hasPositiveModelCost and github-copilot assertions

Task 1 of auto-sync-pi-1.7.0-budget-exhausted.

Signed-off-by: thxCode <thxcode0824@gmail.com>
- Prefer the structured verdict detail over the truncated reason
- Add bounded findings with title, path, and cut evidence
- Strip detail, then findings, before dropping entries over budget
- Extend the mock gate and repair tests to cover check-out verdicts
- Cover the findings strip stage and merge the strip loops

Task 2 of auto-sync-pi-1.7.0-budget-exhausted.

Signed-off-by: thxCode <thxcode0824@gmail.com>
- Use gpustack/loopwright@main so Auto Sync dogfoods the harness
- Keep third-party Actions pinned to commit SHAs
- Gate Action refs: SHA, or main for gpustack/loopwright; scan one-line steps
- Let the gate accept a rollback to a pinned SHA
- Scope the docs pin rule to self-upgrades and state the exception

Task 3 of auto-sync-pi-1.7.0-budget-exhausted.

Signed-off-by: thxCode <thxcode0824@gmail.com>
- Rename to report-repair-and-source-freeze for its three test groups
- Move the scheduling weight key in run-tests.mjs with the file
- Leave the historical spec Owns entry unchanged

Signed-off-by: thxCode <thxcode0824@gmail.com>
@gpustack-code-review

gpustack-code-review Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s).

Reviewed e24f221..ccc19f9 only; earlier commits in this PR were reviewed in a previous run.

Comment thread packages/controller/src/controller.ts Resolved
Comment thread scripts/run-tests.mjs Resolved
… prompt

Signed-off-by: thxCode <thxcode0824@gmail.com>
@thxCode

thxCode commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Review round 1

Triage of the 5 findings (2 inline, 3 routed to the summary). Each was checked against the source before any change.

# Location Verdict Outcome
1 packages/controller/src/controller.ts:278 (performance, medium): title/severity uncapped False positive Not fixed. checkedFindings in gate.ts:133-178 already caps title at 256 and severity at 16 code points and refuses anything larger before the verdict is stored. Reply on the thread.
2 scripts/run-tests.mjs:48 (maintainability, medium): key names a missing file False positive Not fixed. The rename is commit e24f221 in this PR; the keys name compiled .test-build/*.test.js files, which never exist as sources. Reply on the thread.
3 .github/workflows/auto-sync.yml:167 (security, low): version skew between @main and the checkout Accepted trade-off Not fixed here. The mutable ref is the owner's deliberate choice, stated in the description. The skew window is the seconds between job start and the checkout step, and GitHub exposes no first-class variable for the resolved Action SHA. Recorded as a follow-up candidate (for example a release-maintained moving tag).
4 packages/controller/src/controller.ts:269 (style, low): nested ternary Valid nit Fixed. Restored the let + if / else if form the function used before this PR.
5 packages/controller/src/controller.ts:1842 (maintainability, low): findings shadows findings Valid nit Fixed. The per-check array is now checkFindings; the gate-verdict property keeps the name findings, which is what the prompt schema shows the model.

The two comment_refiled warnings are the reviewer's own re-filing notices; no action.

Items 4 and 5 land as one fixup commit on top of 571f92b (fix(controller): carry gate check-out findings into the repair prompt), so they fold into that commit at squash merge.

Verification on the fix: npm run build, npm run typecheck, npm run lint, and npx tsc -p tsconfig.test.json exit 0; report-repair-and-source-freeze.test.js 11/11; node scripts/run-tests.mjs --pkg controller 342/342.

No upgrade-compatibility risks were raised.

@thxCode
thxCode merged commit 1225c20 into main Nov 30, 2026
23 of 24 checks passed
@thxCode
thxCode deleted the fix/auto-sync-pi-1.7.0-budget-exhausted branch November 30, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant