Skip to content

feat: add codev trust gate integration (Spec 26)#37

Merged
timeleft-- merged 4 commits intomainfrom
feature/26-codev-trust-gate-integration
Mar 28, 2026
Merged

feat: add codev trust gate integration (Spec 26)#37
timeleft-- merged 4 commits intomainfrom
feature/26-codev-trust-gate-integration

Conversation

@timeleft--
Copy link
Copy Markdown
Member

Summary

  • trail_name in TG metadata: Added scope path to _redact_metadata() so the trust gate reviewer can detect artifact type from /specs/, /plans/, /reviews/ in the scope path
  • Codev addendum: Created src/fava_trails/integrations/codev/trust-gate-addendum.md with semantic quality checks for specs (vague criteria), plans (no decomposition), and reviews (no retrospective)
  • fava-trails integrate codev CLI: Composes generic TG prompt + codev addendum with provenance header, writes to trails/codev-artifacts/trust-gate-prompt.md. Supports --check (CI staleness), --diff (preview), --force (overwrite manual edits). Idempotent.
  • Bootstrap hint: Prints available integrations after fava-trails bootstrap completes
  • 13 new tests: Redaction with/without trail_name, deterministic composition, staleness detection, idempotency, diff mode, force overwrite, error cases

Deliverables from Spec 26

# Deliverable Status
1 trail_name in _redact_metadata() Done
2 trust-gate-addendum.md Done
3 integrations/codev/README.md Done
4 fava-trails integrate codev CLI Done
5 Bootstrap integration message Done
6 Tests (redaction, composition, staleness, idempotency) Done
7 No changes to codev's artifacts.ts Confirmed

Test plan

  • uv run pytest -v — 587 tests pass (13 new)
  • uv run ruff check — clean
  • CI passes (test + semantic PR title)
  • Manual: fava-trails integrate codev in a data repo produces correct composed prompt
  • Manual: fava-trails integrate codev --check returns 0 when up to date, 1 when stale

🤖 Generated with Claude Code

Add codev-specific trust gate addendum and CLI command for composing
quality gate prompts for codev artifacts (specs, plans, reviews).

- Add trail_name to TG redacted metadata for scope-based artifact detection
- Create integrations/codev/ with trust-gate-addendum.md and README.md
- Add `fava-trails integrate codev` CLI with --check, --diff, --force flags
- Print integration hint after bootstrap
- Add tests for redaction, composition, staleness detection, idempotency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread src/fava_trails/cli.py Fixed
timeleft-- and others added 3 commits March 28, 2026 09:53
- Guard addendum resource read with try/except for broken installs
- Make --check/--diff mutually exclusive in argparse; reject --force with
  non-write modes
- Add 3 failure-path tests (missing addendum, --force+--check, --force+--diff)
- Remove unused _PROVENANCE_RE regex
- Fix provenance header: --upgrade → fava-trails integrate codev
- Move hashlib import to module level

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- --check now compares content only (strips provenance header) so package
  version bumps don't cause false-positive staleness in CI
- Add encoding="utf-8" to all read_text()/write_text() calls in
  cmd_integrate_codev for Windows locale safety
- Add tests: version-in-header tolerance, _strip_provenance_header unit tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@timeleft-- timeleft-- merged commit c91ef87 into main Mar 28, 2026
6 checks passed
@timeleft-- timeleft-- deleted the feature/26-codev-trust-gate-integration branch March 28, 2026 14:05
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