Commit graph

11 commits

Author SHA256 Message Date
Tyler J King
8ed9bf6413 feat(org-ops-core): add git_blob_hash utility, migrate test_evidence CID
Add git_hash module that computes SHA-1 blob hashes identical to
`git hash-object --stdin`. Includes BPF map key extraction that
handles both legacy sha256: and new gitsha1: CID formats.

Migrate TestRunResult::compute_cid() from custom SHA-256 to git
blob hash. New CID format: `gitsha1:{40 hex chars}`. File storage
path uses the full CID as filename (backward compatible for reads
since old files retain their sha256: names).

New dependency: sha1 0.10 (RustCrypto, same family as sha2).

See cid-reconciliation-audit.md Sites 1, 3.

Signed-off-by: Tyler King <tking@guildhouse.dev>
2026-04-12 07:44:33 -04:00
Tyler J King
fdaf39eff2 refactor(ai_risk_analysis): migrate Chronicle emission to CloudEvents
Replace fake Forgejo push webhook for AI_RISK_ASSESSMENT with
structured CloudEvents 1.0. Event now carries confidence_score,
recommendation, test_results_analyzed, and diff_match as typed
fields instead of a flat message string.

Event rename: AI_RISK_ASSESSMENT -> GOV_AI_RISK_ASSESSMENT

Signed-off-by: Tyler King <tking@guildhouse.dev>
2026-04-12 06:54:31 -04:00
Tyler J King
8f2884d5fa refactor(apply_gate): migrate Chronicle emission to CloudEvents
Replace fake Forgejo push webhook for APPLY_AUTHORIZED with
structured CloudEvents 1.0. Event carries diff_hash and mfa_method
as typed fields.

Event rename: APPLY_AUTHORIZED -> GOV_APPLY_AUTHORIZED

Signed-off-by: Tyler King <tking@guildhouse.dev>
2026-04-12 06:53:56 -04:00
Tyler J King
869cc610b5 refactor(playbook_commands): migrate Chronicle emission to CloudEvents
Replace fake Forgejo push webhook construction with structured
CloudEvents 1.0 via ChronicleClient. All playbook governance events
now carry structured data fields (playbook name, corpus CID, exit
code, duration) instead of unstructured message strings.

Event renames:
- PLAYBOOK_STARTED -> GOV_PLAYBOOK_STARTED
- PLAYBOOK_COMPLETED -> GOV_PLAYBOOK_COMPLETED
- ACCORD_LOAD_FAILED -> GOV_ACCORD_LOAD_FAILED
- DIFF_MISMATCH_DETECTED -> GOV_DIFF_MISMATCH_DETECTED

Signed-off-by: Tyler King <tking@guildhouse.dev>
2026-04-12 06:53:26 -04:00
Tyler J King
92464b07c5 refactor(git_commands): migrate Chronicle emission to CloudEvents
Replace fake Forgejo push webhook construction with structured
CloudEvents 1.0 via ChronicleClient. Git commit SHAs are now used
as CloudEvent ids for COMMIT_CREATED and PUSH events, enabling
direct correlation between Chronicle entries and git history.

Event renames:
- REPO_CLONED -> GOV_REPO_CLONED
- COMMIT_CREATED -> GOV_COMMIT_CREATED
- GOVERNED_PUSH -> GOV_PUSH
- PR_CREATED -> GOV_PR_CREATED

Signed-off-by: Tyler King <tking@guildhouse.dev>
2026-04-12 06:51:42 -04:00
Tyler J King
cf744dd909 feat(org-ops-core): add ChronicleClient for CloudEvents emission
Replaces fake Forgejo push webhook pattern with structured
CloudEvents 1.0. Git-originated events use commit SHA as event id.
Non-git events use UUID v4.

No new dependencies — constructs CloudEvents JSON manually using
serde_json. Endpoint auto-derived from legacy webhook URL.

Ref: cid-reconciliation-audit.md Phase 1

Signed-off-by: Tyler King <tking@guildhouse.dev>
2026-04-12 06:45:19 -04:00
Tyler J King
d39fd692eb chore: remove dead reasoning_cid computation
The reasoning_cid was computed via SHA-256 but immediately discarded
(`let _ = reasoning_cid`). Remove the dead hash computation and the
now-unused sha2 import.

Ref: cid-reconciliation-audit.md Site 5

Signed-off-by: Tyler King <tking@guildhouse.dev>
2026-04-12 06:38:04 -04:00
Tyler J King
7107b2860a feat: wire GSAP into playbook runner — full AC→shell→CR loop
The governed playbook runner now:
1. Requests an AC from the GSAP broker before execution
2. Validates corpus CID + parameters CID + single-use
3. Executes the ansible playbook (unchanged)
4. Posts a Completion Receipt to the broker after execution

Environment variables:
  GSAP_BROKER_URL — Capstone broker endpoint
  GSAP_BEARER_TOKEN — JWT for broker auth
  GSAP_DRIVER_ID — identity driver (default: keycloak-guildhouse)
  GSAP_ACCORD_TEMPLATE — accord template (default: from GUILDHOUSE_ACCORD)
  GSAP_SESSION_DIR — local session state directory

Self-authorized mode:
  If GSAP_BROKER_URL not set, execution proceeds without AC/CR.
  Valid for development (GSAP §1.3). Not for production.

Error handling:
  ElevationRequired → shows activation instructions, aborts
  Denied → shows reason, aborts
  CorpusMismatch → shows CID diff, aborts
  CR delivery failure → stores locally, warns, does not abort

4/4 gsap_client unit tests passing.
Build clean with zero errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 13:15:54 -04:00
Tyler J King
aa5853d168 feat: GSAP client module — shell side of GSAP protocol
Implements the shell side of GCAP-SPEC-SHELLBOUND-BROKER-0001.
The broker (Capstone) issues ACs. This module consumes them.

GsapClient:
  authorize() — request AC, validate R-20/R-22/R-23/R-24
  complete() — post CR with 3x retry (R-29)

ConsumedContextRegistry:
  Filesystem-based replay prevention (R-22)

4/4 unit tests passing:
  test_corpus_mismatch, test_params_modified,
  test_replay_rejected, test_valid_ac

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 12:44:59 -04:00
Tyler J King
6912a46001 feat: bxnet-ops — BXNet governed shell
Fork of guildhouse/org-ops.
Binary: guildhouse-ops → bxnet-ops
DID: guildhouse.dev → bxnet.io
Upstream remote configured for sync.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 19:52:54 -04:00
242fb32180 Initial commit 2026-03-27 23:52:21 +00:00