Skip to content

Contract drift: provenance stamp, status detection, roles diff #85

Closed

Description

@radiusred-cody

Goal

Deliver the contract-propagation design agreed with the operator (2026-08-25, superseding a physical _latest shadow file — rejected for authority confusion, side-effect writes, and messenger staleness): the current contract is always available from the installed binary, so make _latest virtual. init stamps each scaffolded contract with a provenance header naming the release and upstream path; codecrew status reports when a local roles/ contract differs from the embedded one, pointing at codecrew roles diff; new verbs roles diff and roles show --latest give the comparison and full upstream text on demand; the provenance stamp lets an agent fetch the base version from the upstream repo at its tag for a three-way judgment. The AGENTS.md scaffold gains the standing reconciliation instruction: when status reports contract drift, the coordination layer compares, decides what to adopt, and routes the reconciliation through a normal task and PR with the decision recorded. Contracts stay project-owned forks — nothing is ever overwritten. Tests ride along per #46.

Requirements

None directly.

Plan

  1. Provenance stamp: scaffold() prefixes each written roles/*.md with <!-- scaffolded by codecrew <version>; upstream: radiusred/gh-codecrew roles/<name> --> — the version is the installed release (dev for source builds), and stripStamp removes exactly that line (plus its blank) so comparisons see the contract alone.
  2. Drift detection in status: when run in the hub with a local roles/ dir, each contract is compared (stamp-stripped) against the binary's embedded copy; differing files are reported with a pointer at codecrew roles diff <role>. Purely local — no network beyond what status already does.
  3. roles verbs: codecrew roles diff <role> prints a unified line diff (small LCS, no external tools) of local vs embedded; codecrew roles show <role> --latest prints the embedded contract whole, for the three-way judgment the provenance stamp enables (base fetchable from the upstream repo at the stamped tag).
  4. The standing reconciliation instruction joins the AGENTS.md scaffold: on a drift report, the coordination layer compares, decides what to adopt — contracts are the project's own fork; local conventions are legitimate — and routes the reconciliation through a normal task and PR with the decision recorded; never overwrite blindly.
  5. Surface: cli dispatch + usage, SPEC §6 verb-table row, and the init row notes the stamp. Tests per feat: request review from the reviewer-role holder #46: stamp round-trip (fresh scaffold shows zero drift), local-edit drift detection, diff output, show --latest fidelity.

Ask-the-human points

None — design agreed with the operator on 2026-08-25 (virtual _latest; physical shadow file rejected).

Activity

  1. added
    cc:task
    on Aug 25, 2026
  2. radiusred-cody commented on Aug 25, 2026

    @radiusred-cody
    ContributorAuthor

    Started by @radiusred-cody[bot].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cc:task

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions