You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,12 @@ When a source issue contains a `codex-pr-feedback` marker from a failed CI run o
33
33
34
34
This avoids hard-coding Codex CLI setup in every source repository and avoids depending on a repository outside the `QuantStrategyLab` organization.
35
35
36
+
Automation authority is intentionally split from model confidence. The service treats routine low-risk maintenance as auto-merge eligible, allows already-live same-family strategy optimization to auto-merge only when service-owned checks provide trusted proof and the repo/autonomy policy already allows auto-merge, and keeps new/reconstructed strategies, live-candidate promotion, plugin position-control changes, broker/order execution changes, workflow permissions, and secrets behind human review. `POST /v1/ai/automation/authority` accepts request metadata only as restrictive hints; it cannot relax the policy for live-impacting automation.
37
+
38
+
Static-token dashboards can read automation control and run-ledger state only for repositories listed in `CODEX_AUDIT_SERVICE_DASHBOARD_REPOSITORIES`; write endpoints still require GitHub OIDC or local test auth.
39
+
40
+
Automation run state is persisted through the service ledger. Async Codex jobs are recorded automatically; external workflows can also call `POST /v1/ai/automation/runs`. Ledger ownership follows `source_repository` when present, otherwise the authenticated repository. Operators and dashboards can read `GET /v1/ai/automation/runs`, `GET /v1/ai/automation/runs/{run_id}`, and `GET /v1/ai/automation/control` to decide whether to continue, pause auto-fix, switch to review-only, or escalate.
41
+
36
42
## Compatibility governance role
37
43
38
44
`QuantStrategyLab/AIAuditBridge` is an ops/control-plane consumer only:
|`automation_run_ledger.py`| Persistent automation run state and runtime control suggestions |
46
48
|`feedback.py`| Closed-loop change tracking and evaluation |
47
49
48
50
### Adapters (`service/adapters/`)
@@ -70,6 +72,10 @@ operations: **Analyze**, **Execute**, and **Review**.
70
72
|`/v1/ai/health`| GET | Online service health snapshot | No |
71
73
|`/healthz`| GET | Liveness check | No |
72
74
|`/v1/ai/quota`| GET | Provider usage, Codex account limits, and internal estimates | No |
75
+
|`/v1/ai/automation/authority`| POST | Evaluate auto/human-review authority for live-impacting changes | No |
76
+
|`/v1/ai/automation/control`| GET | Convert health/quota/org-health into continue/review-only/pause/escalate | No |
77
+
|`/v1/ai/automation/runs`| GET/POST | Read or record automation run ledger entries | No |
78
+
|`/v1/ai/automation/runs/{id}`| GET | Read one automation run ledger entry | No |
73
79
|`/v1/ai/feedback/*`| GET/POST | Change tracking and evaluation | No |
74
80
75
81
Health status vocabulary is defined in [`health_taxonomy.md`](health_taxonomy.md). Do not use `/v1/ai/health` as a substitute for monthly audit results, artifact freshness, or strategy-level health evidence.
@@ -114,6 +120,8 @@ POST /v1/ai/review
114
120
→ optional Codex verification
115
121
→ extract confidence scores
116
122
→ compute consensus + recommended action
123
+
→ cap action through automation authority policy
124
+
→ re-cap through service/quota/org health runtime guards
117
125
→ return {results, consensus, recommended_action}
118
126
```
119
127
@@ -124,6 +132,24 @@ POST /v1/ai/review
124
132
requirement.
125
133
-**Authorization**: Source repository org must match OIDC claims repository org
126
134
(prevents cross-org escalation).
135
+
-**Automation authority**: Request metadata can only make a decision stricter.
136
+
Live-equivalent auto-merge requires service-owned trusted proof and an
137
+
existing repo/autonomy policy decision that already allows auto-merge; public
138
+
endpoints cannot self-declare it. The review path may read trusted proof from
139
+
`CODEX_AUDIT_SERVICE_TRUSTED_AUTOMATION_PROOF_PATH`, keyed by
140
+
`trusted_proof_id` and the server-computed prompt SHA-256; proof records carry
141
+
the reviewed `source_repository`, `commit_sha`, `diff_hash`, and `changed_paths`,
142
+
and the caller must be that repository or an explicit automation operator.
143
+
-**Automation ledger tenancy**: Ledger reads and writes use `source_repository`
144
+
as owner when present, otherwise the authenticated repository; `caller_repository`
145
+
is audit metadata, not read authorization.
146
+
-**Automation control state**: Run task state may be reported by callers, but
147
+
control action and health/quota/org-health fields are derived by the service.
148
+
-**Operator access**: Cross-repository automation reads/writes require an
149
+
explicit operator claim/scope or `CODEX_AUDIT_SERVICE_AUTOMATION_OPERATOR_REPOSITORIES`.
150
+
Static-token and no-auth local callers are repository-scoped unless explicitly allowlisted.
151
+
-**Dashboard read access**: Static-token dashboards may read automation control
152
+
and ledger state only for repositories listed in `CODEX_AUDIT_SERVICE_DASHBOARD_REPOSITORIES`.
127
153
-**Sandbox**: Codex sandbox restricted to service-side allowlist (default: `read-only`).
128
154
-**Codex reasoning effort**: `CODEX_AUDIT_SERVICE_REASONING_EFFORT` can hard
129
155
override CLI effort; unset/`auto` routes low/medium/high by task complexity.
0 commit comments