Skip to content

chore: update pull request - #10

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

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

Conversation

@0xnotdev

Copy link
Copy Markdown
Owner

Intent

Fix the three independently reproduced CP-06 contract defects while preserving all prior CP-06 and PR9 commits: constrain schema-valid empty context.required selections to mandatory global authority instead of unrestricted CTX retrieval; require fresh-worker replay evidence to correlate successful read start/end events, exact canonical original bytes and digest, decisive full-range text, and reject failed, partial, wrong-range, incomplete, or extra-project reads; exercise recovery of a concrete omitted creation-ownership rule; and remove the critical in-memory auth fixture cross-tenant identifier existence oracle while preserving normal API and auth negative behavior. Preserve existing architecture and do not alter CTX, Firstmate, no-mistakes, deployed security systems, live accounts, routing, or shipping configuration. Use disposable isolated evidence with no credentials or raw transcripts retained, enforce Linux-only read-only credential mount isolation with safe failure when unsupported, and document the limitation. Validate full npm checks, deterministic regressions, real CTX ten-pack and bad/blocked paths, fresh Pi worker evidence, P-07 fail-before/fix-after/retest, exact-head/source-digest integrity, and diff checks. Do not merge.

What Changed

Final changed paths and statuses:

M	ARCHITECTURE.md
M	BUILD_PLAN.md
M	docs/CONTRACTS.md
M	docs/INTEGRATIONS.md
M	docs/WORKFLOW.md
A	docs/probes/CP-06.md
M	package.json
A	scripts/cp06-credential-isolation.mjs
A	scripts/cp06-worker-audit.mjs
A	scripts/replay-cp06-p07.mjs
A	scripts/replay-cp06-ten-pack.mjs
A	scripts/replay-cp06-worker.mjs
M	skills/factory/SKILL.md
M	src/core/context.ts
M	test/context.test.ts
A	test/cp06-credential-isolation.test.mjs
A	test/cp06-worker-audit.test.mjs
A	test/fixtures/cp06-context/.factory/completion.yaml
A	test/fixtures/cp06-context/.factory/project.yaml
A	test/fixtures/cp06-context/.factory/tasks/API-001.yaml
A	test/fixtures/cp06-context/.factory/tasks/AUTH-001.yaml
A	test/fixtures/cp06-context/.factory/tasks/CONFIG-001.yaml
A	test/fixtures/cp06-context/.factory/tasks/COPY-001.yaml
A	test/fixtures/cp06-context/.factory/tasks/DELETE-001.yaml
A	test/fixtures/cp06-context/.factory/tasks/EXPORT-001.yaml
A	test/fixtures/cp06-context/.factory/tasks/IMPORT-001.yaml
A	test/fixtures/cp06-context/.factory/tasks/LOG-001.yaml
A	test/fixtures/cp06-context/.factory/tasks/PERSIST-001.yaml
A	test/fixtures/cp06-context/.factory/tasks/UI-001.yaml
A	test/fixtures/cp06-context/.gitignore
A	test/fixtures/cp06-context/ARCHITECTURE.md
A	test/fixtures/cp06-context/PROJECT.md
A	test/fixtures/cp06-context/cases/AUTH-before.yaml
A	test/fixtures/cp06-context/cases/AUTH-worker-before.yaml
A	test/fixtures/cp06-context/docs/API.md
A	test/fixtures/cp06-context/docs/AUTH.md
A	test/fixtures/cp06-context/docs/CONFIG.md
A	test/fixtures/cp06-context/docs/DELETION.md
A	test/fixtures/cp06-context/docs/EXPORT.md
A	test/fixtures/cp06-context/docs/IMPORT.md
A	test/fixtures/cp06-context/docs/OBSERVABILITY.md
A	test/fixtures/cp06-context/docs/PERSISTENCE.md
A	test/fixtures/cp06-context/docs/STYLE.md
A	test/fixtures/cp06-context/docs/UI.md
A	test/fixtures/cp06-context/oracle.json
A	test/fixtures/workflow/critical-auth-isolation.ts
A	test/fixtures/workflow/history/finding.json
A	test/fixtures/workflow/history/malformed-json-probe.mjs
A	test/fixtures/workflow/history/normal-api-before.mjs
A	test/fixtures/workflow/normal-api.ts
A	test/workflow.test.ts

Risk Assessment

✅ Low: The changes are well-scoped to CP-06 context scoping, replay evidence, and credential-isolation proofing, with no substantiated merge-blocking defects found in the reviewed diff.

