Skip to content

codegen emits K9 files without K9! magic line + pedigree block (fails canonical k9-validate-action) #8

@hyperpolymath

Description

@hyperpolymath

Problem

k9iser's code generator emits .k9 contracts that fail the canonical hyperpolymath/k9-validate-action:

::error::Missing K9! magic number. First non-empty line must be exactly 'K9!'
::error::Missing pedigree block. K9 files must contain a 'pedigree = { ... }' section

Example emitted file (idaptik/generated/k9iser/deno-workspace.k9):

# Auto-generated K9 contract for deno-workspace
# Safety tier: yard

[must]

[trust]
signed-by = "ci-pipeline"
...

No K9! first line; no pedigree = { ... } block.

Root cause

The codegen path (src/codegen/contract.rs) emits a TOML-section shape ([must]/[trust]/[dust]/[intend]) that diverges from the canonical K9 templates. The templates themselves are correct — .machine_readable/svc/k9/template-{yard,hunt,kennel}.k9.ncl all start with K9! and a full pedigree = { ... } block. The generator does not honour that shape.

Impact (estate-wide)

Every repo that runs k9iser and gates on Dogfood Gate's K9 step is red on the generated artifacts: idaptik, verisimiser, neurophone, vscode-a2ml, vscode-k9, aerie, accessibility-everywhere, nextgen-language-evangeliser, … (any repo with k9iser.toml).

Surfaced while triaging idaptik#77 (Dogfood Gate triage). idaptik's A2ML side is fully resolved; the K9 side is blocked solely on this generator defect.

Fix direction

src/codegen/contract.rs should emit, for each generated .k9:

  1. K9! as the first non-empty line.
  2. A pedigree = { ... } block (schema_version, component_type, security{leash,…}, metadata{name,version,…}) consistent with template-<tier>.k9.ncl.

Then regenerate across consumers.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions