Skip to content

fix(core): constrain CTX packs to task-required sources - #9

Merged
0xnotdev merged 7 commits into
mainfrom
fm/factory-cp06-correction
Oct 6, 2026
Merged

0xnotdev merged 7 commits into
mainfrom
fm/factory-cp06-correction

Conversation

@0xnotdev

Copy link
Copy Markdown
Owner

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

  • Updated context generation to pass each task’s context.required paths as CTX --document filters while still reading exact required originals.
  • Added CP-06/P-07 replay scripts, npm proof commands, and fixture corpora for ten-pack relevance, targeted worker correction, malformed JSON, and auth-isolation scenarios.
  • Revised workflow, contract, integration, architecture, skill, build-plan, and CP-06 proof docs to reflect task-local source selection and review ordering.

Risk Assessment

⚠️ Medium: The source changes are coherent and I found no merge-blocking defects, but the change relies on nontrivial CTX/Pi replay evidence and live integration behavior, so residual integration ambiguity remains.

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

added 11 packages, and audited 12 packages in 2s

4 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
EXIT:0
Evidence: CP-06 ten-pack replay transcript
{"ok":true,"gate":"P-06","tested_sha":"355854fc4e6c16b03fb793825d93a7ed801e52d4","manifest_path":".factory/state/cp06-correction/ten-pack/evidence.json","manifest_sha256":"c7b94663c80f8a0da16762eb9870e50d6002d00b0b6e880bd33d1dd33ea12b3b","fixed_pack_count":10,"relevant_pack_count":10,"irrelevant_topical_excerpts":0,"missing_targets":0,"bad_path_exit":0,"bad_path_irrelevant_topical_sources":["docs/DELETION.md","docs/OBSERVABILITY.md"],"disconfirming_partial_exit":0,"disconfirming_missing_original_exit":3}
EXIT:0
Evidence: CP-06 ten-pack structured evidence manifest
{
  "schema_version": 1,
  "gate": "P-06",
  "tested_sha": "355854fc4e6c16b03fb793825d93a7ed801e52d4",
  "recorded_at": "2026-09-29T11:01:53.452Z",
  "reviewer": "Pi CP-06 correction worker",
  "fixture": {
    "tracked_root": "test/fixtures/cp06-context",
    "files": {
      ".factory/project.yaml": "59ee6b589f4eae84ac6fd8c5a9c914e2ea501c4205baf14e0944dd24d7ca2abf",
      ".factory/completion.yaml": "20806c54a9d3493208776acf73a46d5bed4d3bed5b5b434e7c102cf213043c3c",
      "PROJECT.md": "66ebc1d1dbab841fbc3f2b1f2c56f31b46eed62c4669bc80fd1f737cbca02a34",
      "ARCHITECTURE.md": "303f78b9c431047b16dc705b32445af7e61b88639c8182bef5132b1a6c73387b",
      "oracle.json": "3bbee93babb5c6e65962f03eeef13347fc650f662cd38bdaa4a10aefcc9aa60e",
      "cases/AUTH-before.yaml": "1463c777fcc44b45285a47711abe01a2514ce092cf245566af1c9e629996a927",
      ".factory/tasks/COPY-001.yaml": "1fdede6ffec46443ad3ce6f151954563603e7cfb6a7aa1b8256a06f018022216",
      ".factory/tasks/CONFIG-001.yaml": "b6835f95a421d9ae39370788e2315d34ef837ba500687eec133a4bd623f0f4f3",
      ".factory/tasks/API-001.yaml": "95287f422708788226a79b54bb98aa748de129183f4628e81e405ae69e9f8200",
      ".factory/tasks/PERSIST-001.yaml": "98a60c7b75aae66c0cd533837df87d6ab88d024c4a3d4b740bb1d31cf4025cf9",
      ".factory/tasks/UI-001.yaml": "2777cb61b8a666154f7502c6a7cc9147d7c5b64d5918f1d2e1ee541065e0df12",
      ".factory/tasks/IMPORT-001.yaml": "6cca201d15e4b35e37db6d5c9b08162432c0f9f327935c15fe65f16375604d4d",
      ".factory/tasks/LOG-001.yaml": "ca4dce7f6df4a1adddb1d5ca0a1630c160b9ad8c020d4a5957a0dba851c7a773",
      ".factory/tasks/EXPORT-001.yaml": "756641f3945c04d36c1217059945464ee986860c7b2c9ab9dbaf8843f3cda4d7",
      ".factory/tasks/DELETE-001.yaml": "52e90669244d2dec5293c99c4753b32fc3be25e9f16ac7f853655b33dddebd80",
      ".factory/tasks/AUTH-001.yaml": "cc3b394217bcfeb28a4d996e5b36d5dfdf5ae45edcbbba279732c347819d7dfa",
      "docs/STYLE.md": "0694cd4e159073ddec0a2ca911387b6b684decc427118358df09a366ff1879aa",
      "docs/CONFIG.md": "6f018812db1b3e573b3936402c83ad6b8e155e08dc1923a4efa15c588c04af36",
      "docs/API.md": "3eec185c2fd091631294fe0484434eb55f53304e8ba829820833fdacc8d79253",
      "docs/PERSISTENCE.md": "3bf5f9a14539c614097e6ebb9e87e120e374490e51b1f6ee75aa8bb0d2cfd078",
      "docs/UI.md": "55d08793a354bdbc30f927c6df42a5210883ec11d4b7a879cdbdbb2a400b7af8",
      "docs/IMPORT.md": "7ecf640af4652b3238d4f29577657a5f0a016f5e36fb2c1a7676ec78cb6e9661",
      "docs/OBSERVABILITY.md": "3b0d76216e259f913afe366acd7f18facda9574a62633513b335b30714b9ee36",
      "docs/EXPORT.md": "ed126125a6c570da168a4d80566666f78ab7b8cffcbf16357eb64941ab7effb4",
      "docs/DELETION.md": "f8f9e9796fee494435ddfb9aa99ef5016fc93179d94be60cc06d8e5e4a4982d8",
      "docs/AUTH.md": "353572470edee8e83c022c1ce763d05bfa3e628a77fb5c42fc1b1eb91491abd1"
    }
  },
  "ctx": {
    "version": "ctx 1.0.0",
    "index_generation": 2,
    "retrieval_mode": "HYBRID_SEMANTIC",
    "active_channels": [
      "structural",
      "lexical",
      "semantic"
    ],
    "offline_ready": true,
    "network_attempted": false
  },
  "original_failed_measurement_preserved": {
    "packs": 10,
    "topical_excerpts": 24,
    "irrelevant_topical_excerpts": 15,
    "packs_with_irrelevant_excerpt": 10,
    "missing_targets": 1,
    "source": "docs/probes/CP-06.md at PR #8 head 8b945a4ed6fcbb43a8b7aa7ce3a6532a4a23d145",
    "disposition": "fail"
  },
  "diagnosis": {
    "bad_unscoped_path": {
      "exit_code": 0,
      "output_path": ".factory/state/cp06-correction/ten-pack/raw/bad-unscoped-auth.txt",
      "output_sha256": "d4b0a090eb8c63a0b167f7631323cf517bb769e69560bebf42c673a63c5d723c",
      "provenance": [
        "ARCHITECTURE.md",
        "docs/DELETION.md",
        "docs/OBSERVABILITY.md"
      ],
      "irrelevant_topical_sources": [
        "docs/DELETION.md",
        "docs/OBSERVABILITY.md"
      ],
      "irrelevant_topical_originals": [
        {
          "path": "docs/DELETION.md",
          "document_sha256": "f8f9e9796fee494435ddfb9aa99ef5016fc93179d94be60cc06d8e5e4a4982d8"
        },
        {
          "path": "docs/OBSERVABILITY.md",
          "document_sha256": "3b0d76216e259f913afe366acd7f18facda9574a62633513b335b30714b9ee36"
        }
      ],
      "missing_target": true
    },
    "one_condition_counterfactual": {
      "unchanged_fields": "all AUTH task fields except context.required",
      "before_required": [
        "PROJECT.md",
        "ARCHITECTURE.md"
      ],
      "after_required": [
        "PROJECT.md",
        "ARCHITECTURE.md",
        "docs/AUTH.md"
      ],
      "before_contract_sha256": "1463c777fcc44b45285a47711abe01a2514ce092cf245566af1c9e629996a927",
      "after_contract_sha256": "cc3b394217bcfeb28a4d996e5b36d5dfdf5ae45edcbbba279732c347819d7dfa",
      "before_pack_sha256": "5021b70c3a5a7f3ae685ae7954786c9d0817dca108a16c13e2eaec77f3a4012d",
      "after_pack_sha256": "03dbabe404677466128b075312aa9c8ceda16b8c1b3f7c8e4ff4d53ccf66fb62",
      "corrected_constraints": [
        "principal-derived ownership",
        "request owner ignored",
        "missing or forged credential is 401",
        "cross-account read/update/delete is non-mutating non-disclosing 404"
      ]
    },
    "disconfirming_partial_case": {
      "condition": "a successful document-scoped real-CTX call can remain PARTIAL",
      "exit_code": 0,
      "completeness_status": "PARTIAL",
      "output_path": ".factory/state/cp06-correction/ten-pack/raw/disconfirming-partial-ctx.txt",
      "output_sha256": "c94689905b3dddf19ce55613477b454bcf7ad5f253d1eb4c56694354634eba33"
    },
    "disconfirming_missing_original_case": {
      "condition": "declared required original docs/ABSENT.md does not exist",
      "exit_code": 3,
      "error_code": "CONTEXT_BLOCKED",
      "output_path": ".factory/state/cp06-correction/ten-pack/raw/disconfirming-missing-original.txt",
      "output_sha256": "05c96602b24e87695b808a98ab08e0e0a5c54ebed149ac39b225478f973f3dca",
      "pack_fabricated": false
    }
  },
  "fixed_sample": {
    "pack_count": 10,
    "relevant_pack_count": 10,
    "irrelevant_topical_excerpts": 0,
    "packs_with_irrelevant_excerpt": 0,
    "missing_targets": 0,
    "packs": [
      {
        "task_id": "COPY-001",
        "risk": "bounded",
        "contract": {
          "path": "test/fixtures/cp06-context/.factory/tasks/COPY-001.yaml",
          "sha256": "1fdede6ffec46443ad3ce6f151954563603e7cfb6a7aa1b8256a06f018022216"
        },
        "target_source": {
          "path": "test/fixtures/cp06-context/docs/STYLE.md",
          "sha256": "0694cd4e159073ddec0a2ca911387b6b684decc427118358df09a366ff1879aa"
        },
        "pack": {
          "path": ".factory/state/cp06-correction/ten-pack/raw/COPY-001.pack.md",
          "sha256": "a243edee1bbcfbcd7b1737cd17021f2630985eb9baecb7343bb8a40bf39fab04"
        },
        "receipt": {
          "path": ".factory/state/cp06-correction/ten-pack/raw/COPY-001.receipt.json",
          "sha256": "45222c99e0e4c74a764d90655bbf2c8a4bdb800b50092184e590a3069ec686f9"
        },
        "token_budget": 4000,
        "estimated_tokens": 816,
        "byte_budget": 16000,
        "bytes": 2447,
        "ctx_generation": 2,
        "retrieval_mode": "HYBRID_SEMANTIC",
        "provenance": [
          "PROJECT.md",
          "ARCHITECTURE.md",
          "docs/STYLE.md"
        ],
        "irrelevant_topical_sources": [],
        "missing_target": false,
        "source_digests": {
          "PROJECT.md": "66ebc1d1dbab841fbc3f2b1f2c56f31b46eed62c4669bc80fd1f737cbca02a34",
          "ARCHITECTURE.md": "303f78b9c431047b16dc705b32445af7e61b88639c8182bef5132b1a6c73387b",
          "docs/STYLE.md": "0694cd4e159073ddec0a2ca911387b6b684decc427118358df09a366ff1879aa"
        }
      },
      {
        "task_id": "CONFIG-001",
        "risk": "bounded",
        "contract": {
          "path": "test/fixtures/cp06-context/.factory/tasks/CONFIG-001.yaml",
          "sha256": "b6835f95a421d9ae39370788e2315d34ef837ba500687eec133a4bd623f0f4f3"
        },
        "target_source": {
          "path": "test/fixtures/cp06-context/docs/CONFIG.md",
          "sha256": "6f018812db1b3e573b3936402c83ad6b

... [32967 bytes truncated] ...

ome/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/dist/src/cli.js context API-001 --root /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/.factory/state/cp06-correction/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R",
      "exit_code": 0,
      "output_path": ".factory/state/cp06-correction/ten-pack/raw/fixed-API-001.txt",
      "output_sha256": "65aa87f37a552d8154a0bb25ebd7a9582eda1aefa0367b2df6b064a5a15c9076"
    },
    {
      "id": "fixed-PERSIST-001",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/dist/src/cli.js context PERSIST-001 --root /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/.factory/state/cp06-correction/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R",
      "exit_code": 0,
      "output_path": ".factory/state/cp06-correction/ten-pack/raw/fixed-PERSIST-001.txt",
      "output_sha256": "97daabcf9f0192cc3e629858ca8131a18fe37a54e2c19dc86aebcde7cb04bcae"
    },
    {
      "id": "fixed-UI-001",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/dist/src/cli.js context UI-001 --root /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/.factory/state/cp06-correction/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R",
      "exit_code": 0,
      "output_path": ".factory/state/cp06-correction/ten-pack/raw/fixed-UI-001.txt",
      "output_sha256": "545174f2d254f459372e14f1376d9f6985ec37e294fd60958c81e9ae7cfb0c68"
    },
    {
      "id": "fixed-IMPORT-001",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/dist/src/cli.js context IMPORT-001 --root /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/.factory/state/cp06-correction/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R",
      "exit_code": 0,
      "output_path": ".factory/state/cp06-correction/ten-pack/raw/fixed-IMPORT-001.txt",
      "output_sha256": "ca604f241551b97f45659c5bd2a27e88bb7d0d7e19a2dbb34d22d2ec265a69f9"
    },
    {
      "id": "fixed-LOG-001",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/dist/src/cli.js context LOG-001 --root /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/.factory/state/cp06-correction/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R",
      "exit_code": 0,
      "output_path": ".factory/state/cp06-correction/ten-pack/raw/fixed-LOG-001.txt",
      "output_sha256": "6e0bfbbf61e78cf260bb6065113d5f31c9ee491598fa18c0b104743fec4a613b"
    },
    {
      "id": "fixed-EXPORT-001",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/dist/src/cli.js context EXPORT-001 --root /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/.factory/state/cp06-correction/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R",
      "exit_code": 0,
      "output_path": ".factory/state/cp06-correction/ten-pack/raw/fixed-EXPORT-001.txt",
      "output_sha256": "de2396eca7b8946aace175598d6b65152f784f1116d61aaab55a72645126ace9"
    },
    {
      "id": "fixed-DELETE-001",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/dist/src/cli.js context DELETE-001 --root /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/.factory/state/cp06-correction/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R",
      "exit_code": 0,
      "output_path": ".factory/state/cp06-correction/ten-pack/raw/fixed-DELETE-001.txt",
      "output_sha256": "e175f1efba435703a6548b66ac73d9a90968aec4ac5e24978475accb1cfc7590"
    },
    {
      "id": "fixed-AUTH-001",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/dist/src/cli.js context AUTH-001 --root /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/.factory/state/cp06-correction/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R",
      "exit_code": 0,
      "output_path": ".factory/state/cp06-correction/ten-pack/raw/fixed-AUTH-001.txt",
      "output_sha256": "97356615805b34687e6100e2e502c4e06248c5191ede5b82cea68644c16eab8f"
    },
    {
      "id": "disconfirming-missing-original",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/dist/src/cli.js context AUTH-001 --root /home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/.factory/state/cp06-correction/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R",
      "exit_code": 3,
      "output_path": ".factory/state/cp06-correction/ten-pack/raw/disconfirming-missing-original.txt",
      "output_sha256": "05c96602b24e87695b808a98ab08e0e0a5c54ebed149ac39b225478f973f3dca"
    }
  ],
  "result": "pass",
  "limitations": [
    "The semantic replay is verified on Linux with CTX 1.0.0 and the locally installed model.",
    "The small fixture demonstrates this fixed sample, not universal retrieval precision.",
    "Raw CTX JSON, packs, receipts, and command logs remain ignored scratch under .factory/state."
  ]
}
Evidence: CP-06 fresh worker event-audit transcript
{"ok":true,"gate":"P-06-fresh-worker","tested_sha":"355854fc4e6c16b03fb793825d93a7ed801e52d4","manifest_path":".factory/state/cp06-correction/worker/evidence.json","manifest_sha256":"55b3ce0dd6aa2dbd33972cf167ae190918ea3ad2fd90bde4b90bd47529755f98","exit_code":0,"status":"MISSING_SOURCE","reads":["/home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/.factory/state/cp06-correction/ten-pack/repo/docs/AUTH.md"],"broad_scan":false}
EXIT:0
Evidence: CP-06 fresh worker structured evidence manifest
{
  "schema_version": 1,
  "gate": "P-06-fresh-worker",
  "tested_sha": "355854fc4e6c16b03fb793825d93a7ed801e52d4",
  "recorded_at": "2026-09-29T11:02:21.530Z",
  "reviewer": "Pi CP-06 correction worker",
  "worker": {
    "pi_version": "0.85.1",
    "provider": "openai-codex",
    "model": "gpt-5.6-sol",
    "no_session": true,
    "no_context_files": true,
    "mode": "json",
    "tools": [
      "read"
    ]
  },
  "bounded_handoff": {
    "contract_path": "test/fixtures/cp06-context/cases/AUTH-before.yaml",
    "contract_sha256": "1463c777fcc44b45285a47711abe01a2514ce092cf245566af1c9e629996a927",
    "pack_path": ".factory/state/cp06-correction/ten-pack/raw/auth-initial-missing.pack.md",
    "pack_sha256": "15906884871427bfa356d4eae7b651b7cb90536509312bb71b81281b0708bb9c",
    "evidence": "in-memory auth 401 and concealed non-mutating cross-account 404 observations",
    "prompt_path": ".factory/state/cp06-correction/worker/prompt.txt",
    "prompt_sha256": "d30d5d53e2c9aa5e7187ecf995251c9180d44d845b88c00fb25d699569d4914d"
  },
  "event_stream": {
    "path": ".factory/state/cp06-correction/worker/event-stream.jsonl",
    "sha256": "60e8f0aab52bee7bad6191f5282294663e4a484321f7068a825051326156e2fe",
    "event_count": 339,
    "read_audit": {
      "read_count": 1,
      "project_read_count": 1,
      "project_read_paths": [
        "/home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/.factory/state/cp06-correction/ten-pack/repo/docs/AUTH.md"
      ],
      "allowed_skill_read_count": 0,
      "allowed_skill_read_paths": [],
      "rejected_read_paths": [],
      "other_tool_calls": []
    }
  },
  "command": "pi --mode json --no-session --no-context-files --no-extensions --no-skills --skill skills/factory --tools read <bounded-handoff>",
  "exit_code": 0,
  "output_path": ".factory/state/cp06-correction/worker/output.txt",
  "output_sha256": "c77850c1ae34fb61ba75405379995a7286739c00db05c8b1017fc077e4aad17a",
  "stderr_path": ".factory/state/cp06-correction/worker/stderr.txt",
  "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
  "response": {
    "status": "MISSING_SOURCE",
    "missing_source": "docs/AUTH.md was omitted from the bounded pack despite being decisive for creation ownership semantics.",
    "reads": [
      "/home/ansh/.treehouse/Factory-86709f/7/Factory/.factory/state/cp06-correction/no-mistakes/home/worktrees/696f060a49dd/01M3PD0GYS1WMCKR354Y76BN2R/.factory/state/cp06-correction/ten-pack/repo/docs/AUTH.md"
    ],
    "corrected_constraints": [
      "Ownership comes only from the authenticated principal.",
      "Request-supplied owner fields are ignored during creation.",
      "Missing or forged fixture credentials return 401.",
      "Cross-account read, update, and delete return non-disclosing 404 responses and do not mutate state."
    ],
    "evidence_gaps": [
      "Existing integration evidence does not demonstrate that creation ignores a request-supplied owner and binds ownership to the authenticated principal."
    ],
    "broad_scan": false
  },
  "result": "pass",
  "limitation": "Live model wording is nondeterministic; the script deterministically checks actual read tool-call events and required corrected constraints."
}
Evidence: P-07 replay transcript
{"ok":true,"gate":"P-07","tested_sha":"355854fc4e6c16b03fb793825d93a7ed801e52d4","manifest_path":".factory/state/cp06-correction/p07/evidence.json","manifest_sha256":"3c9eb544f266bec0be24dd051b99062ff283d499cc97cee9cf0a0ef0766c57bb","sequence":[{"id":"build","command":"npm run build","exit_code":0,"output_path":".factory/state/cp06-correction/p07/raw/build.txt","output_sha256":"665ce072dffd18b1720107dc8ea47cd800e604fb62ea3164ec087fef5517c632"},{"id":"fail-before","command":"/home/ansh/.nvm/versions/node/v24.20.0/bin/node test/fixtures/workflow/history/malformed-json-probe.mjs","exit_code":1,"output_path":".factory/state/cp06-correction/p07/raw/fail-before.txt","output_sha256":"665a1dc29c3766e1339d5d1029dd4bedf81f6ff4cecbcdbaf328f16be1dbde7e"},{"id":"fix-after","command":"/home/ansh/.nvm/versions/node/v24.20.0/bin/node --test \"--test-name-pattern=normal API fixture rejects malformed\" dist/test/workflow.test.js","exit_code":0,"output_path":".factory/state/cp06-correction/p07/raw/fix-after.txt","output_sha256":"e2b2348276227aaaf245236ec4f5b09ec00f60aa27c6a3c4d38a4ea75045ee9a"},{"id":"critical-auth-retest","command":"/home/ansh/.nvm/versions/node/v24.20.0/bin/node --test \"--test-name-pattern=critical auth fixture\" dist/test/workflow.test.js","exit_code":0,"output_path":".factory/state/cp06-correction/p07/raw/critical-auth-retest.txt","output_sha256":"7264d992d46789fffc712d9bc0fca1f0f14ceb77aa2dfe5a824472bd9ca0e649"}]}
EXIT:0
Evidence: P-07 structured evidence manifest
{
  "schema_version": 1,
  "gate": "P-07",
  "tested_sha": "355854fc4e6c16b03fb793825d93a7ed801e52d4",
  "recorded_at": "2026-09-29T11:01:58.091Z",
  "reviewer": "Pi CP-06 correction worker",
  "finding": {
    "path": "test/fixtures/workflow/history/finding.json",
    "sha256": "ac96d7c6100b3c163e0721af0e3b8706ec8718ae07308f120db0ba1e3e8cb059",
    "record": {
      "schema_version": 1,
      "finding_id": "P07-MALFORMED-JSON",
      "acceptance_id": "P-07",
      "reviewer": "CP-06 simulated task reviewer",
      "scenario": "PUT /v1/profile receives malformed JSON",
      "finding": "The normal API fixture throws SyntaxError instead of returning the stable 400 invalid_json response.",
      "disposition": "repaired",
      "repair": "Catch parse failure and return status 400 with error invalid_json.",
      "retest": "Execute the same malformed-JSON behavioral assertion against the checked-in final fixture."
    }
  },
  "sequence": [
    {
      "id": "build",
      "command": "npm run build",
      "expected_exit_code": 0,
      "exit_code": 0,
      "output_path": ".factory/state/cp06-correction/p07/raw/build.txt",
      "output_sha256": "665ce072dffd18b1720107dc8ea47cd800e604fb62ea3164ec087fef5517c632",
      "expected_output_fragments": []
    },
    {
      "id": "fail-before",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node test/fixtures/workflow/history/malformed-json-probe.mjs",
      "expected_exit_code": 1,
      "exit_code": 1,
      "output_path": ".factory/state/cp06-correction/p07/raw/fail-before.txt",
      "output_sha256": "665a1dc29c3766e1339d5d1029dd4bedf81f6ff4cecbcdbaf328f16be1dbde7e",
      "expected_output_fragments": [
        "SyntaxError",
        "not valid JSON"
      ]
    },
    {
      "id": "fix-after",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node --test \"--test-name-pattern=normal API fixture rejects malformed\" dist/test/workflow.test.js",
      "expected_exit_code": 0,
      "exit_code": 0,
      "output_path": ".factory/state/cp06-correction/p07/raw/fix-after.txt",
      "output_sha256": "e2b2348276227aaaf245236ec4f5b09ec00f60aa27c6a3c4d38a4ea75045ee9a",
      "expected_output_fragments": []
    },
    {
      "id": "critical-auth-retest",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node --test \"--test-name-pattern=critical auth fixture\" dist/test/workflow.test.js",
      "expected_exit_code": 0,
      "exit_code": 0,
      "output_path": ".factory/state/cp06-correction/p07/raw/critical-auth-retest.txt",
      "output_sha256": "7264d992d46789fffc712d9bc0fca1f0f14ceb77aa2dfe5a824472bd9ca0e649",
      "expected_output_fragments": []
    }
  ],
  "result": "pass",
  "limitations": [
    "Behavioral fixtures are in-memory and make no network or real-account access.",
    "The historical module is a minimal retained reproduction, not a raw worker transcript."
  ]
}
Evidence: Targeted context source-selection regression transcript
✔ context limits CTX retrieval to the task-local source selection (316.627655ms)
ℹ tests 1
ℹ suites 0
ℹ pass 1
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 378.280282
EXIT:0

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - medium risk

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • npm ci
  • npm run proof:cp06:ten-pack
  • npm run proof:cp06:p07
  • npm run proof:cp06:worker
  • npm 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.

@0xnotdev
0xnotdev merged commit cdaf5e5 into main Oct 6, 2026
2 checks passed
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