Repository navigation
Description
Category
category:hygiene
Type
type:fix
Remedy / files the remedy will touch
schema/agent_control.cue:13, schema/candy.cue:132 and :520 — use #Port (capability.cue:37); regenerate (expected no-op, @go types keep int / []int)
Cited design decision or org-rulebook rule (or none)
C4 (one canonical definition); D-PAT-2
Classification
Non-blocking — genuinely separable; left unclaimed for a later session to pick up.
Evidence (verified: commands with output, file:line, measurements)
Measured 2026-12-02 on spec origin/main at a0ee5b1 (after spec#483), in a clone of opencharly/spec:
$ grep -rn 'int & >0 & <=65535\|int & >0 & <65536' schema/*.cue
schema/00_common.cue:323: from!: int & >0 & <=65535 @go(,type=int)
schema/00_common.cue:340: port!: int & >0 & <=65535 @go(,type=int)
schema/agent_control.cue:13: port?: int & >0 & <=65535
schema/capability.cue:37:#Port: int & >0 & <65536
schema/candy.cue:132: port_relay?: [...(int & >0 & <=65535)] @go(PortRelay,type=[]int)
schema/candy.cue:520: port: int & >0 & <=65535 @go(,type=int)
#Port (capability.cue:37) is the one definition of a TCP port; five other sites restate its range inline. #484 reuses #Port for the three in the D-PUB block of 00_common.cue (#PublicationRecord.port, #PortRange.from/to); the remaining three (agent_control.cue:13, candy.cue:132, candy.cue:520) are in other lanes' files. Equivalence for the D-PUB three was proven on the real evaluator (same verdicts at 0/1/65535/65536 on old and new schema, #484).
Mechanism
the port range is written out at each field instead of referring to the one #Port definition, so a change to what a port is would have to be made in six places.
Missed control
no gate looks for a restated definition body; design-dpat's dup rule keys on definition NAMES, not on inline copies of a definition's constraint.
Blast radius
three fields in two schema files; behaviour is identical today, the risk is drift.
Root fix
replace each inline range with #Port (#Port & ... where a field adds a bound), regenerate, and prove the verdicts unchanged on the evaluator at 0/1/65535/65536 as #484 did.
Spike (its result, or none with the reason)
none: non-blocking; the same mechanism is proven on the three D-PUB sites in #484
Agent: rulebook-first-principles · Claude Code session 1e71081b-b9b8-4d2a-87e3-756a4c2518ed
Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system)
Activity
fix(schema): #PublicationRecord.port and #PortRange reuse #Port
fix(schema): derive #PublicationRecord.mode from a vocabulary; #Publi…