Skip to content

feat(tcl): tool-qualification workstream A + AI session provenance (#127)#289

Merged
avrabe merged 1 commit into
mainfrom
feat/tcl-ai-session
May 16, 2026
Merged

feat(tcl): tool-qualification workstream A + AI session provenance (#127)#289
avrabe merged 1 commit into
mainfrom
feat/tcl-ai-session

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented May 16, 2026

Summary

Ships the smallest viable surface of TCL design workstream A (docs/design/tool-confidence-level.md §7.4) and closes the schema half of #127 AI session provenance. The ai-session and ai-found-defect schemas compose: an AI-introduced defect points back to the session that produced it.

Schema additions

schemas/common.yaml:

  • ai-session (feat: AI session provenance — link Claude Code session logs to traceability chain #127) — pins a Claude Code (or other AI) session to a commit. session-id, session-hash, model-id, tool-version, commit-sha, started-at, ended-at, invoker.
  • ai-found-defect (TCL A3) — typed record for AI-introduced errors that rivet's detection machinery caught. severity (critical/major/minor/info), triage-status (open/accepted/rejected/deduplicated), detected-by, …
  • Link types: defect-against, corrects, produced-by.

schemas/iso-26262.yaml:

  • tool-confidence (TCL A2) — typed claim per ISO 26262-8 §11.4.7. ti (TI1/TI2), td (TD1/TD2/TD3), tcl, regime (8 standards regimes), claim-status (self-claimed/qualified/conditional/target), scope, plus qualification-evidence link-field.

Dogfood (TCL A1)

  • Fixed inverted TCL/TQL convention in safety/stpa/tool-qualification.yaml header (now follows ISO 26262 Table 3: TCL1 = lowest demand).
  • New typed claim TQ-CONF-RIVET at safety/tool-qualification/rivet-tool-confidence.yaml — rivet's own TI2/TD1/TCL1 self-claim, links to the seven dogfood hazards.
  • rivet.yaml now loads iso-26262 schema + scans safety/tool-qualification/.

CLI (TCL A4, A5)

  • rivet docs tool-qualification — renders the new dossier (docs/design/tool-qualification-dossier.md).
  • rivet stats --qualification — JSON-only baseline manifest: rivet version, schemas in use, every tool-confidence claim, ai-found-defect aggregates. The snapshot a safety manager pastes into the dossier.
  • --qualification-mode top-level flag — initial gate refuses rivet sync (Phase 2 federation, out of scope per dossier §4). Read-only commands stay allowed.

What's NOT in this PR

  • rivet check ai-defects-open oracle (needs agent-pipelines wiring, bigger refactor).
  • Phase 2 of feat: AI session provenance — link Claude Code session logs to traceability chain #127 (commit hook to auto-stamp ai-session metadata, rivet audit to enforce coverage).
  • Independent qualification assessment (claim-status stays self-claimed).
  • Migrate-command qualification gate (Migrate is nested under Schema, deferred to keep the gate's scope simple).

Test plan

  • cargo test --workspace --lib — 994 pass.
  • cargo test --workspace — green.
  • New integration tests: stats_qualification_emits_baseline_manifest_for_dogfood (asserts TQ-CONF-RIVET surfaces at TCL1), qualification_mode_blocks_sync (asserts gate produces non-zero exit with discoverable message).
  • cargo clippy --workspace --all-targets — clean.
  • cargo fmt --all — clean.
  • Manual: rivet docs tool-qualification renders the dossier; rivet stats --qualification produces the manifest with TQ-CONF-RIVET present.

🤖 Generated with Claude Code

)

Closes #127 (AI session provenance — schema half) and ships the smallest
viable surface of TCL design workstream A (per
docs/design/tool-confidence-level.md §7.4).

**Schema additions (schemas/common.yaml)**

- `ai-session` artifact type — pins a Claude Code (or other AI) session
  to a commit so the auditor can reconstruct *who/what* authored a
  change. Fields: session-id, session-hash (SHA-256 of transcript),
  model-id, tool-version, commit-sha, started-at, ended-at, invoker.
- `ai-found-defect` artifact type (TCL A3) — typed defect record for
  errors introduced by AI authoring that rivet's detection machinery
  caught. Fields: severity, triage-status (open/accepted/rejected/
  deduplicated), detected-by, discovered-at, triaged-at, triaged-by.
- Link types: `defect-against` (defect → target), `corrects` (fix →
  defect), `produced-by` (artifact → ai-session).

**Schema additions (schemas/iso-26262.yaml)**

- `tool-confidence` artifact type (TCL A2) — typed tool-qualification
  claim per ISO 26262-8 §11.4.7. Fields: tool-id, ti (TI1/TI2), td
  (TD1/TD2/TD3), tcl (TCL1/TCL2/TCL3), regime (iso-26262/do-178c/
  do-330/en-50128/iec-61508/iec-62304/iso-21434/iso-pas-8800), claim-
  status (self-claimed/qualified/conditional/target), scope. link-field
  `qualification-evidence` points at the proofs / oracle runs that
  defend the TD claim.

**Dogfood (TCL A1)**

- Fix inverted TCL/TQL convention in safety/stpa/tool-qualification.yaml
  header (now follows ISO 26262 Table 3: TCL1 = lowest demand).
- New typed claim `TQ-CONF-RIVET` at safety/tool-qualification/
  rivet-tool-confidence.yaml — rivet's own TI2/TD1/TCL1 self-claim
  links to the seven hazards in the dogfood STPA.
- rivet.yaml: load `iso-26262` schema + scan
  `safety/tool-qualification/` source path.

**CLI (TCL A4, A5)**

- `--qualification-mode` flag on the top-level Cli. Initial gate
  refuses `rivet sync` (Phase 2 federation, out of scope per dossier
  §4). Read-only commands stay allowed; the list is deliberately
  narrow — better to expand than to silently block audit work.
- `rivet stats --qualification` — JSON-only configuration baseline
  manifest for the dossier. Lists rivet version, schemas in use,
  every `tool-confidence` artifact with its claim, and `ai-found-
  defect` aggregates (by severity, by triage-status, plus open-IDs).
  This is the snapshot the safety manager pastes into the dossier.
- `rivet docs tool-qualification` — renders the new dossier doc
  (docs/design/tool-qualification-dossier.md) wired into the docs
  topic registry.

**Tests**

- Integration: `stats_qualification_emits_baseline_manifest_for_dogfood`
  validates the full JSON envelope contains TQ-CONF-RIVET at TCL1.
- Integration: `qualification_mode_blocks_sync` asserts the gate
  produces a non-zero exit with a discoverable error message.

**Not in this PR**

- `rivet check ai-defects-open` oracle (deferred — needs the agent-
  pipelines wiring, which is a bigger refactor).
- Phase 2 of #127 (commit hook to auto-stamp ai-session metadata,
  `rivet audit` to enforce that every AI commit has a session record).
- Independent assessment (claim-status stays self-claimed).

Implements: REQ-002, REQ-007, REQ-010
Refs: FEAT-001, #127

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

📐 Rivet artifact delta

Change Count
Added 1
Removed 0
Modified 0
Downstream impacted (depth ≤ 5) 0

Graph

graph LR
  TQ_CONF_RIVET["TQ-CONF-RIVET"]:::added
  classDef added fill:#d4edda,stroke:#28a745,color:#155724
  classDef removed fill:#f8d7da,stroke:#dc3545,color:#721c24
  classDef modified fill:#fff3cd,stroke:#ffc107,color:#856404
  classDef overflow fill:#e2e3e5,stroke:#6c757d,color:#495057,stroke-dasharray: 3 3
Loading
Added
  • TQ-CONF-RIVET

📎 Full HTML dashboard attached as workflow artifact rivet-delta-pr-289download from the workflow run.

Posted by rivet-delta workflow. The graph shows only changed artifacts; open the HTML dashboard (above) for full context.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@avrabe avrabe merged commit ed4a491 into main May 16, 2026
17 of 39 checks passed
@avrabe avrabe deleted the feat/tcl-ai-session branch May 16, 2026 14:38
avrabe added a commit that referenced this pull request May 16, 2026
…290)

* release(v0.10.0): variant + supplier + AI session + TCL workstream A

Workspace version bump 0.9.0 → 0.10.0. Theme: audit-grade story —
three orthogonal features that together move rivet from "trace your
project" to "describe the boundary and defend the tool's role across
it."

Highlights (full notes in CHANGELOG.md):
- Variant-aware properties — per-variant field values (#285, #255).
- Cross-org / supplier-boundary coverage MVP (#286, #253).
- AI session provenance — schema half (#289, partially #127).
- Tool-qualification workstream A — typed claim + dossier (#289).
- rivet stats --qualification + --qualification-mode flag (#289).
- TCL/TQL numbering convention fix in dogfood STPA (#289).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(release): docs-check violations on v0.10.0 release commit

Two docs-check violations on PR #290:
- VersionConsistency: vscode-rivet/package.json bumped 0.9.0 → 0.10.0
  (it has its own version field, not workspace-inherited).
- SubcommandReferences: CHANGELOG mentioned `rivet audit` which is a
  Phase 2 future subcommand. Rephrased to "audit-side enforcement
  subcommand" so the literal `rivet audit` no longer parses as a
  current-cli reference.

Local `rivet docs check` now passes (54 files, 0 violations).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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