Testing

Exercised the targeted CP-06 regressions and end-to-end proofs: schema/CTX scoping, worker read-audit rejection cases, auth fixture behavior, Linux credential mount isolation, real ten-pack CTX proof, P-07 fail-before/fix-after/retest, fresh Pi worker recovery of the omitted ownership rule, and exact-head diff check; all commands passed and transient build/dependency outputs were removed from the worktree.

Evidence: CP-06 ten-pack proof manifest
{
  "schema_version": 1,
  "gate": "P-06",
  "tested_sha": "385b80eb6dd3432fcaf063842ade70aa59c90c8d",
  "recorded_at": "2026-09-29T19:11:37.893Z",
  "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": "7c1db3b878bff687f8526c19d0477b7c23c3b864374bd59af7c4337d2feebe6f",
      "oracle.json": "3bbee93babb5c6e65962f03eeef13347fc650f662cd38bdaa4a10aefcc9aa60e",
      "cases/AUTH-before.yaml": "1463c777fcc44b45285a47711abe01a2514ce092cf245566af1c9e629996a927",
      "cases/AUTH-worker-before.yaml": "9d573f04f622022be341901284420fb7dbf2164c39aaed366da155f0b1274c6c",
      ".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": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/raw/bad-unscoped-auth.txt",
      "output_sha256": "e63db8584ca479ca397a12194f9eadaaa51fda925cfddca4269c9af383399918",
      "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
    },
    "empty_selection": {
      "semantics": "empty task-local authority falls back to mandatory global document filters",
      "factory_exit_code": 0,
      "factory_output_path": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/raw/empty-selection-factory.txt",
      "factory_output_sha256": "2fedb81f1a3ec84e5e264276b7b02d1900af389811bf40687fd283caa5709253",
      "factory_topical_source_digests": [],
      "ctx_exit_code": 0,
      "ctx_output_path": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/raw/empty-selection-real-ctx.txt",
      "ctx_output_sha256": "b6f9199c74ab83fcd3674f80fe81e0ed3f0e04c5e4e497d2540118c05953aeca",
      "ctx_completeness_status": "COMPLETE",
      "ctx_provenance": [
        {
          "path": "PROJECT.md",
          "document_sha256": "66ebc1d1dbab841fbc3f2b1f2c56f31b46eed62c4669bc80fd1f737cbca02a34"
        },
        {
          "path": "ARCHITECTURE.md",
          "document_sha256": "7c1db3b878bff687f8526c19d0477b7c23c3b864374bd59af7c4337d2feebe6f"
        }
      ]
    },
    "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": "40761975df3a564baf0b4db77c39df719d664aa57d9f9b6bbdf556b87886f61c",
      "after_pack_sha256": "82f56459b9ba2976308148939b0a1d574ba52c8405e784de65236fcb51f1bf89",
      "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": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/raw/disconfirming-partial-ctx.txt",
      "output_sha256": "8d3fa6729959a8da8aebf0aea6518696c14e8e5503bda54000c48d83891c888c"
    },
    "disconfirming_missing_original_case": {
      "condition": "declared required original docs/ABSENT.md does not exist",
      "exit_code": 3,
      "error_code": "CONTEXT_BLOCKED",
      "output_path": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/raw/disconfirming-missing-original.txt",
      "output_sha256": "e1af39850565daf47f6481be299d95e9df5baaad1d0c27448339e4293f5ad6b2",
      "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"
        },
        "

... [46849 bytes truncated] ...

