Task 16 Execution Packet: Replace Handwritten gen.py via SDS-021 (Aligned to 2026-01-25 Plan)

Use this as the exact execution guide for an agent implementing Task 16.


Objective

Replace handwritten tools/codegen/gen.py with SDS-021-generated code so that codegen tooling is fully spec-owned and deterministic.


Non-negotiables


Step 0 — Ground the current code reality (must confirm before editing)

Verify:

If any of these differ, update this packet before coding.


Step 1 — Update SDS-021 to own gen.py

Modify the SDS-021 spec to include tools/codegen/gen.py as a generated artifact.

Requirements:


Step 2 — Update generator templates to emit gen.py

Update the generator/templates that produce codegen tooling so tools/codegen/gen.py is emitted from SDS-021.

Requirements:


Step 3 — Regenerate and verify

Run the spec pipeline to regenerate outputs:

1
just pipeline shared

(If the repo uses a different target for SDS-021, use that instead.)


Step 4 — Tests

Add or update tests to prove gen.py is spec-generated and deterministic.

Required test file:

Minimum assertions:

Run:

1
pytest tools/tests/test_codegen_determinism.py -v

Only mark Task 16 complete after tests pass.


Acceptance criteria (from plan)


“If you hit this, do this” diagnostics