Skip to content

crm-cleanup 0.2.1: execute decided updates through a sealed CRM transport - #411

Open
antheducation wants to merge 18 commits into
runxhq:mainfrom
antheducation:crm-cleanup-executed-writes
Open

crm-cleanup 0.2.1: execute decided updates through a sealed CRM transport#411
antheducation wants to merge 18 commits into
runxhq:mainfrom
antheducation:crm-cleanup-executed-writes

Conversation

@antheducation

Copy link
Copy Markdown

crm-cleanup 0.2.1: the cleanup executes its writes

The 0.1.0 package reconciles a transcript against pasted records and returns a proposal object with write_performed: false; nothing downstream consumes it, so the CRM never changes. This PR evolves the skill so the run itself completes the loop: read the current records from a real source, decide deterministically, and execute the decided updates through a transport that seals before/after evidence bound to the decision digests.

What changed

  • fetch-source reads the source handle's https URL through native web.fetch under a caller-supplied host allowlist; pasted record payloads are no longer accepted as a source.
  • normalize-records validates the fetch (status, truncation, allowlist decision) and seals the working record set with its origin (kind, ref, count).
  • decide enforces the reconciliation draft deterministically: target record must exist in the set that was read, the field must be inside crm_schema.allowed_fields, the evidence quote must appear verbatim in the transcript, and the value must be non-empty. Any unsupported proposal refuses the whole write set.
  • execute-writes always runs. On an apply decision it drift-checks every from value against the records that were read, applies the updates, and seals {executed: true, write_ref, applied, before, after} bound to the transcript and records digests. On no-op or refusal it seals {executed: false} so the absence of a write is itself evidence.
  • finalize asserts the transport result matches the decision before sealing runx.crm_cleanup_result.v1.

Evidence

Harness fixtures fetch pinned JSON files from this branch's harness-data/ directory; each case also declares caller.http_responses with identical bytes so harness runners without egress replay the same read deterministically.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WYXNBgyhBMg6rASyd4nwhN

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