Skip to content

feat: governance provenance types and history formatting - #824

Open
davidmiuraactualai wants to merge 5 commits into
feat/pgs-scope-assurancefrom
feat/pgs-provenance
Open

feat: governance provenance types and history formatting#824
davidmiuraactualai wants to merge 5 commits into
feat/pgs-scope-assurancefrom
feat/pgs-provenance

Conversation

@davidmiuraactualai

Copy link
Copy Markdown

Summary

  • Add ProvenanceEventType enum (11 governance event types)
  • Add ProvenanceEvent, ProvenanceChainResponse structs
  • Add format_governance_history function for actual governance history display
  • 5 new tests: serde round-trips and history formatting

Test plan

  • 64 governance tests passing (5 new provenance tests)
  • 3281 total tests passing (1 pre-existing OAuth test failure unrelated)

🤖 Generated with Claude Code

davidmiuraactualai and others added 5 commits August 11, 2026 14:31
Add ProvenanceEventType enum (11 event types), ProvenanceEvent struct,
ProvenanceChainResponse, and format_governance_history function for
displaying ordered provenance chains. 5 new tests covering serde
round-trips and history formatting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replaces the old start_advisor_query + poll_to_completion path with a
single sync post_intervention call. The CLI now sends a UserPromptSubmit
event through the intervention pipeline, matching how observer hooks
deliver architecture guidance.

Removes dead code: POLL_PATH, START_BODY, MAX_RETRY_AFTER, Outcome enum,
next_delay, print_answer, and tests that exercised the removed functions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ctual-end/>

Two features:
1. `actual observe setup --localhost` bakes ACTUAL_AUTH_URL/ACTUAL_API_URL env
   vars into hook commands so all hook invocations hit local services.
2. Stop-hook loop prevention: the advisor response includes <actual-end/>,
   and the CLI sets a per-session stop_ack flag that suppresses subsequent
   Stop hook evaluations until real work (PreToolUse/boundary) occurs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018wCALDeVcpBedCJ7gdKUo5
observe setup now resolves the repo's unique ID by matching the git
remote origin URL against the org's connected repos via the API, then
persists it in sticky_repo_scope. Subsequent hook invocations send
repo_unique_id instead of null, enabling repo-scoped ADR search.

- exec_setup calls try_resolve_and_persist_scope after installing hooks
- Respects --localhost flag for API URL selection
- Exposes parse_git_remote_url, match_remote_to_repos, RepoRemote as
  pub(crate) from advisor.rs for reuse in observe.rs
- Adds resolve_repo_unique_id_from_events to read sticky scope during
  hook invocations (was previously hardcoded to None)
- Degrades gracefully: if resolution fails, hooks still work at org level

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XpoJGi6P75oHz33j5FAhj8
Default `actual observe setup` now installs only 5 hooks (SessionStart,
UserPromptSubmit, PreToolUse[ExitPlanMode], Stop, SessionEnd) for lower
overhead. Use `--hook-all` to include per-tool-use, post-tool, pre-compact,
and subagent hooks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XpoJGi6P75oHz33j5FAhj8
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