Skip to content

feat(cli): auto-adoption safeguard S2 — provenance sentinel (cli-3.35.0)#359

Merged
montfort merged 1 commit into
mainfrom
feat/cli-3.35.0-provenance-sentinel
Jul 13, 2026
Merged

feat(cli): auto-adoption safeguard S2 — provenance sentinel (cli-3.35.0)#359
montfort merged 1 commit into
mainfrom
feat/cli-3.35.0-provenance-sentinel

Conversation

@montfort

Copy link
Copy Markdown
Contributor

Second safeguard of AIDEC-2026-07-13-001 (StrayMark self-adoption). With S1 (PR #358, merged) + this S2, the gate to a root straymark init opens.

S2 — provenance sentinel

  • straymark init writes .straymark/.provenance.yml:
    role: installed-project
    framework_version: "4.35.0"     # the pinned "yesterday's tail"
    installed_at: "2026-07-13"
    source_release: "fw-4.35.0"
  • resolve_project_root now runs a unified non_project_reason check (S1 + S2): refuses the distribution source (S1, via dist-manifest.yml) and any .straymark/ whose provenance records a non-install role: (e.g. a test fixture, a hand-marked distribution copy).
  • Legacy tolerance (invariant): an absent .provenance.yml = legacy install = operable. Existing adopters (Sentinel, lnxdrive) have none and keep working. provenance_role is a dependency-light line-scanner (no serde on the hot resolution path).
  • straymark remove cleans .provenance.yml alongside .checksums.json.

Design (operator-approved)

  • Option A: only init stamps installs; dist/ is caught by S1. No distribution-source marker shipped → no adopter-facing change.
  • Own file (.provenance.yml), not a field in the shipped config.yml.

Also in this PR

  • docs/decisions/AIDEC-2026-07-13-001-implementation-plan.md — the safeguard sequence + status + rollback notes, versioned alongside the AIDEC so we can retrace/roll back if self-adoption misbehaves.

Deferred (tracked in the plan)

  • straymark update-framework refreshing the provenance version fields (preserving installed_at) — harmless until S3 reads the field.

Tests

provenance_role parsing, resolution: tolerate-absent (legacy) / accept installed-project / refuse non-install-role, plus init render_provenance round-trip through the utils reader. Full workspace suite green; no new clippy. .gitignore (your local scratch prefs) intentionally excluded from this PR.

cli-3.35.0. Not tagged — merge + tag are yours. (Note: cli-3.34.0 / S1 is on main but also untagged; you may prefer to tag cli-3.35.0 once, covering S1+S2 together.)

🤖 Generated with Claude Code

Second safeguard of AIDEC-2026-07-13-001 (StrayMark self-adoption). `straymark
init` now stamps `.straymark/.provenance.yml` with `role: installed-project`,
the pinned `framework_version`, `installed_at`, and `source_release`.

`resolve_project_root` gains a unified `non_project_reason` check (S1 + S2):
refuses the distribution source (S1, unchanged) AND any `.straymark/` whose
provenance records a non-install role (S2) — while TOLERATING an absent
provenance file so existing adopters (Sentinel, lnxdrive — no sentinel) keep
resolving. `provenance_role` is a dependency-light line-scanner (no serde on the
hot path). `straymark remove` cleans the file.

Design (per the implementation plan, operator-approved): Option A — only `init`
stamps installs; the distribution `dist/` is caught by S1's dist-manifest
detection (no distribution-source marker shipped). Own file (not config.yml).
The `framework_version` is the pinned "yesterday's tail" record the lagged
self-adoption is built on.

Deferred: `update-framework` refreshing the provenance version (harmless until
S3 reads it) — tracked in docs/decisions/AIDEC-2026-07-13-001-implementation-plan.md.

Also adds that implementation plan doc, versioned alongside the AIDEC.

Full workspace suite green; new unit tests for S2 (init render + resolution
tolerate-absent / accept-install / refuse-non-install-role); no new clippy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@montfort montfort merged commit 462a18c into main Jul 13, 2026
1 check passed
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