[K2B] Journal external operations and durable artifacts #17
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!17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/13-operation-journal"
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?
Refs #13.
Implemented K2B local-only journal/outbox, versioned Operation requests and distinct dedupe identities; atomic K1 admission and pending intent; durable fenced attempts, transport/domain observations and reconciliation; content-addressed artifacts with verified backup/restore and v1->v2 migration. Synthetic B/D/E regressions cover crash/receipt boundaries. No live provider/network, K3/K4, or automatic merge.
Reviewed feature HEAD
a7035f31c36c9a19d7c3a24c96abbced6ac80116:make check(152 passed),make package-check,make audit(no known vulnerabilities), andgit diff --checkpassed;make checkandmake package-checkreran after review. Forgejo PR CI #1944 succeeded.Fresh independent full review #600 covers all issue criteria and concludes APPROVE, no blocking findings, at the reviewed commit. Forgejo recorded it as
COMMENT, not platform approval, because the bot account authored the PR. The owner merged this PR intodevelopas059482d045bd8e772005c9fbc1a9b89ce64ce26f; issue #13 is closed. Delivery ledger records integration and remediation0/10. This is not promotion tomain.PR Review: [K2B] Journal external operations and durable artifacts (#17)
Repository: Creatidy/creatidy-kernel
Branch:
feat/13-operation-journal->developFrozen head:
a7035f31c36c9a19d7c3a24c96abbced6ac80116(base2fa51e9)Linked issue: #13
Reviewer: fresh read-only session
ses_f258ca123ffeg2RLzMN8vVC9B4, distinct from the implementation session; running modelzai-coding-plan/GLM-5.3(max) matches the routed selectionzai/glm-5.3/max. Local HEAD verified identical to the frozen head; no branch edits, pushes, or merges performed.Summary
Adds the K2B external-operation journal to the SQLite adapter: versioned/canonical Operation requests with distinct operation/effect identities, atomic K1 admission + INTENT/outbox (
admit_with_intent) plus a standaloneintent(), fenced and leased delivery attempts with transport/observation/reconciliation facts in append-only tables, retry gated on authoritative absence or proven idempotency, and content-addressed artifacts flushed to disk before an immutable DB reference. Schema v1->v2 migration, artifact-aware backup manifests, and verified restore. 10 new synthetic tests; no live provider, network, K3/K4, or merge automation.Intent / Acceptance Evidence
operations.operation_idPK +effect_keyUNIQUE;{"version":1,"request":...}canonical JSON + sha256 digest; K2Acommand_admissionsvs_insert_intenteffect binding (tests B,test_command_and_effect_outbox_are_one_transaction) vsobservation_idPK with identity-bound evidence (test E)claim()commits attempt/lease/fence beforedeliver_fakeinvokes the callable; test D assertsin_transaction is Falseinside the fake;test_outbox_failure_rolls_back_command_admissionproves atomic rollbackdelivery_attempts,operation_transports,operation_observations,operation_reconciliations) with no-update/no-delete triggers; observation replay idempotent, rebinding conflicts (test E)claim()lease + retry-proof gates;observe()/record_transport()require the current fence and reject reconciled/late publication (tests D, E)dispatched; retry requiresretry_proofin {absent, idempotent};_validate_operation_recordsre-derives acceptance from durable receipts and rejects forgery (tests E,test_restart_rejects_forged_acceptance_and_missing_outbox)finalize_artifact: fsynced temp + atomic rename before DB insert; immutability conflict on divergence; startup/backup/restore re-hash blobs; tamper raisesCorruptHistory(test 5)test_b_intent_is_not_dispatch_or_review_acceptance(no accepted-review wait, Program stays DRAFT, waiting-without-acceptance rejected),test_d_transport_success_is_not_domain_acceptance(transport success persisted as rejection),test_e_missing_rejected_accepted_and_uncertain_receipts(distinct receipts, durable acceptance reference, reconcile-and-redispatch same operation)Architecture / Information Flow
Dependency direction preserved: changes confined to
adapters/sqlite_store.pyplus tests; stdlib-only additions (shutil,Callable). The K2B surface lives at adapter level, consistent with ADR 0003 (durability in the store) and with the K2A precedent where theProgramStoreprotocol covers onlycreate/load/admit; consumers arrive with K3 (#6). Implementation tracks ADR 0003 point-for-point: intent+outbox before dispatch, fence/lease before I/O, uncertainty retention, found-effect reconciliation, authoritative-absence-only retry, lease expiry as lost coordination rather than remote failure, artifacts flushed and atomically finalized before reference. Fail-closed posture throughout (OperationConflict,CorruptHistory).Blocking Issues
None found.
Non-blocking Suggestions
_verify_backup_manifestvalidates artifact digests by length only. A non-hex or path-traversing name is currently neutralized structurally (a digest string containing/can never equal asha256hexdigest), but an explicit hex-charset check would encode that invariant instead of relying on it.__init__detects a backup bundle (kernel.sqlite3+manifest.json), verifies it, then opens the bundle database in place for read/write; later writes silently diverge from the verified manifest digest. Consider refusing in-place writes or documenting the guard as open-time integrity verification._validate_operation_recordsre-hashes every artifact blob on each open (O(total artifact bytes)). Correctness-first is appropriate now; worth remembering when artifact volumes grow.artifact()verifies the blob, then reopens it to read (small TOCTOU window); negligible under the single-controller model.Questions for the Author
None blocking.
Security / Privacy Notes
No secrets, no network, no provider integrations. Authority and corruption boundaries fail closed: forged acceptance rejected at startup, bundle tampering detected on open and restore, stale fences and late callbacks rejected without history rewrites.
Test / Documentation Gaps
test_restart_rejects_forged_acceptance_and_missing_outboxexercises the forged-acceptance branch; the missing-outbox branch of_validate_operation_recordshas no direct regression.Follow-Up Candidates
None new; K3 consumption of this surface is already issue #6. Record suggestions 1-3 for owner triage if desired.
Overall Recommendation
APPROVE (recorded here as review text; see review-state note above)
Validation cross-checked: CI #1944 (pull_request,
a7035f3) success on the exact frozen head; PR-reportedmake check(ruff format/check, basedpyright),make package-check, andmake auditoutcomes are consistent with the inspected code; this reviewer did not execute branch code. Issue #13 acceptance criteria are met at this head; the issue stays open and merge decisions remain with the owner.