@@ -69,6 +69,69 @@ authority decision pushes:
6969- audit events -> ` /v1/audit/events:batch `
7070- usage credits -> ` /v1/metering/usage:batch `
7171
72+ ## 3b) Optional local identity registry (ephemeral task identities)
73+
74+ Enable local identity support:
75+
76+ ``` bash
77+ PYTHONPATH=. predicate-authorityd \
78+ --host 127.0.0.1 \
79+ --port 8787 \
80+ --mode local_only \
81+ --policy-file examples/authorityd/policy.json \
82+ --identity-mode local-idp \
83+ --local-identity-enabled \
84+ --local-identity-registry-file ./.predicate-authorityd/local-identities.json \
85+ --local-identity-default-ttl-s 900 \
86+ --flush-worker-enabled \
87+ --flush-worker-interval-s 2.0 \
88+ --flush-worker-max-batch-size 50 \
89+ --flush-worker-dead-letter-max-attempts 5
90+ ```
91+
92+ Issue an ephemeral identity:
93+
94+ ``` bash
95+ curl -s -X POST http://127.0.0.1:8787/identity/task \
96+ -H " Content-Type: application/json" \
97+ -d ' {"principal_id":"agent:backend","task_id":"refactor-pr-102","ttl_seconds":120}'
98+ ```
99+
100+ Inspect pending local ledger flush queue:
101+
102+ ``` bash
103+ curl -s http://127.0.0.1:8787/ledger/flush-queue | jq
104+ ```
105+
106+ List quarantined dead-letter items only:
107+
108+ ``` bash
109+ curl -s http://127.0.0.1:8787/ledger/dead-letter | jq
110+ ```
111+
112+ Manually trigger an immediate flush cycle:
113+
114+ ``` bash
115+ curl -s -X POST http://127.0.0.1:8787/ledger/flush-now \
116+ -H " Content-Type: application/json" \
117+ -d ' {"max_items":50}' | jq
118+ ```
119+
120+ Requeue a quarantined item for retry:
121+
122+ ``` bash
123+ curl -s -X POST http://127.0.0.1:8787/ledger/requeue \
124+ -H " Content-Type: application/json" \
125+ -d ' {"queue_item_id":"q_abc123"}' | jq
126+ ```
127+
128+ Flush worker behavior:
129+
130+ - reuses control-plane client retry policy (` --control-plane-max-retries ` , ` --control-plane-backoff-initial-s ` ),
131+ - drains up to ` --flush-worker-max-batch-size ` queue items per cycle,
132+ - quarantines entries after ` --flush-worker-dead-letter-max-attempts ` failed sends,
133+ - sleeps ` --flush-worker-interval-s ` between flush cycles.
134+
72135Expected startup output:
73136
74137``` text
0 commit comments