Skip to content

Commit b9decb2

Browse files
fix(ci): resolve K9 contract baseline failure (Refs #87) (#113)
## Summary `container/deploy.k9.ncl` was failing `hyperpolymath/k9-validate-action` with two errors: - `Missing K9! magic number. First non-empty line must be exactly 'K9!'` — the file led with the SPDX header. - `Pedigree block missing 'name' field (in pedigree.metadata.name or pedigree.name)` — the metadata lived inside a separate `let component_pedigree = { … }` binding which the validator's line-based parser couldn't follow; only the eventual `pedigree = component_pedigree,` line was visible. ## Fix Restructured to the canonical shape (see `.machine_readable/svc/k9/boj-server-metadata.k9.ncl`): - `K9!` magic on line 1 - `pedigree = { metadata = { name, version, … }, security = { leash = 'Hunt, signature = … }, … }` inlined directly into the top-level export - `deployment` and `scripts` remain in `let`-bindings outside the pedigree block — the validator only inspects pedigree contents and the top-level export shape is unchanged ## Important: not the standards#89 sub-issue 2 mask The K9 Dogfood Gate is documented as "stays red until http-capability-gateway tier-2 production-wired" (standards#89 sub-issue 2). That's about **gateway wiring** for consumer adapters. This PR fixes a **contract-shape defect** on a single in-tree file — the file itself was not a well-formed K9 manifest. The unwired-gateway tracking remains untouched. ## Test plan - [ ] CI: Dogfood Gate / `Validate K9 contracts` green - [ ] Visual check: the other 4 K9 files (`.machine_readable/svc/k9/*.k9.ncl`) continue to pass Refs #87. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3240209 commit b9decb2

1 file changed

Lines changed: 58 additions & 56 deletions

File tree

container/deploy.k9.ncl

Lines changed: 58 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
K9!
12
# SPDX-License-Identifier: PMPL-1.0-or-later
23
# deploy.k9.ncl — Bundle of Joy Server deployment component (Hunt level)
34
#
@@ -12,61 +13,6 @@
1213
# k9-svc validate container/deploy.k9.ncl
1314
# k9-svc deploy container/deploy.k9.ncl --env production
1415

15-
# The component's pedigree (self-description across five layers)
16-
let component_pedigree = {
17-
# ─────────────────────────────────────────────────────────────
18-
# L1: The Snout — Identity
19-
# ─────────────────────────────────────────────────────────────
20-
metadata = {
21-
name = "boj-server-deploy",
22-
version = "0.1.0",
23-
breed = "application/vnd.k9+nickel",
24-
magic_number = "K9!",
25-
description = "Bundle of Joy Server deployment component (Hunt level)",
26-
},
27-
28-
# ─────────────────────────────────────────────────────────────
29-
# L2: The Scent — Target Environment
30-
# ─────────────────────────────────────────────────────────────
31-
target = {
32-
os = 'Linux,
33-
is_edge = false,
34-
requires_podman = true,
35-
min_memory_mb = 256,
36-
},
37-
38-
# ─────────────────────────────────────────────────────────────
39-
# L3: The Leash — Security
40-
# ─────────────────────────────────────────────────────────────
41-
security = {
42-
trust_level = 'Hunt,
43-
allow_network = true,
44-
allow_filesystem_write = true,
45-
allow_subprocess = true,
46-
# In production, replace with a real Ed25519 signature.
47-
signature = "PLACEHOLDER-SIGNATURE-REQUIRED-FOR-HUNT",
48-
},
49-
50-
# ─────────────────────────────────────────────────────────────
51-
# L4: The Gut — Self-Validation
52-
# ─────────────────────────────────────────────────────────────
53-
validation = {
54-
checksum = "sha256:placeholder",
55-
pedigree_version = "1.0.0",
56-
hunt_authorized = false, # Must be set true after handshake
57-
},
58-
59-
# ─────────────────────────────────────────────────────────────
60-
# L5: The Muscle — Deployment Recipes
61-
# ─────────────────────────────────────────────────────────────
62-
recipes = {
63-
install = "just container-build",
64-
validate = "just container-verify",
65-
deploy = "just container-up",
66-
migrate = "just container-build && just container-up",
67-
},
68-
} in
69-
7016
# Deployment configuration
7117
let deployment = {
7218
# Target environments (dev / staging / production)
@@ -142,8 +88,64 @@ echo "K9: Rollback complete."
14288
} in
14389

14490
# Export the component
91+
# The pedigree is inlined at the top level so the canonical
92+
# hyperpolymath/k9-validate-action regex finds
93+
# pedigree = { … metadata = { name = …, version = … } … }
94+
# directly. Previously the metadata lived in a `let component_pedigree`
95+
# binding which was opaque to the line-based validator.
14596
{
146-
pedigree = component_pedigree,
97+
pedigree = {
98+
schema_version = "1.0.0",
99+
component_type = "deployment-component",
100+
# ─────────────────────────────────────────────────────────────
101+
# L1: The Snout — Identity
102+
# ─────────────────────────────────────────────────────────────
103+
metadata = {
104+
name = "boj-server-deploy",
105+
version = "0.1.0",
106+
breed = "application/vnd.k9+nickel",
107+
magic_number = "K9!",
108+
description = "Bundle of Joy Server deployment component (Hunt level)",
109+
},
110+
# ─────────────────────────────────────────────────────────────
111+
# L2: The Scent — Target Environment
112+
# ─────────────────────────────────────────────────────────────
113+
target = {
114+
os = 'Linux,
115+
is_edge = false,
116+
requires_podman = true,
117+
min_memory_mb = 256,
118+
},
119+
# ─────────────────────────────────────────────────────────────
120+
# L3: The Leash — Security
121+
# ─────────────────────────────────────────────────────────────
122+
security = {
123+
leash = 'Hunt,
124+
trust_level = 'Hunt,
125+
allow_network = true,
126+
allow_filesystem_write = true,
127+
allow_subprocess = true,
128+
# In production, replace with a real Ed25519 signature.
129+
signature = "PLACEHOLDER-SIGNATURE-REQUIRED-FOR-HUNT",
130+
},
131+
# ─────────────────────────────────────────────────────────────
132+
# L4: The Gut — Self-Validation
133+
# ─────────────────────────────────────────────────────────────
134+
validation = {
135+
checksum = "sha256:placeholder",
136+
pedigree_version = "1.0.0",
137+
hunt_authorized = false, # Must be set true after handshake
138+
},
139+
# ─────────────────────────────────────────────────────────────
140+
# L5: The Muscle — Deployment Recipes
141+
# ─────────────────────────────────────────────────────────────
142+
recipes = {
143+
install = "just container-build",
144+
validate = "just container-verify",
145+
deploy = "just container-up",
146+
migrate = "just container-build && just container-up",
147+
},
148+
},
147149
deployment = deployment,
148150
scripts = scripts,
149151

0 commit comments

Comments
 (0)