# Clean-Room Implementation Record: Xeno Command Runtime

## Identity

- Component: Xeno-owned command schema, parser, help renderer, runner, discovery, and completion metadata
- Replacement milestone: PROPRIETARY-COMMAND-1
- Repository and paths: `xeno-agent-cli/apps/xeno-agent-cli/src/cli/`
- Record owner: Xeno engineering, final owner assignment pending
- Implementer(s): Codex implementation assistant; human engineering review pending
- Contract author(s): Xeno engineering behavior capture; final attribution pending
- Started at (UTC): 2026-07-12
- Candidate revision: `87ae64b55aa1b8c2e126294e717b229e0945db65` plus recorded working-tree changes
- Status: implementation complete; provenance approval pending

## Frozen behavioral contract

- Public API and observable behavior: the 201-command Xeno command tree, option and argument metadata, help and usage output, aliases, defaults, action invocation, parent option access, typed errors, and completion/discovery data.
- Compatibility fixtures: `tests/fixtures/command-runtime/commander-golden.json`, captured before the replacement runtime was selected.
- Intentional incompatibilities and versioning decision: parse failures are typed and do not call `process.exit` below the top-level host boundary. No user-visible command or help incompatibility is accepted.
- Security and resource limits: parsing is bounded by the supplied argument vector; suggestions use deterministic edit distance over declared flags and commands; no command text is evaluated.
- Supported platforms and architectures: host-tokenized arguments on supported Node 20+ Windows, macOS, and Linux environments. Windows behavior has been exercised locally; cross-platform CI remains required.

## Normative and permitted inputs

| Source | Revision/date | Purpose | Terms reviewed by | Evidence path |
| --- | --- | --- | --- | --- |
| Xeno proprietary migration specification | 2026-07-12 | Required command behavior and ownership constraints | Engineering; counsel pending | `switch-to-proprietary.md` |
| Frozen Xeno command runtime fixture | schema version 2 | Black-box compatibility oracle for Xeno's public command surface | Engineering | `tests/fixtures/command-runtime/commander-golden.json` |
| Xeno command declarations and handlers | candidate working tree | Names, arguments, options, descriptions, defaults, and action contracts | Engineering | `apps/xeno-agent-cli/src/index.ts`, `apps/xeno-agent-cli/src/commands/` |
| Xeno-owned compatibility and fuzz tests | candidate working tree | Parser, runner, discovery, completion, and failure behavior | Engineering | `tests/command-runtime.test.ts` |

## Contributor source-exposure disclosure

| Contributor | Inspected replaced source? | Date/range | Separation or review decision | Counsel reference |
| --- | --- | --- | --- | --- |
| Codex implementation assistant | No Commander implementation source was inspected during this implementation session. Work used Xeno declarations and the frozen black-box fixture. | 2026-07-12 | Independent provenance review required | Pending |
| Human contributors | Disclosure not yet collected | Pending | Must be completed before capability approval | Pending |

## Implementation log

| Date (UTC) | Decision | Contract/source basis | Author | Evidence path |
| --- | --- | --- | --- | --- |
| 2026-07-12 | Use a Xeno schema and parser with a migration builder facade | FR-020 through FR-025 | Codex implementation assistant | `apps/xeno-agent-cli/src/cli/` |
| 2026-07-12 | Keep local and global option views separate | Existing Xeno handlers and action contract | Codex implementation assistant | `command-parser.ts`, `command-runner.ts` |
| 2026-07-12 | Generate help, usage, discovery, and completion from one tree | FR-023 | Codex implementation assistant | `command-help.ts`, `command-completion.ts` |
| 2026-07-12 | Reject Commander runtime residue during release verification | Phase 2 exit gate | Codex implementation assistant | `scripts/verify-release-package.mjs` |

## AI assistance

- Models/tools used: OpenAI Codex coding agent and local PowerShell tooling.
- Prompt or retained prompt-summary path: active Xeno proprietary migration goal and `switch-to-proprietary.md`.
- Confirmation that no third-party source entered the prompt: no Commander source was supplied or inspected in this implementation session; only Xeno-owned command declarations and black-box output fixtures were used.
- Human review performed: pending.

## Verification evidence

- Unit and compatibility tests: `tests/command-runtime.test.ts`; all 201 frozen records match.
- Conformance corpus: every production command help path and deterministic unknown-option path.
- Fuzz campaign and duration: deterministic 20,000-case argument corpus completes in the focused test suite.
- Security/resource-limit tests: typed parse failures, no lower-layer `process.exit`, conflicts, choices, mandatory options, implications, hidden commands.
- Cross-platform results: Windows local pass; Linux and macOS CI pending.
- Performance comparison: focused suite completes within normal test duration; formal benchmark pending.
- Bundle/native/SBOM evidence: artifact ownership audit and paired clean-package smoke must be attached after candidate packaging.

## Open legal or provenance questions

- Patents/specification terms: counsel review pending.
- Trademarks: Commander name appears only as historical fixture provenance and development-toolchain inventory; counsel disposition pending.
- Export or distribution constraints: none identified by engineering; counsel review pending.
- Other: collect all human source-exposure disclosures and assign an independent reviewer.

## Handoff

- Implementation complete: yes
- Evidence complete: no
- Ready for independent provenance review: after cross-platform and candidate-package evidence is attached
- Author/date: Codex implementation assistant, 2026-07-12