h/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R/dist/src/cli.js context PERSIST-001 --root /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R",
      "exit_code": 0,
      "output_path": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/raw/fixed-PERSIST-001.txt",
      "output_sha256": "48cc3e61a054cfec384b0e773c569085c7d7c835dd95d157618cb8703a2a7ef7"
    },
    {
      "id": "fixed-UI-001",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R/dist/src/cli.js context UI-001 --root /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R",
      "exit_code": 0,
      "output_path": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/raw/fixed-UI-001.txt",
      "output_sha256": "bce683401b9d34cf3c1b2f2da428046db49ff563b5cd054658df56b14e3514c7"
    },
    {
      "id": "fixed-IMPORT-001",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R/dist/src/cli.js context IMPORT-001 --root /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R",
      "exit_code": 0,
      "output_path": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/raw/fixed-IMPORT-001.txt",
      "output_sha256": "df1d5dedf2eacea8837c2534a7b074df5a2384d673867976f65a07ab360b3d1f"
    },
    {
      "id": "fixed-LOG-001",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R/dist/src/cli.js context LOG-001 --root /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R",
      "exit_code": 0,
      "output_path": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/raw/fixed-LOG-001.txt",
      "output_sha256": "c3b6dd84c5c5e642280292f6184e71154dc11fdc9a9a501c72b9626bc4054150"
    },
    {
      "id": "fixed-EXPORT-001",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R/dist/src/cli.js context EXPORT-001 --root /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R",
      "exit_code": 0,
      "output_path": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/raw/fixed-EXPORT-001.txt",
      "output_sha256": "9eaf0da9d8a0e9a701ed8f1b9faaf01ecf7946a49111086f92f18a2ca16a71b6"
    },
    {
      "id": "fixed-DELETE-001",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R/dist/src/cli.js context DELETE-001 --root /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R",
      "exit_code": 0,
      "output_path": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/raw/fixed-DELETE-001.txt",
      "output_sha256": "00f8f4d8bf0d3f27af17b1322cf7682e6639fb90a345c2366152b1fd5588c1cd"
    },
    {
      "id": "fixed-AUTH-001",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R/dist/src/cli.js context AUTH-001 --root /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R",
      "exit_code": 0,
      "output_path": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/raw/fixed-AUTH-001.txt",
      "output_sha256": "0eb6ebed0bd72f58ef636ca941fac391c8c450939c92f793a269d68e75911836"
    },
    {
      "id": "disconfirming-missing-original",
      "command": "/home/ansh/.nvm/versions/node/v24.20.0/bin/node /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R/dist/src/cli.js context AUTH-001 --root /home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/repo --ctx-bin /home/ansh/.local/bin/ctx --json",
      "cwd": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/worktrees/eb301ead8f3b/01M3Q8K3A6FJJNJPXAE19VQH4R",
      "exit_code": 3,
      "output_path": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/raw/disconfirming-missing-original.txt",
      "output_sha256": "e1af39850565daf47f6481be299d95e9df5baaad1d0c27448339e4293f5ad6b2"
    }
  ],
  "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: P-07 replay proof manifest
{
  "schema_version": 1,
  "gate": "P-07",
  "tested_sha": "385b80eb6dd3432fcaf063842ade70aa59c90c8d",
  "recorded_at": "2026-09-29T19:11:43.242Z",
  "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": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/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": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/p07/raw/fail-before.txt",
      "output_sha256": "7620340755a59cb6a25625f01ec54867f5e84db0fc65e352275d0730c90a2c48",
      "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": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/p07/raw/fix-after.txt",
      "output_sha256": "adf829c8f405a786c28e4bda5a508ac9a364028ad382b7b0a79b43027731f12e",
      "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": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/p07/raw/critical-auth-retest.txt",
      "output_sha256": "15c3fd756e07823cc2dfb5dd8f170a240d941cd487f250ca72c623dcfcae8bba",
      "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: Fresh Pi worker proof manifest
{
  "schema_version": 1,
  "gate": "P-06-fresh-worker",
  "tested_sha": "385b80eb6dd3432fcaf063842ade70aa59c90c8d",
  "recorded_at": "2026-09-29T19:12:01.731Z",
  "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-worker-before.yaml",
    "contract_sha256": "9d573f04f622022be341901284420fb7dbf2164c39aaed366da155f0b1274c6c",
    "pack_path": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/raw/auth-worker-missing.pack.md",
    "pack_sha256": "0e9149e7a30d78fc31c24506e6bf3571d493ee7c5387b547b57101468323be0a",
    "original_path": "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/repo/docs/AUTH.md",
    "original_sha256": "353572470edee8e83c022c1ce763d05bfa3e628a77fb5c42fc1b1eb91491abd1",
    "deliberately_omitted_constraint_sha256": "3763bc1b67af5245b59de88533aab757a5c3f23218ff9941a5437db304fe696e",
    "evidence": "in-memory auth 401 and concealed non-mutating cross-account 404 observations",
    "prompt_sha256": "82b968bdd2e7411dd08dde71ab9ea67b44ef6958783bb7d3dbc17c6cf1011bf6"
  },
  "isolation": {
    "disposable_home": true,
    "disposable_pi_agent_dir": true,
    "credential_mode": "Linux user/mount namespace; live source and isolated auth regular file bind-mounted read-only; no symlink; no copy",
    "dummy_destructive_probe": {
      "source_unchanged": true,
      "atomic_replacement_denied": true
    },
    "live_mount_checks": {
      "non_writing_read_only_mount_checks": true,
      "destructive_real_source_probe": false
    },
    "credential_source_unchanged": true,
    "raw_transcript_retained": false
  },
  "event_stream": {
    "sha256": "6a847d0132daef965fbdb4c529b059a023797b12c0ebba9d205d3b207680b3a0",
    "event_count": 270,
    "read_audit": {
      "read_count": 1,
      "project_read_count": 1,
      "project_read_paths": [
        "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/repo/docs/AUTH.md"
      ],
      "rejected_read_paths": [],
      "other_tool_calls": [],
      "completed_successfully": true,
      "exact_original": true,
      "expected_sha256": "353572470edee8e83c022c1ce763d05bfa3e628a77fb5c42fc1b1eb91491abd1",
      "returned_sha256": "353572470edee8e83c022c1ce763d05bfa3e628a77fb5c42fc1b1eb91491abd1",
      "returned_bytes": 276,
      "tool_call_id": "call_HGz2ZxXdJBtN88tfU6Xa7Yjb|fc_0509e31719ecea96016abc0d76922887d0a85240dba31e3883",
      "start_event_index": 86,
      "end_event_index": 87,
      "response_event_index": 266
    }
  },
  "command": "pi --mode json --no-session --no-context-files --no-extensions --no-skills --skill skills/factory --tools read <bounded-handoff>",
  "exit_code": 0,
  "output_sha256": "0566bab159ba8b5dda4352c02fa0501e1a739473a3eef7552ea6d13a1dd7cab7",
  "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
  "response": {
    "status": "MISSING_SOURCE",
    "missing_source": "docs/AUTH.md",
    "reads": [
      "/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof/ten-pack/repo/docs/AUTH.md"
    ],
    "corrected_constraints": [
      "Creation ownership comes only from the authenticated principal; request-supplied owner fields are ignored."
    ],
    "evidence_gaps": [
      "Existing integration evidence does not verify creation-time ownership or ignored request-supplied owner fields."
    ],
    "broad_scan": false
  },
  "result": "pass",
  "limitation": "Live model wording is nondeterministic; credential mount isolation requires Linux unshare/mount support and fails safe before Pi is invoked when unsupported; the script deterministically checks actual read tool-call events and required corrected constraints."
}
Evidence: Exact-head diff check
git diff --check 8337ab7fcc5b511d3cb359ea214b6ae18003aeaa..HEAD
exit=0

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 2 issues found → auto-fixed ✅
  • 🚨 scripts/replay-cp06-worker.mjs:98 - The isolated auth path is only a symlink inside a writable evaluation agent directory, so a normal atomic credential refresh can write a temp file and rename it over auth.json without following the read-only symlink. That leaves the fresh Pi worker able to create credential state in the disposable home despite the required "read-only credential mount isolation" / "no credential copy/export" constraint; bind-mount the credential read-only onto the actual isolated auth path or otherwise OS-deny replacement/unlink at that path before running Pi.
  • 🚨 scripts/replay-cp06-worker.mjs:99 - The denied-write probe iterates over credentialSource and attempts writeFile against the caller's real Pi auth file. The accepted requirement was to use dummy credentials for denied write probes and perform "no original-file writes"; even though the mount should reject it, this is still an intentional write attempt to the original credential path. Probe destructive writes against a dummy/read-only fixture and only expose the live credential through the proven read-only mechanism.

🔧 Fix: Harden CP-06 credential isolation
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • npm ci
  • npm run build && node --test test/cp06-credential-isolation.test.mjs test/cp06-worker-audit.test.mjs dist/test/context.test.js dist/test/workflow.test.js
  • CP06_OUTPUT=/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof npm run proof:cp06:ten-pack
  • CP06_OUTPUT=/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof npm run proof:cp06:p07
  • CP06_OUTPUT=/home/ansh/.treehouse/Factory-86709f/8/Factory/.factory/state/cp06-final-correction/no-mistakes/home/evidence/01M3Q8K3A6FJJNJPXAE19VQH4R/cp06-proof npm run proof:cp06:worker
  • git diff --check 8337ab7fcc5b511d3cb359ea214b6ae18003aeaa..HEAD
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@0xnotdev
0xnotdev merged commit 385b80e 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