Repository navigation
fix(core): constrain CTX packs to task-required sources - #9
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Correct Factory CP-06 after the full independent review failed, preserving every commit and honest successful test from PR #8 while delivering a separate replacement PR against main. P-06 must treat the original result—15 of 24 topical excerpts irrelevant and all 10 packs containing irrelevant material—as a failure, not relevance merely because bytes are bounded. Diagnose real user-visible irrelevant CTX retrieval and the missing decisive AUTH original with safe real-CTX fixtures, including a successful bad path with proven irrelevant topical original provenance, a good path, a one-condition counterfactual, and a separately asserted disconfirming partial case. Make the smallest correction using existing CTX semantics and reviewed task-local source selection/required-original reads so a predeclared representative sample of exactly ten bounded task packs contains genuinely relevant authority without omitting critical constraints. Do not game selection, hide raw extra excerpts, falsify provenance, alter upstream CTX, or build another retrieval control plane; if an in-scope correction cannot satisfy acceptance, leave CP-06 incomplete and report the blocker before architecture expansion.
Retain a secret-free deterministic fixture corpus or generator and structured evidence manifests for the exact ten contracts, originals, packs, receipts, relevance/miss correction, commands/exits, source hashes/provenance, CTX generation, output hashes/paths, tested SHA, date, and reviewer, while keeping raw CTX output and receipts in ignored scratch. For P-07 retain a minimal structured finding/disposition plus executable fail-before, fix-after, and final retest sequence whose fail-before verifies the expected SyntaxError signature, with checked-in normal API and in-memory auth-isolation fixtures that use no network, real accounts, or sensitive credentials. Keep deterministic checks before semantic review and preserve Firstmate/no-mistakes dispatch and delivery ownership. Update CP-06 proof, BUILD_PLAN, workflow/skill/contract/integration policy only where runnable evidence supports it; retain honest Linux/fixture limitations. Do not add CP-07, CP-08, a scheduler, supervisor, model router, worker lifecycle behavior, or changes outside Factory.
Validate npm ci, format check, lint, typecheck, the full suite, exact ten-pack real-CTX replay, a fresh-context worker correction from only the bounded handoff with actual machine-readable tool-event auditing that proves exactly one targeted original project read and no other project scan/tool, the P-07 historical replay, git diff --check, and final-head contract/budget/source digests. Use verified offline semantic CTX retrieval and exact originals when retrieval is incomplete or conflicting. Run the complete no-mistakes review/test/document/lint/push/PR/CI pipeline with agent Pi and no skipped steps, opening the correction branch's replacement PR without merging; report the exact final head, commands/exits, changed files, reproducibility, residual risks, PR URL, and green exact-head checks for another independent audit.
What Changed
context.requiredpaths as CTX--documentfilters while still reading exact required originals.Risk Assessment
Testing
Installed dependencies, exercised the CP-06 real-CTX ten-pack replay, P-07 historical replay, fresh Pi worker event-stream audit, and targeted context source-selection regression; all commands exited 0 and structured evidence manifests/logs were saved.
Evidence: npm ci transcript
Evidence: CP-06 ten-pack replay transcript
Evidence: CP-06 ten-pack structured evidence manifest
Evidence: CP-06 fresh worker event-audit transcript
Evidence: CP-06 fresh worker structured evidence manifest
Evidence: P-07 replay transcript
Evidence: P-07 structured evidence manifest
Evidence: Targeted context source-selection regression transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
npm cinpm run proof:cp06:ten-packnpm run proof:cp06:p07npm run proof:cp06:workernpm run build && node --test --test-name-pattern="task-local source selection" dist/test/context.test.js✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.