[K7] Add CLI reference slice and restart/recovery proof #27
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Creatidy/creatidy-kernel!27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-10-cli-recovery"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Selected Issue
Implements #10. Leave issue open until owner integration into
develop; no automatic merge or deployment.Change
Thin reference/export CLI over a shared bounded application step; owner-approved two-node Program, FixedAllocator, durable SQLite/artifacts, explicit accepted predecessor input, independent deterministic verification, exact-head Forgejo PR delivery, opt-in finite-budget Codex composition, restart recovery and installed-wheel proof.
Recovery Remediation
Owner findings O1/O2 are addressed in
a895a33d47e37b661cf02a4c33a28798c77a124eand independently verified by the fresh whole-PR review:identity_unavailableand cannot accept. Legacy acceptance missing required identity cannot publish/export success.Regression tests cover native-shaped receipt/identity crash boundaries, original durable resolution recovery, absent identity, cancellation lost replies and pre/post-send interruptions across repeated restarts and expiry.
Validation At Current HEAD
make check: passed, 553 tests and all static/import/secret/diff gates.make package-check: passed, wheel/sdist build and installed CLI run/replay/export.make audit: passed, no known vulnerabilities.a895a33d47e37b661cf02a4c33a28798c77a124e.Current Delivery Status
READY_FOR_OWNER_MERGE for
a895a33d47e37b661cf02a4c33a28798c77a124e. Final ledger; delivery remediation budget used 1/10.Fresh verified routed whole-PR review 648 returned substantive APPROVE, zero blocking findings, explicitly verifying O1/O2. Forgejo persisted COMMENT because the configured reviewer is the author and formal self-approval was rejected; no platform APPROVED state is claimed. Historical review 647 remains inapplicable to this HEAD. Readiness does not authorize automatic merge.
Boundaries
Default CLI execution is synthetic/offline, not a live Forgejo PR or model call. Independent verification is deterministic and outside worker authority, not model review. The reference has zero autonomous remediation budget and pauses failed verification. No live execution is claimed. Opt-in live use requires an owner-seeded disposable remote base, controller-owned bare object source, pinned finite-timeout Codex connection and scoped Forge adapter. Trusted-development mode is not hostile-worker isolation; local limits are not provider-side hard cost caps. No K8/Scarcity Router product integration is included.
Owner merge authority remains separate; issue open, PR unmerged. Branch-protection rules are inaccessible to this account and are not inferred or bypassed.
Delivery Ledger: Initial Entry
issue-10-cli-recovery->develop.c5448d9c3f798f100dca8b05abec09fdf8d848ab.8ffa99deaa8dab96167c7c0f8e55b7204a40b74f.max_remediation_cycles = 10;remediation_used = 0; valid completed full reviews = 0.make checkpassed (538 tests and all static/import/secret/diff gates);make package-checkpassed including installed CLI replay/export;make auditpassed (no known vulnerabilities).repository_reviewtightening: L4; reasoning/coding/tool_use minima 5/5/5; tool use and reasoning mode required. Author capability floor unknown; no capability inferred from model identity.checkremains required. No merge or issue closure authorized here.Delivery Ledger: Review 1 Dispatch
Frozen HEAD
c5448d9c3f798f100dca8b05abec09fdf8d848ab, base8ffa99deaa8dab96167c7c0f8e55b7204a40b74f; unchanged since initial ledger. No prior completed review or remediation.repository_review; monotone floortask_level=L4,capability_minima={reasoning:5,coding:5,tool_use:5},hard_constraints={requires_tool_use:true,requires_reasoning_mode:true}.zai/glm-5.3/max; dispatched:zai-coding-plan/glm-5.3/maxusing the documented provider-ID adapter; no fallback.degraded=false.am-1790532801112-z89o6r; reviewer sessionses_f1bedad32ffe7GN4GjOyQix1xU.REQUESTEDandDISPATCH_VERIFIED. Independent resolution returnedGLM-5.3 (zai-coding-plan) · max, matching the Router-eligible identity and current Agent Manager catalog.remediation_used=0/10.Invalid diagnostic only: the first router call used unsupported shorthand (
minimaand top-level hard constraints) and returnedinvalid_request. The published machine-interface/TaskRequirement contract was inspected, then one corrected call withcapability_minimaand nestedhard_constraintsproduced the sole valid selection for this boundary. This consumed no valid review or remediation cycle.Exact-HEAD CI Evidence
Forgejo workflow run
2028/ displayed run 58 completedsuccessfor full HEADc5448d9c3f798f100dca8b05abec09fdf8d848ab, pull_request event, 2026-09-27 18:10:36–18:11:11 UTC. This repository'sciworkflow contains the singlecheckjob runningmake check,make package-check, andmake audit. Exact SHA and success confirmed by workflow-run metadata. The newer jobs endpoint returned 404; no job-log detail is claimed.Independent review remains pending. Working tree clean; budget unchanged at
0/10.PR Review: [K7] Add CLI reference slice and restart/recovery proof (#27)
Repository: Creatidy/creatidy-kernel
Branch:
issue-10-cli-recovery->developFrozen head:
c5448d9c3f798f100dca8b05abec09fdf8d848ab(frozen base8ffa99deaa8dab96167c7c0f8e55b7204a40b74f)Linked issue: #10 ([K7] CLI reference slice and restart/recovery proof)
Identity limitation (recorded): the configured Forgejo MCP account is
kilo, the PR author. A formalAPPROVEDreview was attempted first and was rejected by Forgejo withapprove your own pull is not allowed. This storedCOMMENTtherefore preserves the substantive independent-review verdict below; it is not a formal Forgejo approval.Summary
Adds a thin
creatidy-kernel reference/exportCLI over a new shared application step (ports/application.py::advance_work_unit), a deterministic durable runtime and offline forge fixture with restart/recovery faults (adapters/reference.py,reference_forge.py), an opt-in finite-budget live composition (reference_live.py), aSQLiteProgramStore.operations()listing with theOperationRecordcontract moved toports/program_store.py(ApplicationStore), console-script packaging, and installed-wheel CLI proof intools/check_package.py. 15 files changed; the offline suite and all gates stay live-service free.Intent / Acceptance Evidence
tests/test_reference.py::test_two_nodes_reconstruct_and_export(2 accepted,attempts == 1); my local run of the 4 new suites: 29/29 passed; CI run #2028successon the frozen headDurableReferenceRuntime.startenforcesartifact:sha256predecessor binding; restart-boundary tests assert single attempt; stale-receipt and forge duplicate/stale tests; storeclaimrefuses uncertain retrytest_restart_boundaries,test_lost_context_does_not_advance_or_retry, CLI fault/resume tests; export pinsautomatic_merge/automatic_deployfalse; CLI fails closed on unknown commands (test_cli.py)deliver_reference_prexact-head AGit with durable synthetic transport;reference_exportverified by manual CLI run (completed, 2 accepted, PRforgejo:synthetic/reference#1, stable across rerun/export, resourcesvalue: nullhonestly reported)advance_work_unitis the single step used by both offline and live compositions;ports/application.pyimports onlycore+ports; grep confirms noports/adaptersimports incore; all new tests ran offline locallyTrustMode.TRUSTED_DEVELOPMENT, exportisolation: "none; deterministic synthetic worker"/"not attested", no credential loading anywhere in the diff, README limitations sectionArchitecture / Information Flow
Dependency direction is preserved:
adapters -> ports -> corethroughout;corehas zeroports/adaptersimports. MovingOperationRecordfromadapters/sqlite_store.pytoports/program_store.pyand adding theApplicationStoreprotocol is the correct shape for a ports-level application step. Authority stays with code:advance_work_unitroutes every transition through durableadmit/admit_with_intentcommands, andverify_candidate/admit_accepted(core) re-validate attempt status, policy pinning, and worker-cannot-satisfy beforeSatisfyWorkUnit. Uncertain effects stay unknown:claimblocks retry without anabsent/idempotentproof, and the lost-PR-reply path keeps statusunknownwith no replacement PR (verified intest_lost_pr_reply_never_repeats_creation). The live composition is a library function requiring caller-supplied pinned/scoped adapters, outside the CLI default, matching the issue's opt-in constraint.Blocking Issues
None (B0). No correctness, authority, boundary, or validation defect found at the frozen head.
Non-blocking Suggestions
SQLiteProgramStore.operations()selects all operation ids then re-reads each viaself.operation()(N+1). Bounded for the reference app; filter by prefix in SQL and/or fetch in one statement if this becomes a shared path.pr-commit/pr-send/pr-receiptare covered at the delivery layer (tests/test_reference_forge.py) but not end-to-end throughmain().run_live_referencereports intermediate conditions (e.g. a lease-heldwaiting) asbudget_exhaustedin the returned condition; durable per-operation status remains inspectable via export, but the collapsed condition is coarser than the store state.Questions for the Author
None blocking. For the record: recovery of a
pr-sendinterruption intentionally remains permanentlyunknownwithout a retained reference (no topic-based rediscovery); confirm that is the intended steady-state semantics and not a future reconciliation hook.Security / Privacy Notes
reference_gitruns a resolved Git executable with controller-built argument lists, no shell,GIT_CONFIG_NOSYSTEM/devnull global config, fixed identity/dates, and a 10s timeout — hardened for a trusted-development reference.prepare_reference_directoryrefuses to commandeer an existing checkout or symlinked repository. The live collector rejects symlinked/oversized (> 4096byte)result.txt. No secrets, tokens, or credential loaders appear in the diff; live authorization is an explicit caller-suppliedauthorizepredicate plus deadline.object_sourcemust be a controller-owned bare repository outside the worker workspace, and the runner never initializes or updates the remote base.Test / Documentation Gaps
Minor:
pr-*interruption markers are returned in the receipt but not recorded as durableinterruption:*operations, so they do not appear in a laterexport(runtime andlive-budgetinterruptions do). The dedicated attemptidentityartifact is only finalized on fresh dispatch, so asend-fault-recovered attempt exportsidentity: null(identity remains available in observation artifacts). README additions were verified against a manual CLI run and match observed behavior;docs/architecture/successor.mdalready defines K7 and needed no change.Follow-Up Candidates
None meet the durable/distinct/actionable bar; S1-S3 are ordinary engineering notes for the author or a future slice.
Overall Recommendation
APPROVE for frozen head
c5448d9c3f798f100dca8b05abec09fdf8d848ab— blocking findings: none. This is the independent reviewer's substantive verdict; due to the shared-author identity limitation recorded above, the persisted Forgejo state isCOMMENT, not a formalAPPROVEDreview, and no formal approval is claimed.Delivery Ledger: Completed Review Cycle 1
issue-10-cli-recovery->develop.c5448d9c3f798f100dca8b05abec09fdf8d848ab; frozen/current base:8ffa99deaa8dab96167c7c0f8e55b7204a40b74f. Re-fetched PR metadata confirms unchanged subjects; working tree clean.repository_review; monotone floor L4, reasoning/coding/tool_use 5/5/5, requires_tool_use=true, requires_reasoning_mode=true. Author capability floor unknown, not inferred.router_selected=zai/glm-5.3/max;dispatched=zai-coding-plan/glm-5.3/max; documented provider adapter, no harness fallback.ses_f1bedad32ffe7GN4GjOyQix1xU; requestam-1790532801112-z89o6r;dispatch_verification=DISPATCH_VERIFIEDfrom Agent Manager's explicitGLM-5.3 (zai-coding-plan) · maxresolution.substantive_verdict=APPROVEfrom### Overall Recommendation;forgejo_review_state=COMMENT;platform_approval_recorded=false.platform_identity_limitation: PR author and configured MCP identity independently confirmed askilo(id 8). Reviewer supplied the actual failed APPROVED call result:MCP error -32603: create pull review err: approve your own pull is not allowed. The subsequent COMMENT preserves the substantive approval; no formal platform approval is claimed.none; resulting HEAD unchanged;remediation_used=0/10; valid completed full reviews=1. No budget reset or code changes after review.Final Evidence And Terminal Condition
make check: passed, 538 tests and repository-owned static/import/secret/diff gates.make package-check: passed, wheel/sdist rebuild and installed CLI run/replay/export.make audit: passed, no known vulnerabilities.success, exact full HEAD confirmed. The solecheckjob invokes all three repository gates.READY_FOR_OWNER_MERGE for
c5448d9c3f798f100dca8b05abec09fdf8d848ab. Leave issue #10 open and PR #27 unmerged;mainuntouched.Delivery Ledger: Owner Review Reopens Remediation
Owner-side independent review of exact HEAD
c5448d9c3f798f100dca8b05abec09fdf8d848abidentified two blocking K7 recovery defects on 2026-09-27. The prior READY_FOR_OWNER_MERGE determination is superseded; do not merge.Both are valid in-scope recovery findings. Remediation is pending on this same branch and PR, followed by
make check,make package-check,make auditand a freshly routed full independent review of the new exact HEAD. Historical review 647 and its prior ledger remain unchanged. Current budget0/10; this combined owner-requested remediation will consume one cycle when code changes are committed/pushed. No K8/Scarcity Router product work, merge, or issue closure is included.Delivery Ledger: Remediation 1 Pushed
Owner review blockers O1/O2 from remediation entry were fixed together on the same branch/PR.
c5448d9c3f798f100dca8b05abec09fdf8d848ab.a895a33d47e37b661cf02a4c33a28798c77a124e(fix: preserve identity and cancellation across restart).identity_unavailablebefore candidate acceptance. Legacy accepted records missing identity cannot export success or create a PR. Tests cover the real receipt/identity gap with native-shaped Codex responses, persisted-resolution recovery, offline reconstruction and legacy refusal.target_terminal. Tests cover normal/lost replies and interruption before/after send across repeated/expired restarts, with at most one cancel call.make check: passed, 553 tests, all formatting/lint/type/import/secret/diff checks passed.make package-check: passed, built wheel/sdist and installed CLI run/replay/export.make audit: passed, no known vulnerabilities.remediation_status=done;remediation_used=1/10. One combined owner-requested change, no budget reset. Historical completed full reviews=1; old review 647 is not approval for this new HEAD.Fresh exact-HEAD whole-PR independent review and CI verification are pending. PR remains unmerged, issue #10 open. No K8/product routing work added.
Delivery Ledger: Review 2 Dispatch
Re-fetched PR metadata confirms frozen HEAD
a895a33d47e37b661cf02a4c33a28798c77a124e, base8ffa99deaa8dab96167c7c0f8e55b7204a40b74f, same branch and PR. Ledger reconciles prior review 647 at old HEAD and combined owner-directed remediation 1; budget remains 1/10.repository_review, L4, reasoning/coding/tool_use minima 5/5/5, tool use and reasoning mode required. Known author floor unavailable, not guessed.router_selected=zai/glm-5.3/max;dispatched=zai-coding-plan/glm-5.3/max; documented provider adapter; no fallback.am-1790537324387-9lsf06; fresh reviewer sessionses_f1ba8a83cffei1tk4WFohByTqY.REQUESTED, thenDISPATCH_VERIFIED: explicit resolutionGLM-5.3 (zai-coding-plan) · maxmatches the selected eligible identity and current harness catalog.Local gates on the frozen new HEAD:
make checkpassed (553 tests),make package-checkpassed,make auditpassed. Required CI verification pending.PR Review: [K7] Add CLI reference slice and restart/recovery proof (#27)
Repository: Creatidy/creatidy-kernel
Branch:
issue-10-cli-recovery->developFrozen head:
a895a33d47e37b661cf02a4c33a28798c77a124e(frozen base8ffa99deaa8dab96167c7c0f8e55b7204a40b74f)Linked issue: #10 ([K7] CLI reference slice and restart/recovery proof)
Identity limitation (recorded): the configured Forgejo MCP account is
kilo(id 8), the PR author. A formalAPPROVEDreview was submitted first and rejected by Forgejo withMCP error -32603: create pull review err: approve your own pull is not allowed. This storedCOMMENTtherefore preserves the substantive independent-review verdict below; it is not a formal Forgejo approval.Summary
Whole-PR independent review of the remediated HEAD (owner blockers O1/O2 fixed in
fix: preserve identity and cancellation across restart, delta +330/-16 over 8 files). The PR adds a thincreatidy-kernel reference/exportCLI over the shared application step (ports/application.py::advance_work_unit), a durable deterministic offline runtime and forge fixture, an opt-in finite-budget live composition,OperationRecord/ApplicationStoreat the ports level, and installed-wheel CLI proof.Intent / Acceptance Evidence
tests/test_reference.py::test_two_nodes_reconstruct_and_export; reviewer local run of the 5 suites: 44/44 passed; exact-HEAD CI run #2030successadvance_work_unitbindsartifact:sha256predecessor;test_stale_receipt_cannot_change_accepted_work; storeclaimrefuses uncertain retry withoutabsent/idempotentproof; forge duplicate/stale teststest_restart_boundaries(attempts stay 1),test_lost_context_does_not_advance_or_retry, CLI resume tests; export pinsautomatic_merge/automatic_deployfalse; installed-CLI proof asserts the samedeliver_reference_prexact-head with durable synthetic transport;reference_exportnow also gates identity and exportscancellationswithtarget_terminaladvance_work_unit;ports/application.pyimports onlycore+ports; reviewer grep confirms zeroports/adaptersimports incoreTrustMode.TRUSTED_DEVELOPMENT,isolation: "none; deterministic synthetic worker"/"not attested", no credential loading in the diff, README limitationsOwner Blocker Remediation Verification
O1 (identity across receipt restart) — fixed. Execution requests now carry requested-only identity (
RuntimeIdentity(model_id, None, None, ...)atports/application.py:150,168andreference_live.py:260); pre-dispatch resolution is no longer asserted. Acceptance is gated (ports/application.py:178-206): the observation identity must match the allocation and attempt, then either a currently resolved identity is persisted immediately or strictly re-validated immutable persisted evidence (exact key set and values) must exist, otherwiseidentity_unavailable.CodexRuntimeresolution evidence originates only from the actualthread/startresponse (codex_runtime.py:166-170); a receipt-onlyrestoreyieldsresolved=None, which cannot accept.reference_exportrefuses satisfied units lacking matching durable identity, and bothrun_referenceandrun_live_referenceinvoke it before any PR effect, so legacy accepted records can neither export success nor create a PR. Covered bytests/test_reference_identity.py(4 tests), including the exact owner boundary (crash after the accepted receipt, before identity persistence) assertingidentity_unavailable, no acceptance, one start.O2 (blind cancellation reissue) — fixed. Cancellation is its own durable operation
cancel:{attempt_id}with immutable intent; on first attempt it is claimed and durably observedunknownbeforeruntime.cancel(reference_live.py:264-274). Restarts skip resend via theattempts == 0gate, and the store independently refuses re-claim of an uncertain operation without anabsent/idempotentproof (sqlite_store.py:526-527) — double enforcement. Target settlement is recorded only from a terminal observation of the exact accepted handle on the target operation; cancellation delivery staysunknown; export exposescancellations[].target_terminal. Covered bytest_observation_budget_and_expiry_survive_restart(12 parametrized combinations) assertingcancel_calls == 1andstarts == 1across repeated restarts, deadline expiry, read failures, and export stability.Architecture / Information Flow
Dependency direction preserved:
adapters -> ports -> core;coreremains clean ofports/adaptersimports. MovingOperationRecordintoports/program_store.pywith theApplicationStoreprotocol (including the newfind_artifact, which distinguishes absent from corrupt evidence viaCorruptHistory) is the right shape. Authority stays in code: every transition routes through durableadmit/admit_with_intent/claim/observe/reconcile; uncertain effects are never retried blindly; no merge/deploy path exists.Blocking Issues
None (B0) at
a895a33d47e37b661cf02a4c33a28798c77a124e.Non-blocking Suggestions
SQLiteProgramStore.operations()re-reads each operation individually (N+1); bounded for this application.pr-commit/pr-send/pr-receiptare covered at the delivery layer but not end-to-end throughmain().run_live_referencecollapses intermediate conditions (e.g. lease-heldwaiting) intobudget_exhausted; durable per-operation status remains inspectable via export.KeyboardInterruptraised by a synthetic interrupt fault propagates out ofrun_live_referencebefore theinterruption:live-budgetintent is written; durable cancellation state remains inspectable. Fault-injection path only.advance_work_unitreturnsacceptedearly for already-SATISFIED units without re-checking identity evidence; the export/PR boundary re-validates in both delivery paths, so the effect layer holds.Questions for the Author
None blocking.
Security / Privacy Notes
reference_gitruns a resolved executable with controller-built arguments, no shell, isolated config, fixed identity/dates, 10s timeout;prepare_reference_directoryrefuses symlinked/existing checkouts; the live collector rejects symlinked/oversizedresult.txt;object_sourcemust be a controller-owned bare repository outside the workspace. No secrets, tokens, or credential loaders in the diff; live authorization remains a caller-supplied predicate with a finite deadline.Test / Documentation Gaps
Minor only (S2, S4). README truthfully documents the new identity and cancellation semantics, including that a receipt-only restart reports
identity_unavailableand that exports distinguish uncertain cancellation delivery from an observed terminal target.Follow-Up Candidates
None meet the durable/distinct/actionable bar; S1-S5 are ordinary engineering notes.
Overall Recommendation
APPROVE for frozen head
a895a33d47e37b661cf02a4c33a28798c77a124e— blocking findings: none (B0). Owner blockers O1 and O2 are independently verified fixed with dedicated regression tests, exact-HEAD CI (#2030) and the reviewer's local offline run (44/44) pass. This is the independent reviewer's substantive verdict for exactly this HEAD; the previously stored review 647 forc5448d9cis stale and does not apply. Due to the shared-author identity limitation recorded above, the persisted Forgejo state isCOMMENT, not a formalAPPROVEDreview, and no formal platform approval is claimed.Delivery Ledger: Completed Full Review Cycle 2
issue-10-cli-recovery->developbranch.a895a33d47e37b661cf02a4c33a28798c77a124e; frozen base:8ffa99deaa8dab96167c7c0f8e55b7204a40b74f. PR metadata and clean local branch rechecked after review; unchanged.repository_review; monotone L4 / reasoning=5 / coding=5 / tool_use=5; requires_tool_use=true and requires_reasoning_mode=true. Unknown author capability floor not guessed.zai/glm-5.3/max; dispatchedzai-coding-plan/glm-5.3/maxthrough the documented provider adapter; no fallback.ses_f1ba8a83cffei1tk4WFohByTqY; dispatch requestam-1790537324387-9lsf06;DISPATCH_VERIFIEDfrom explicit Agent Manager resolutionGLM-5.3 (zai-coding-plan) · max.substantive_verdict=APPROVE, read from### Overall Recommendation;forgejo_review_state=COMMENT;platform_approval_recorded=false.platform_identity_limitation: configured reviewerkiloid 8 is the PR author. Formal APPROVED submission returnedMCP error -32603: create pull review err: approve your own pull is not allowed; stored COMMENT preserves the substantive verdict. No formal platform approval is claimed.donefor O1/O2; no changes after full review; resulting HEAD unchanged.remediation_used=1/10, valid completed full reviews=2. Prior review 647 remains historical and does not apply to this HEAD.Final Exact-HEAD Evidence
make check: passed, 553 tests, all formatting/lint/type/import/secret/diff checks.make package-check: passed, wheel/sdist rebuild and isolated installed CLI replay/export.make audit: passed, no known vulnerabilities.READY_FOR_OWNER_MERGE for
a895a33d47e37b661cf02a4c33a28798c77a124e. This is readiness, not owner merge approval. PR #27 remains unmerged, issue #10 open,mainuntouched.