From 12d9d757adf271660e7f4113e4cc757702a41a3c Mon Sep 17 00:00:00 2001 From: Monsky Date: Sat, 1 Aug 2026 21:48:19 -0400 Subject: [PATCH] docs: freeze lifecycle source digest authority --- AGENTS.md | 6 +- docs/INDEX.md | 10 +- .../lifecycle-source-digest-authority.json | 158 ++++++++++ ...ecycle-source-digest-authority.schema.json | 274 ++++++++++++++++++ docs/roadmap/REMAINING_EXECUTION_PLAN.md | 29 +- docs/roadmap/TASK_PACKETS.md | 4 +- ...7r1-correct-lifecycle-preparation-scale.md | 31 +- ...-07r1a0-freeze-lifecycle-path-authority.md | 30 +- scripts/check_kernel_scope.py | 2 + tests/kernel/test_documentation_authority.py | 78 ++++- tests/kernel/test_kernel_scope.py | 2 + 11 files changed, 579 insertions(+), 45 deletions(-) create mode 100644 docs/decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.json create mode 100644 docs/decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.schema.json diff --git a/AGENTS.md b/AGENTS.md index ae5c0a95..5fb2a79f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,8 +33,10 @@ corrective proof. CK-08R0 froze `corrective-gates-v1`; CK-08R2 is complete and CK-09 remains blocked. CK-08R1A freezes corrected answer meaning before disjoint R1B/R1C implementation and final R1 requalification. CK-QG1A must remove two R2 page-executor complexity findings without changing behavior or -the frozen baseline before existing QG1 PR #392 resumes. CK-07R1A must correct -the exact hosted Python 3.14 lifecycle-tail blocker before PR #394 resumes. +the frozen baseline before existing QG1 PR #392 resumes. CK-07R1A corrected +the exact hosted Python 3.14 lifecycle-tail blocker; the linked CK-07R1A0 +source-digest authority must be merged and exact-main verified before the +existing CK-07R1 worker may resume. PR #394 remains stale failed read-only. Retained R3 evidence proved the EvidenceService outer query physically unbounded; CK-08R3A owns that isolated fix and R3 awaits its accepted, merged, exact-main-verified result. diff --git a/docs/INDEX.md b/docs/INDEX.md index ee37ee75..d16034d9 100644 --- a/docs/INDEX.md +++ b/docs/INDEX.md @@ -28,9 +28,13 @@ CK-07R1A0 is accepted at exact main `519b503aa3b23019033b6481687c08b23fc6c31e`. Its transition authority makes the planner-valid receipt a CK-07R1 successor acceptance output rather than a pre-dispatch dependency. PR #394 remains a stale failed read-only witness; it is not updated, rerun, or merged. CK-07R1 -is Conditional Ready only after this authority merges and exact-main verifies; -no other successor is advanced. Reclassification and maintainability remain -open. The central authority is +is held behind the linked [source-digest authority](decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.json), +which freezes predecessor `408d18e4…` to the permitted successor +`d192c858…` and requires exact-main worker revalidation before any one-run +gate can be considered. CK-07R1 is Conditional Ready only after that +source-digest authority merges and exact-main verifies; no other successor is +advanced and the one-run gate remains unspent. Reclassification and +maintainability remain open. The central authority is [REMAINING_EXECUTION_PLAN.md](roadmap/REMAINING_EXECUTION_PLAN.md). ## Authority set diff --git a/docs/decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.json b/docs/decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.json new file mode 100644 index 00000000..153f1203 --- /dev/null +++ b/docs/decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.json @@ -0,0 +1,158 @@ +{ + "schema": "codex-usage-tracker.lifecycle-source-digest-authority.v1", + "authority_version": 1, + "owner": "CK-07R1A0", + "authority_base_sha": "d911b1f0d17596890a6a0a608be904330c96e9a6", + "source_path": "src/codex_usage_tracker/agent_kernel/publication/preparation.py", + "predecessor": { + "sha256": "408d18e44c87da234d220c29298ebac1780e9426e2dce767b0bfc3ae65e8a872", + "accepted_merge_sha": "d911b1f0d17596890a6a0a608be904330c96e9a6", + "authority": { + "path": "docs/decisions/evidence/ck08r0/corrective-gates-v1.json", + "sha256": "8f2bc6762b3b12f3c42ad72fb23ccaa49bfde3124280082fa65766bb9ceb9936" + } + }, + "selected_successor": { + "sha256": "d192c858b48e44b5aa7a7e39ef524e5ec2f08085655fe485639f5e875a727aa1", + "status": "permitted_not_accepted", + "blocked_task": "019fbfe2-8fe4-7de2-9264-d58572366727", + "retained_branch": "feature/ck-07r1-lifecycle-path-requalification", + "retained_worktree": "2026-08-01/codex-usage-tracker-ck07r1-lifecycle-path-requalification", + "base_sha": "d911b1f0d17596890a6a0a608be904330c96e9a6", + "witness_status": "retained_uncommitted_read_only", + "diff_identity": { + "modified": [ + { + "path": "src/codex_usage_tracker/agent_kernel/publication/preparation.py", + "from_sha256": "408d18e44c87da234d220c29298ebac1780e9426e2dce767b0bfc3ae65e8a872", + "to_sha256": "d192c858b48e44b5aa7a7e39ef524e5ec2f08085655fe485639f5e875a727aa1", + "patch_sha256": "7961e6922f7088a5ca1970ef9fa2a1762364dc257b0f751e87546feaa44e9a01" + } + ], + "untracked": [ + { + "path": "scripts/benchmark_ck07r1_lifecycle_scale.py", + "sha256": "c0cd2d64109b4b39340699b153d6645dc11aaa6185151cd4b38c9320244eaea5" + }, + { + "path": "tests/agent_kernel/publication/test_lifecycle_scale.py", + "sha256": "66d464a4348ef83ced7c2bff20c218393e7e2485ca11d40ef84630e06efce608" + } + ] + } + }, + "allowed_scope": { + "files": [ + "src/codex_usage_tracker/agent_kernel/publication/preparation.py", + "scripts/benchmark_ck07r1_lifecycle_scale.py", + "tests/agent_kernel/publication/test_lifecycle_scale.py" + ], + "lifecycle_symbols": [ + "codex_usage_tracker.agent_kernel.publication.preparation._WriteSetPreparer._build_lifecycle" + ], + "forbidden_files": [ + "src/codex_usage_tracker/agent_kernel/publication/planner.py", + "src/codex_usage_tracker/agent_kernel/publication/writer.py", + "src/codex_usage_tracker/agent_kernel/publication/recovery.py", + "src/codex_usage_tracker/agent_kernel/storage/", + "src/codex_usage_tracker/agent_kernel/query/", + "src/codex_usage_tracker/agent_kernel/evidence/" + ] + }, + "reachable_consumer_path": { + "producer_to_preparation": [ + "codex_usage_tracker.agent_kernel.publication.writer.prepare_write_set_from_changes", + "codex_usage_tracker.agent_kernel.publication.preparation.prepare_write_set", + "codex_usage_tracker.agent_kernel.publication.preparation._WriteSetPreparer.prepare", + "codex_usage_tracker.agent_kernel.publication.preparation._WriteSetPreparer._build_lifecycle" + ], + "preparation_to_consumer": [ + "PublicationWriteSet.lifecycle", + "codex_usage_tracker.agent_kernel.publication.recovery.publish_small_with_pointer", + "codex_usage_tracker.agent_kernel.publication.writer.PublicationWriter.publish_with_pointer", + "codex_usage_tracker.agent_kernel.publication.writer.PublicationWriter.publish" + ], + "required_ordering": "recovery_read_first; planner_before_writer_lock; selected_plan_unchanged_through_writer", + "mismatch_result": "fail_closed_before_acceptance_no_stitched_artifacts_or_cross_run_identity_binding" + }, + "independent_truth": { + "reference_path": "tests/agent_kernel/contracts/reference/lifecycle.py", + "reference_symbol": "fold_lifecycle", + "vector_tests": "tests/agent_kernel/contracts/test_lifecycle_vectors.py", + "consumer_tests": [ + "tests/agent_kernel/publication/test_preparation.py", + "tests/agent_kernel/publication/test_lifecycle_scale.py" + ], + "required_comparisons": [ + "lifecycle transition identity and version", + "independent fold state and transition count", + "publication lifecycle counts and postconditions" + ], + "forbidden_sources": [ + "codex_usage_tracker.agent_kernel.publication.preparation", + "codex_usage_tracker.agent_kernel.publication.planner", + "codex_usage_tracker.agent_kernel.publication.writer", + "codex_usage_tracker.agent_kernel.publication.recovery", + "SQLite rows as expected answers" + ] + }, + "worker_revalidation": { + "required": true, + "worker_task": "019fbfe2-8fe4-7de2-9264-d58572366727", + "start": "fresh worktree from the exact merged main SHA of this authority", + "reapply": "deliberately reapply the retained candidate diff; never rebase, stash, reset, clean, delete, overwrite, or mutate the witness", + "checks_before_end_to_end_run": [ + "verify the exact-main predecessor digest", + "verify the selected successor digest after reapplying the retained candidate", + "verify the exact candidate base, changed paths, and lifecycle symbol", + "run all focused authority, digest, schema, DAG, and scope gates", + "run the worker pre-run gates before considering the one-run gate" + ], + "different_digest": "fail_closed", + "one_run_gate": "unspent_unavailable_until_authority_merge_exact_main_and_all_worker_pre_run_gates_pass" + }, + "preserved_authority": { + "path": "docs/decisions/evidence/ck07r1a0/lifecycle-path-authority.json", + "sha256": "315f143661efa89f572484a7fc1e17754be5537c143fa2be1d97a041ad7b44b1", + "schema_path": "docs/decisions/evidence/ck07r1a0/lifecycle-path-authority.schema.json", + "schema_sha256": "181fa2290457e1149764b5f5952559838e70d4f81a512bc920aeb52592fc7856", + "writer_only_receipt_digest": "935e4427b93e67c5ca649b773b0b3895dafac87f49bc76d7ed8917dff2f0250d", + "prior_attempt_ids": [ + "all-profile-initial-serializer", + "all-profile-corrected-serializer-tail-oracle", + "all-profile-pid-60367-recovery", + "production-only-valid-profile" + ], + "preservation": "all prior attempt identities, timestamps, failures, receipts, and statuses remain retained read-only and are never reused or upgraded" + }, + "pr_394_policy": { + "number": 394, + "head_sha": "98a9b5b82951d136644a5fe5f8a70d320131ba08", + "workflow_run_id": "30685780055", + "failed_job_id": "91331138768", + "failure": "ordinary.2000_call_tail", + "status": "stale_failed_superseded_read_only", + "policy": "do_not_update_rerun_merge_or_reinterpret" + }, + "runtime_budgets_ms": { + "first_publication_30_day": 5000, + "production_all_time": 120000, + "no_change": 100, + "one_call_tail": 500, + "one_tool_tail": 500 + }, + "package_ceilings_bytes": { + "sdist": 2000000, + "wheel": 1000000 + }, + "maximum_new_end_to_end_runs": 1, + "run_status": "unspent_unavailable", + "constraints": [ + "generic_digest_drift_forbidden", + "any_different_preparation_digest_fails_closed", + "selected_successor_is_permitted_not_accepted", + "candidate_witness_is_retained_uncommitted_read_only", + "worker_must_revalidate_on_exact_merged_main_before_any_end_to_end_run", + "no_new_worker_or_downstream_ready_task_from_this_authority" + ] +} diff --git a/docs/decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.schema.json b/docs/decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.schema.json new file mode 100644 index 00000000..2a002dbc --- /dev/null +++ b/docs/decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.schema.json @@ -0,0 +1,274 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://codex-usage-tracker.invalid/schemas/lifecycle-source-digest-authority-v1.schema.json", + "title": "CK-07R1A0 lifecycle source-digest supersession authority", + "type": "object", + "additionalProperties": false, + "required": [ + "schema", + "authority_version", + "owner", + "authority_base_sha", + "source_path", + "predecessor", + "selected_successor", + "allowed_scope", + "reachable_consumer_path", + "independent_truth", + "worker_revalidation", + "preserved_authority", + "pr_394_policy", + "runtime_budgets_ms", + "package_ceilings_bytes", + "maximum_new_end_to_end_runs", + "run_status", + "constraints" + ], + "properties": { + "schema": {"const": "codex-usage-tracker.lifecycle-source-digest-authority.v1"}, + "authority_version": {"const": 1}, + "owner": {"const": "CK-07R1A0"}, + "authority_base_sha": {"const": "d911b1f0d17596890a6a0a608be904330c96e9a6"}, + "source_path": {"const": "src/codex_usage_tracker/agent_kernel/publication/preparation.py"}, + "predecessor": { + "type": "object", + "additionalProperties": false, + "required": ["sha256", "accepted_merge_sha", "authority"], + "properties": { + "sha256": {"const": "408d18e44c87da234d220c29298ebac1780e9426e2dce767b0bfc3ae65e8a872"}, + "accepted_merge_sha": {"const": "d911b1f0d17596890a6a0a608be904330c96e9a6"}, + "authority": { + "type": "object", + "additionalProperties": false, + "required": ["path", "sha256"], + "properties": { + "path": {"const": "docs/decisions/evidence/ck08r0/corrective-gates-v1.json"}, + "sha256": {"const": "8f2bc6762b3b12f3c42ad72fb23ccaa49bfde3124280082fa65766bb9ceb9936"} + } + } + } + }, + "selected_successor": { + "type": "object", + "additionalProperties": false, + "required": [ + "sha256", "status", "blocked_task", "retained_branch", "retained_worktree", + "base_sha", "witness_status", "diff_identity" + ], + "properties": { + "sha256": {"const": "d192c858b48e44b5aa7a7e39ef524e5ec2f08085655fe485639f5e875a727aa1"}, + "status": {"const": "permitted_not_accepted"}, + "blocked_task": {"const": "019fbfe2-8fe4-7de2-9264-d58572366727"}, + "retained_branch": {"const": "feature/ck-07r1-lifecycle-path-requalification"}, + "retained_worktree": {"const": "2026-08-01/codex-usage-tracker-ck07r1-lifecycle-path-requalification"}, + "base_sha": {"const": "d911b1f0d17596890a6a0a608be904330c96e9a6"}, + "witness_status": {"const": "retained_uncommitted_read_only"}, + "diff_identity": { + "type": "object", + "additionalProperties": false, + "required": ["modified", "untracked"], + "properties": { + "modified": { + "const": [ + { + "path": "src/codex_usage_tracker/agent_kernel/publication/preparation.py", + "from_sha256": "408d18e44c87da234d220c29298ebac1780e9426e2dce767b0bfc3ae65e8a872", + "to_sha256": "d192c858b48e44b5aa7a7e39ef524e5ec2f08085655fe485639f5e875a727aa1", + "patch_sha256": "7961e6922f7088a5ca1970ef9fa2a1762364dc257b0f751e87546feaa44e9a01" + } + ] + }, + "untracked": { + "const": [ + { + "path": "scripts/benchmark_ck07r1_lifecycle_scale.py", + "sha256": "c0cd2d64109b4b39340699b153d6645dc11aaa6185151cd4b38c9320244eaea5" + }, + { + "path": "tests/agent_kernel/publication/test_lifecycle_scale.py", + "sha256": "66d464a4348ef83ced7c2bff20c218393e7e2485ca11d40ef84630e06efce608" + } + ] + } + } + } + } + }, + "allowed_scope": { + "type": "object", + "additionalProperties": false, + "required": ["files", "lifecycle_symbols", "forbidden_files"], + "properties": { + "files": { + "const": [ + "src/codex_usage_tracker/agent_kernel/publication/preparation.py", + "scripts/benchmark_ck07r1_lifecycle_scale.py", + "tests/agent_kernel/publication/test_lifecycle_scale.py" + ] + }, + "lifecycle_symbols": { + "const": [ + "codex_usage_tracker.agent_kernel.publication.preparation._WriteSetPreparer._build_lifecycle" + ] + }, + "forbidden_files": { + "const": [ + "src/codex_usage_tracker/agent_kernel/publication/planner.py", + "src/codex_usage_tracker/agent_kernel/publication/writer.py", + "src/codex_usage_tracker/agent_kernel/publication/recovery.py", + "src/codex_usage_tracker/agent_kernel/storage/", + "src/codex_usage_tracker/agent_kernel/query/", + "src/codex_usage_tracker/agent_kernel/evidence/" + ] + } + } + }, + "reachable_consumer_path": { + "type": "object", + "additionalProperties": false, + "required": ["producer_to_preparation", "preparation_to_consumer", "required_ordering", "mismatch_result"], + "properties": { + "producer_to_preparation": { + "const": [ + "codex_usage_tracker.agent_kernel.publication.writer.prepare_write_set_from_changes", + "codex_usage_tracker.agent_kernel.publication.preparation.prepare_write_set", + "codex_usage_tracker.agent_kernel.publication.preparation._WriteSetPreparer.prepare", + "codex_usage_tracker.agent_kernel.publication.preparation._WriteSetPreparer._build_lifecycle" + ] + }, + "preparation_to_consumer": { + "const": [ + "PublicationWriteSet.lifecycle", + "codex_usage_tracker.agent_kernel.publication.recovery.publish_small_with_pointer", + "codex_usage_tracker.agent_kernel.publication.writer.PublicationWriter.publish_with_pointer", + "codex_usage_tracker.agent_kernel.publication.writer.PublicationWriter.publish" + ] + }, + "required_ordering": {"const": "recovery_read_first; planner_before_writer_lock; selected_plan_unchanged_through_writer"}, + "mismatch_result": {"const": "fail_closed_before_acceptance_no_stitched_artifacts_or_cross_run_identity_binding"} + } + }, + "independent_truth": { + "type": "object", + "additionalProperties": false, + "required": ["reference_path", "reference_symbol", "vector_tests", "consumer_tests", "required_comparisons", "forbidden_sources"], + "properties": { + "reference_path": {"const": "tests/agent_kernel/contracts/reference/lifecycle.py"}, + "reference_symbol": {"const": "fold_lifecycle"}, + "vector_tests": {"const": "tests/agent_kernel/contracts/test_lifecycle_vectors.py"}, + "consumer_tests": { + "const": [ + "tests/agent_kernel/publication/test_preparation.py", + "tests/agent_kernel/publication/test_lifecycle_scale.py" + ] + }, + "required_comparisons": { + "const": [ + "lifecycle transition identity and version", + "independent fold state and transition count", + "publication lifecycle counts and postconditions" + ] + }, + "forbidden_sources": { + "const": [ + "codex_usage_tracker.agent_kernel.publication.preparation", + "codex_usage_tracker.agent_kernel.publication.planner", + "codex_usage_tracker.agent_kernel.publication.writer", + "codex_usage_tracker.agent_kernel.publication.recovery", + "SQLite rows as expected answers" + ] + } + } + }, + "worker_revalidation": { + "type": "object", + "additionalProperties": false, + "required": ["required", "worker_task", "start", "reapply", "checks_before_end_to_end_run", "different_digest", "one_run_gate"], + "properties": { + "required": {"const": true}, + "worker_task": {"const": "019fbfe2-8fe4-7de2-9264-d58572366727"}, + "start": {"const": "fresh worktree from the exact merged main SHA of this authority"}, + "reapply": {"const": "deliberately reapply the retained candidate diff; never rebase, stash, reset, clean, delete, overwrite, or mutate the witness"}, + "checks_before_end_to_end_run": { + "const": [ + "verify the exact-main predecessor digest", + "verify the selected successor digest after reapplying the retained candidate", + "verify the exact candidate base, changed paths, and lifecycle symbol", + "run all focused authority, digest, schema, DAG, and scope gates", + "run the worker pre-run gates before considering the one-run gate" + ] + }, + "different_digest": {"const": "fail_closed"}, + "one_run_gate": {"const": "unspent_unavailable_until_authority_merge_exact_main_and_all_worker_pre_run_gates_pass"} + } + }, + "preserved_authority": { + "type": "object", + "additionalProperties": false, + "required": ["path", "sha256", "schema_path", "schema_sha256", "writer_only_receipt_digest", "prior_attempt_ids", "preservation"], + "properties": { + "path": {"const": "docs/decisions/evidence/ck07r1a0/lifecycle-path-authority.json"}, + "sha256": {"const": "315f143661efa89f572484a7fc1e17754be5537c143fa2be1d97a041ad7b44b1"}, + "schema_path": {"const": "docs/decisions/evidence/ck07r1a0/lifecycle-path-authority.schema.json"}, + "schema_sha256": {"const": "181fa2290457e1149764b5f5952559838e70d4f81a512bc920aeb52592fc7856"}, + "writer_only_receipt_digest": {"const": "935e4427b93e67c5ca649b773b0b3895dafac87f49bc76d7ed8917dff2f0250d"}, + "prior_attempt_ids": { + "const": [ + "all-profile-initial-serializer", + "all-profile-corrected-serializer-tail-oracle", + "all-profile-pid-60367-recovery", + "production-only-valid-profile" + ] + }, + "preservation": {"const": "all prior attempt identities, timestamps, failures, receipts, and statuses remain retained read-only and are never reused or upgraded"} + } + }, + "pr_394_policy": { + "type": "object", + "additionalProperties": false, + "required": ["number", "head_sha", "workflow_run_id", "failed_job_id", "failure", "status", "policy"], + "properties": { + "number": {"const": 394}, + "head_sha": {"const": "98a9b5b82951d136644a5fe5f8a70d320131ba08"}, + "workflow_run_id": {"const": "30685780055"}, + "failed_job_id": {"const": "91331138768"}, + "failure": {"const": "ordinary.2000_call_tail"}, + "status": {"const": "stale_failed_superseded_read_only"}, + "policy": {"const": "do_not_update_rerun_merge_or_reinterpret"} + } + }, + "runtime_budgets_ms": { + "type": "object", + "additionalProperties": false, + "required": ["first_publication_30_day", "production_all_time", "no_change", "one_call_tail", "one_tool_tail"], + "properties": { + "first_publication_30_day": {"const": 5000}, + "production_all_time": {"const": 120000}, + "no_change": {"const": 100}, + "one_call_tail": {"const": 500}, + "one_tool_tail": {"const": 500} + } + }, + "package_ceilings_bytes": { + "type": "object", + "additionalProperties": false, + "required": ["sdist", "wheel"], + "properties": { + "sdist": {"const": 2000000}, + "wheel": {"const": 1000000} + } + }, + "maximum_new_end_to_end_runs": {"const": 1}, + "run_status": {"const": "unspent_unavailable"}, + "constraints": { + "const": [ + "generic_digest_drift_forbidden", + "any_different_preparation_digest_fails_closed", + "selected_successor_is_permitted_not_accepted", + "candidate_witness_is_retained_uncommitted_read_only", + "worker_must_revalidate_on_exact_merged_main_before_any_end_to_end_run", + "no_new_worker_or_downstream_ready_task_from_this_authority" + ] + } + } +} diff --git a/docs/roadmap/REMAINING_EXECUTION_PLAN.md b/docs/roadmap/REMAINING_EXECUTION_PLAN.md index e438a3c7..1feecd87 100644 --- a/docs/roadmap/REMAINING_EXECUTION_PLAN.md +++ b/docs/roadmap/REMAINING_EXECUTION_PLAN.md @@ -24,17 +24,22 @@ page-executor C/B/B violations, so QG1A must correct them without changing R2 behavior or the frozen maintainability baseline. CK-07R1A is accepted, merged, and exact-main verified at `4d8074952f679877f2b4fbb3e89c51015e96a197`; CK-07R1A0 is accepted at the -current exact main `519b503aa3b23019033b6481687c08b23fc6c31e`. PR #394 is a -stale failed witness: head `98a9b5b82951d136644a5fe5f8a70d320131ba08` failed -the hosted Python 3.14 `ordinary.2000_call_tail` gate and is superseded -read-only. It must not be updated, rerun, or merged. The planner-valid -lifecycle receipt is an acceptance output of the fresh CK-07R1 successor, not -a pre-dispatch dependency; the first sample, all five budgets, and every -fail-closed rule remain binding. CK-07R1 is Conditional Ready only after this -authority is accepted, merged, and exact-main verified. This current authority -supersedes earlier CK-07R1 wording that says to resume, refresh, or rerun PR -#394; those retained references are historical provenance and do not authorize -action. +current exact main `519b503aa3b23019033b6481687c08b23fc6c31e`; its linked +source-digest correction is frozen from exact main `d911b1f` and is not a +worker implementation. PR #394 is a stale failed witness: head +`98a9b5b82951d136644a5fe5f8a70d320131ba08` failed the hosted Python 3.14 +`ordinary.2000_call_tail` gate and is superseded read-only. It must not be +updated, rerun, or merged. The planner-valid lifecycle receipt is an +acceptance output of the existing CK-07R1 worker only after it revalidates the +retained candidate on this authority's exact merged main; it is not a +pre-dispatch dependency. The first sample, all five budgets, one-run ceiling, +and every fail-closed rule remain binding. CK-07R1 is Conditional Ready only +after the source-digest authority is accepted, merged, and exact-main +verified. Earlier wording that says to resume, refresh, or rerun PR #394 is +historical provenance and does not authorize action. This source-digest +authority supersedes earlier CK-07R1 wording that says to resume, refresh, or +rerun PR #394; those retained references are historical provenance and do not +authorize action. ## Delegation law @@ -110,7 +115,7 @@ conditions in the table and child files; they are not unconditional DAG edges. "condition": "CK-QG1A0 merged and exact-main verified", "tasks": ["CK-QG1A"] }, { - "condition": "CK-07R1 transition authority accepted, merged, and exact-main verified", + "condition": "CK-07R1/CK-07R1A0 source-digest authority accepted, merged, and exact-main verified; worker pre-run gates remain required", "tasks": ["CK-07R1"] }], "tasks": [ diff --git a/docs/roadmap/TASK_PACKETS.md b/docs/roadmap/TASK_PACKETS.md index b98c94eb..b99ec160 100644 --- a/docs/roadmap/TASK_PACKETS.md +++ b/docs/roadmap/TASK_PACKETS.md @@ -61,8 +61,8 @@ other corrective locks are unchanged. - [ ] **CK-08R3A — Implement bounded EvidenceService physical queries** · Conditional Ready after corrective authority exact-main verification; CK-08R0 remains accepted · [packet](tasks/ck-08r3a-implement-evidence-physical-query.md) - [ ] **CK-08R3 — Qualify evidence service scale** · Blocked on CK-08R3A accepted merge and exact-main verification · [packet](tasks/ck-08r3-qualify-evidence-scale.md) - [x] **CK-07R1A — Correct hosted lifecycle tail** · Accepted/merged at `4d807495`; exact-main verified · [packet](tasks/ck-07r1a-correct-hosted-lifecycle-tail.md) -- [x] **CK-07R1A0 — Freeze lifecycle planner/recovery path authority** · Completed on merge; exact-main verified at `519b503a` · [packet](tasks/ck-07r1a0-freeze-lifecycle-path-authority.md) -- [ ] **CK-07R1 — Correct lifecycle preparation scale** · Conditional Ready after this authority merge/exact-main; the planner-valid receipt is a successor acceptance output and PR #394 is stale read-only · [packet](tasks/ck-07r1-correct-lifecycle-preparation-scale.md) +- [x] **CK-07R1A0 — Freeze lifecycle planner/recovery path authority** · Completed on merge; exact-main verified at `519b503a`; linked source-digest correction pending its own merge/exact-main verification · [packet](tasks/ck-07r1a0-freeze-lifecycle-path-authority.md) +- [ ] **CK-07R1 — Correct lifecycle preparation scale** · Conditional Ready only after the source-digest authority merge/exact-main; revalidate the retained candidate on exact merged main; planner-valid receipt is a successor acceptance output and PR #394 is stale read-only · [packet](tasks/ck-07r1-correct-lifecycle-preparation-scale.md) - [ ] **CK-QG1A — Correct page-executor complexity** · Conditional Ready after CK-QG1A0 exact-main · [packet](tasks/ck-qg1a-correct-page-executor-complexity.md) - [ ] **CK-QG1 — Enforce replacement-kernel maintainability** · Blocked on CK-QG1A and refresh of existing PR #392 on corrected main · [packet](tasks/ck-qg1-enforce-agent-kernel-maintainability.md) - [ ] **CK-08R4 — Reclassify physical named plans** · Blocked on CK-08R1/R2/R3 and CK-07R1 · [packet](tasks/ck-08r4-reclassify-physical-plans.md) diff --git a/docs/roadmap/tasks/ck-07r1-correct-lifecycle-preparation-scale.md b/docs/roadmap/tasks/ck-07r1-correct-lifecycle-preparation-scale.md index 7c412c4b..b687c97f 100644 --- a/docs/roadmap/tasks/ck-07r1-correct-lifecycle-preparation-scale.md +++ b/docs/roadmap/tasks/ck-07r1-correct-lifecycle-preparation-scale.md @@ -1,6 +1,6 @@ # CK-07R1 — Correct lifecycle preparation scale -**Status:** Conditional Ready after this authority merges and exact-main verifies +**Status:** Conditional Ready after the source-digest authority merges and exact-main verifies; worker pre-run gates remain required **Parent:** Corrective prerequisite for CK-09 @@ -22,9 +22,11 @@ production-shaped preparation attempt exceeded 15 minutes. contracts. **Dependencies:** CK-07R1A accepted, merged, and exact-main verified at -`4d8074952f679877f2b4fbb3e89c51015e96a197`; CK-07R1A0 accepted at exact main -`519b503aa3b23019033b6481687c08b23fc6c31e`; and this transition authority -accepted, merged, and exact-main verified. PR #394 head +`4d8074952f679877f2b4fbb3e89c51015e96a197`; CK-07R1A0 path authority accepted +at exact main `519b503aa3b23019033b6481687c08b23fc6c31e`; and the linked +source-digest authority accepted, merged, and exact-main verified. The worker +must then start from that exact merged main and reapply the retained candidate, +revalidating predecessor and successor digests before any end-to-end run. PR #394 head `98a9b5b82951d136644a5fe5f8a70d320131ba08` is a stale failed read-only witness and is not refreshed, rerun, or merged. @@ -38,11 +40,13 @@ database postconditions. **Consumer seam:** Preparation to `PublicationWriter` to read-only publication. -**Parallelism:** Create exactly one fresh CK-07R1 successor only after this -authority merges and exact-main verifies, starting from that exact main. The -planner-valid receipt is produced by that successor and is required for its -acceptance, not for its creation or dispatch; other corrective locks stay -disjoint and no downstream packet becomes Ready here. +**Parallelism:** Resume only the existing CK-07R1 worker after this authority +merges and exact-main verifies, using an exact-main START, a fresh worktree, +and deliberate reapplication of the retained candidate. Never rebase, stash, +reset, clean, delete, overwrite, or mutate the witness; do not create a +replacement worker task. The planner-valid receipt is produced by that worker +and is required for acceptance, not for authority completion; other corrective +locks stay disjoint and no downstream packet becomes Ready here. **Non-goals:** Writer/pointer/schema redesign, facts, projections, or budget waivers. @@ -56,10 +60,11 @@ standard/production fixtures, five unprofiled samples, 30-day/all-time gates, **Acceptance:** Work is linear in observations plus prior transitions and all publication-valid scale gates pass through the CK-07R1A0 reachable path. The -successor must produce the planner-valid receipt, bind every frozen path and -prior identity, and consume at most one new end-to-end run. Receipt absence -before dispatch is not a blocker; receipt absence or invalidity at successor -acceptance remains fail-closed. +existing worker must revalidate the exact predecessor-to-successor digest +transition, bind every frozen path and prior identity, produce the +planner-valid receipt, and consume at most one new end-to-end run. Receipt +absence before dispatch is not a blocker; receipt absence or invalidity at +successor acceptance remains fail-closed. **Failure/rollback:** Retain the profile and create one narrow follow-up for a new dominant blocker; never weaken the gate. diff --git a/docs/roadmap/tasks/ck-07r1a0-freeze-lifecycle-path-authority.md b/docs/roadmap/tasks/ck-07r1a0-freeze-lifecycle-path-authority.md index 5f73e615..6d7181f3 100644 --- a/docs/roadmap/tasks/ck-07r1a0-freeze-lifecycle-path-authority.md +++ b/docs/roadmap/tasks/ck-07r1a0-freeze-lifecycle-path-authority.md @@ -1,6 +1,6 @@ # CK-07R1A0 — Freeze lifecycle planner/recovery path authority -**Status:** Completed on merge; exact-main verified at `519b503aa3b23019033b6481687c08b23fc6c31e`; CK-07R1 is Conditional Ready after this transition authority exact-main +**Status:** Completed on merge; exact-main verified at `519b503aa3b23019033b6481687c08b23fc6c31e`; linked source-digest correction is pending merge and exact-main verification, so the existing CK-07R1 worker remains held **Release-candidate package ceilings:** sdist remains at most 2,000,000 bytes and wheel remains at most 1,000,000 bytes. The historical 828000/383000 @@ -32,12 +32,14 @@ remains accepted. **Owned files/interfaces:** Authority/docs/tests only. The strict Authority v2 contract is [lifecycle-path-authority.json](../../decisions/evidence/ck07r1a0/lifecycle-path-authority.json) -with its schema. The retained CK-07R1 implementation/profile/evidence diff is -read-only evidence. +with its schema. The linked [source-digest authority](../../decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.json) +and its schema freeze the exact predecessor/successor transition. The retained +CK-07R1 implementation/profile/evidence diff is read-only evidence. **Produces:** A frozen entry-path contract, APPEND_SAFE_SMALL selection rule, -independent lifecycle oracle/postconditions, one-run authorization condition, -preserved attempt ledger, and exact scope bindings. +independent lifecycle oracle/postconditions, exact source/diff identity, +allowed lifecycle symbol/file scope, one-run authorization condition, +preserved attempt ledger, and exact worker revalidation requirements. **Independent truth source:** `tests/agent_kernel/contracts/reference/lifecycle.py::fold_lifecycle`, @@ -62,8 +64,13 @@ qualification, PR #394 changes, writer/planner/recovery code, budgets, schemas/DDL/query/evidence services, projections, releases, or real/private Codex data. -**Invariants:** CK-07R1A remains accepted at `4d807495…`; CK-07R1 becomes -Conditional Ready only after this authority is accepted, merged, and exact-main +**Invariants:** CK-07R1A remains accepted at `4d807495…`; the exact +predecessor digest is +`408d18e44c87da234d220c29298ebac1780e9426e2dce767b0bfc3ae65e8a872` and the +permitted-not-accepted retained successor digest is +`d192c858b48e44b5aa7a7e39ef524e5ec2f08085655fe485639f5e875a727aa1`; generic +or different digest drift fails closed; CK-07R1 becomes Conditional Ready only +after this source-digest authority is accepted, merged, and exact-main verified; the five budgets remain `5000/120000/100/500/500` ms; every prior attempt and its identity/timestamp/failure remains visible; receipt `935e4427b93e67c5ca649b773b0b3895dafac87f49bc76d7ed8917dff2f0250d` remains @@ -92,12 +99,13 @@ or exact-main mismatch. Do not weaken a budget or infer publication-validity from a manually forced plan. **Handoff:** Coordinator `019fbeb3-00d5-7f22-ba65-ae4672838140` and parent -`019fbea6-66b5-71e0-b85a-b6654fd414c5` receive the merged SHA, Authority v2 -path, exact scope additions, preserved attempts/digests, validation/reviewer/ -CI/exact-main results, and unchanged downstream gates. +`019fbea6-66b5-71e0-b85a-b6654fd414c5` receive the merged SHA, source-digest +authority path, exact candidate source/diff identity, preserved +attempts/digests, validation/reviewer/CI/exact-main results, and unchanged +downstream gates. **Cleanup/docs:** CK-07R1 owns the implementation/requalification successor; the retained CK-07R1 worktree, PR #394, and historical worktrees remain read-only evidence. -**Suggested commit:** `docs: freeze lifecycle path authority` +**Suggested commit:** `docs: freeze lifecycle source digest authority` diff --git a/scripts/check_kernel_scope.py b/scripts/check_kernel_scope.py index b9c99ea0..09d28490 100644 --- a/scripts/check_kernel_scope.py +++ b/scripts/check_kernel_scope.py @@ -748,6 +748,8 @@ { "docs/decisions/evidence/ck07r1a0/lifecycle-path-authority.json", "docs/decisions/evidence/ck07r1a0/lifecycle-path-authority.schema.json", + "docs/decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.json", + "docs/decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.schema.json", } ) diff --git a/tests/kernel/test_documentation_authority.py b/tests/kernel/test_documentation_authority.py index 281789eb..1f932912 100644 --- a/tests/kernel/test_documentation_authority.py +++ b/tests/kernel/test_documentation_authority.py @@ -198,7 +198,10 @@ def test_remaining_execution_plan_is_complete_acyclic_and_fail_closed() -> None: "tasks": ["CK-QG1A"], }, { - "condition": "CK-07R1 transition authority accepted, merged, and exact-main verified", + "condition": ( + "CK-07R1/CK-07R1A0 source-digest authority accepted, merged, and " + "exact-main verified; worker pre-run gates remain required" + ), "tasks": ["CK-07R1"], }, ] @@ -531,7 +534,10 @@ def test_corrective_seam_packet_is_critical_path_authority() -> None: assert "strict Authority v2" in ck07r1a0 assert "supersedes earlier CK-07R1 wording" in central assert "Blocked on CK-QG1A" in ckqg1 - assert "Conditional Ready after this authority merges and exact-main verifies" in ck07r1 + assert ( + "Conditional Ready after the source-digest authority merges and exact-main verifies" + in ck07r1 + ) def test_ck07r1a0_authority_is_strict_and_preserves_attempt_identity() -> None: @@ -681,6 +687,74 @@ def test_ck07r1a0_authority_is_strict_and_preserves_attempt_identity() -> None: assert list(validator.iter_errors(changed)) +def test_ck07r1a0_source_digest_authority_is_exact_and_fail_closed() -> None: + authority_path = "docs/decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.json" + schema = _json( + "docs/decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.schema.json" + ) + authority = _json(authority_path) + Draft202012Validator.check_schema(schema) + validator = Draft202012Validator(schema) + validator.validate(authority) + + assert authority["predecessor"]["sha256"] == ( + "408d18e44c87da234d220c29298ebac1780e9426e2dce767b0bfc3ae65e8a872" + ) + assert authority["selected_successor"]["sha256"] == ( + "d192c858b48e44b5aa7a7e39ef524e5ec2f08085655fe485639f5e875a727aa1" + ) + assert authority["selected_successor"]["status"] == "permitted_not_accepted" + assert authority["allowed_scope"]["lifecycle_symbols"] == [ + "codex_usage_tracker.agent_kernel.publication.preparation._WriteSetPreparer._build_lifecycle" + ] + assert authority["reachable_consumer_path"]["mismatch_result"].startswith( + "fail_closed" + ) + assert authority["independent_truth"]["reference_symbol"] == "fold_lifecycle" + assert authority["worker_revalidation"]["required"] is True + assert authority["worker_revalidation"]["different_digest"] == "fail_closed" + assert authority["maximum_new_end_to_end_runs"] == 1 + assert authority["run_status"] == "unspent_unavailable" + assert authority["preserved_authority"]["writer_only_receipt_digest"] == ( + "935e4427b93e67c5ca649b773b0b3895dafac87f49bc76d7ed8917dff2f0250d" + ) + assert authority["runtime_budgets_ms"] == { + "first_publication_30_day": 5000, + "production_all_time": 120000, + "no_change": 100, + "one_call_tail": 500, + "one_tool_tail": 500, + } + assert authority["package_ceilings_bytes"] == {"sdist": 2_000_000, "wheel": 1_000_000} + + source = _REPO_ROOT / authority["source_path"] + assert hashlib.sha256(source.read_bytes()).hexdigest() == authority["predecessor"]["sha256"] + preserved = _REPO_ROOT / authority["preserved_authority"]["path"] + assert hashlib.sha256(preserved.read_bytes()).hexdigest() == authority["preserved_authority"]["sha256"] + + for section, field, value in ( + ("predecessor", "sha256", "0" * 64), + ("selected_successor", "sha256", "0" * 64), + ("selected_successor", "status", "accepted"), + ("selected_successor", "base_sha", "0" * 40), + ("worker_revalidation", "different_digest", "allow"), + ("preserved_authority", "writer_only_receipt_digest", "0" * 64), + ("run_status", None, "authorized"), + ): + changed = json.loads(json.dumps(authority)) + if field is None: + changed[section] = value + else: + changed[section][field] = value + assert list(validator.iter_errors(changed)) + + changed = json.loads(json.dumps(authority)) + changed["allowed_scope"]["files"].append( + "src/codex_usage_tracker/agent_kernel/publication/writer.py" + ) + assert list(validator.iter_errors(changed)) + + def test_question_catalog_and_diagram_inventory_are_complete() -> None: catalog = _read("docs/product/SUPPORTED_QUESTION_CONTRACTS.md") question_ids = re.findall(r"^#### (Q-[A-Z]+-\d{2}):", catalog, re.MULTILINE) diff --git a/tests/kernel/test_kernel_scope.py b/tests/kernel/test_kernel_scope.py index 3322f87a..76d9bc55 100644 --- a/tests/kernel/test_kernel_scope.py +++ b/tests/kernel/test_kernel_scope.py @@ -690,6 +690,8 @@ def test_ck07r1a0_authority_and_lifecycle_scope_additions_are_explicit() -> None assert { "docs/decisions/evidence/ck07r1a0/lifecycle-path-authority.json", "docs/decisions/evidence/ck07r1a0/lifecycle-path-authority.schema.json", + "docs/decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.json", + "docs/decisions/evidence/ck07r1a0/lifecycle-source-digest-authority.schema.json", } == CK07R1A0_AUTHORITY_ADDITIONS assert { "scripts/benchmark_ck07r1_lifecycle_scale.py",