feat(agentid): Go port of the canonical o2r agent-id generator (parity with the aos test vector) #177
Labels
No labels
burndown-2026-06
sunday-sprint
coherence-core
consult
headless
interactive
P0
P1
P2
P3
P4
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coilyco-flight-deck/cli-guard#177
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Provide the Go port of the canonical o2r agent-id generator so ward (which imports cli-guard) and cli-guard mint agent ids in the canonical form. The canonical rules + alphabet + test vector live in aos (#302); this is the verified Go port.
What
pkg/agentid) generating a lowercase 2-letter + 2-digit id over the same excluded-char alphabet as the aos canonical generator.crypto/rand-backed, uniform.agent_id_vectors.json) and add a Go test asserting the port matches it byte-for-byte (seedable variant). A drift fails CI - this is the cross-language contract.Scope note (do NOT touch these)
cli-guard ids that are not agent names stay as-is: the audit
NewUUIDv7SessionID (pkg/audit/audit.go) and theCLAUDE_SESSION_IDenv (pkg/audit/session.go) are harness/audit identifiers, not agent names. This issue only adds the shared agent-id generator for name minting.Acceptance
pkg/agentidgenerates canonical lowercase 2+2 ids; a Go test passes against the committed aos vector; CI fails on drift from the vector.Files
new
pkg/agentid/*.go, a vendored/syncedagent_id_vectors.json, tests. Depends on aos #302; consumed by ward #387.When done
Run the gate (build/vet/test, golangci-lint, godoc-current), commit, push to
main, updatedocs/FEATURES.md, comment on ward #387 that the Go generator is available.Held from the headless auto-dispatch batch: this is headless-eligible but blocked-on-dependency. It needs agentic-os#302 (the canonical o2r agent-id generator + shared test vector) to land first so the Go port can match the vector. Ready to dispatch once #302 closes.
(automated triage, coilyco-ops director session)
Unblocked: aos #302 has landed on canonical
main(e5ccceb). The canonical generator and the shared test vector this Go port asserts against are now committed:agentic_os/agent_id.py- lowercase 2-letter+2-digit over the dictatable alphabet (abcdefghjkmpqrstuvwxyz+456789, confusables/homophonesi l n o 0 1 2 3dropped), lifted from the archived o2r source,secrets-backed.agentic_os/agent_id_vectors.json- carriesid_letters,id_digits, and a fixed seed->id map. The seedable algorithm issha256(utf8(seed))then index each sub-alphabet by the first four digest bytes mod its length (bytes 0,1 -> letters, 2,3 -> digits) - portable to Go byte-for-byte withsha256.Sum256([]byte(seed)). The exact spec string is in the vector'sseed_algorithmfield.Vendor/sync that JSON and assert your
crypto/randport's seedable variant reproduces every row. A drift test on the aos side keeps the file honest.🔒 Reserved by
ward agent --driver claude— containerengineer-claude-cli-guard-177on hostKAI-DESKTOP-TOWERis carrying this issue (reserved 2026-07-07T06:16:34Z). Concurrentward agentruns are blocked until it finishes or the reservation goes stale (2h0m0s TTL);--forceoverrides.Do not comment on or edit this issue to steer the run while it is reserved. The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a new issue, dispatched fresh — that is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494).
run seed context — what this run is carrying (ward#609)
coilyco-flight-deck/cli-guard#177· branchissue-177· driverclaude· workflowdirect-mainengineer-claude-cli-guard-177· wardv0.419.0· dispatched2026-07-07T06:16:34ZIssue body as seeded:
Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.419.0).
— Claude (she/her), via
ward agentWARD-OUTCOME: done - pkg/agentid landed on main (
d9e805e), Go port of the aos o2r agent-id generator with the vendored vector asserted byte-for-byte.The core port was the easy part: the aos generator (
agentic_os/agent_id.py) spells its seed algorithm out in the docstring precisely so a port cannot guess wrong, soSeededIDmatched all 24 committed vectors on the firstgo testrun. The one thing I double-checked was modulo bias in the random minter - Python leans onsecrets.choice, so I usedcrypto/rand+big.Intrejection sampling forNewIDrather than a raw%, to keep it genuinely uniform.What actually fought back was the pre-commit suite, not the code. The 2-line comment-block cap clipped every godoc I wrote (package doc is exempt, function docs are not), and the 4000-char cap on
docs/FEATURES.mdmeant a single new bullet forced me to shave a dozen existing descriptions to claw back ~160 chars. Both are healthy constraints, just a lot of small iterations.Confident in the result: the drift test is the real contract and it is green, alphabet + all vectors matched. Scope stayed tight - only the name-minting generator, the audit SessionID / CLAUDE_SESSION_ID identifiers were left alone per the issue. Posted the availability note on ward #387 (it is already closed, but the record is there); no follow-ups worth filing.