Documentation
¶
Overview ¶
Package issueschema is the issue record's frontmatter schema as DATA: the property allow-list, the required set, and the closed enum value sets that issue.schema.json declares, held where every gate that asks the question can read them.
It exists for the same reason core/changelog holds the impact enum: the writer and reader of the ledger (core/capture) and the lint that GATES the committed ledger (core/lint) must agree about what a well-formed record carries, and two hand-kept copies of a schema fact drift the moment one side gains a field. It is a leaf — it imports only the standard library, no filesystem, no transport — because core/capture's own tests import core/lint, so a lint that imported capture back would be an import cycle in test.
Index ¶
- Constants
- Variables
- func DispositionFileID(name string) (string, bool)
- func DispositionStateAvailable(position, state string) (available, ruled bool)
- func LapsedAtRequired(category string) bool
- func ReadingRegime(position string) string
- func StandingDispositionIDs(records []DispositionRecord) []string
- func ValidLapsedAt(v string) bool
- type DispositionRecord
- type ReadingPosition
Constants ¶
const ( // AdmissionFamily identifies one admission (adm-N): one proposal admitted // into the candidate set, with the grounds it was admitted on. AdmissionFamily = "adm" // SurpriseFamily identifies one surprise entry (srp-N): something the // researcher did not expect, recorded as its own act. SurpriseFamily = "srp" )
The two families this design adds. Both mint through recordid.Minter.Mint like every other record family in this workstream (adr-45): a UTC stamp plus four random digits, never content-derived, so two admissions of the same proposal stay distinguishable.
const ( // AdmissionsDir holds one directory per run: admissions/<run-id>/adm-<N>.md. // An admission is bucketed by RUN, exactly as the reading store is, because it // is meaningful only against the run whose proposals it admits. AdmissionsDir = "admissions" // SurprisesDir is FLAT: surprises/srp-<N>.md. A surprise is keyed to whatever // occasioned it — a detection, an admission, a consequence — and that key is // carried in the record's own `occasioned_by`, never in the directory. Keying // the directory would tie a surprise to one occasion's family and re-open the // collapse this record exists to prevent: it is never a field on a // disposition, and it never shares a key with one. SurprisesDir = "surprises" )
The two sibling directories these families occupy under the issue ledger root. Like the reading families, they are deliberately NOT in StatusDirs: neither is an issue, and every gate scoped to the ledger's status folders must keep ignoring them.
const ( // ReadingRunFamily identifies one reading run (rdg-N): the durable run // record and its manifest under .abcd/development/readings/<run-id>/. ReadingRunFamily = "rdg" // ReadingItemFamily identifies one reading item (rdi-N) — one thing the // instrument returned. ReadingItemFamily = "rdi" // DispositionFamily identifies one disposition (dsp-N) — one answer to one // item. DispositionFamily = "dsp" )
The three record families this design adds. Each mints through recordid.Minter.Mint, which validates any lowercase family and consults no maximum (adr-45): an id is a UTC stamp plus four random digits and is never content-derived, so two runs returning the SAME tension carry different ids for free — a re-raise stays distinguishable from its first appearance, and the recurrence signal survives.
const ( // ReadingsDir holds one directory per run: readings/<run-id>/rdi-<N>.md. ReadingsDir = "readings" // DispositionsDir is keyed by the ITEM: dispositions/<item-id>/dsp-<N>.md. // Keying the directory on the item and the file on the disposition's own id // settles two requirements that pull against each other — status is one // directory probe, and a disposition still has an id of its own, so the only // exit from a `held` state (a superseding disposition that CITES the one it // replaces) has something to cite. DispositionsDir = "dispositions" )
The two sibling directories the working-tier families occupy under the issue ledger root. They are deliberately NOT in StatusDirs: a reading item's status is the presence of its keyed disposition directory, which is one probe, and never a folder-membership question. Every gate scoped to the ledger scopes to StatusDirs and therefore ignores both.
const ( // DispositionAccepted is available at every position. At the widening // position acceptance IS admission — a state encoding the position would // duplicate the envelope. DispositionAccepted = "accepted" // DispositionRejected asserts a purpose the closing run tests, so it is // never available at the widening position. DispositionRejected = "rejected" // DispositionDeclined is the widening position's only: the proposal was // admissible and the researcher chose otherwise, asserting nothing testable. // Forcing that into `rejected` would manufacture a principle never at stake. DispositionDeclined = "declined" // DispositionHeld is directional, and requires an epistemic exit condition. // A hold exits only through a superseding disposition that cites it — never // by expiry, and never silently. DispositionHeld = "held" )
The four disposition states that ship. itd-180 and ruling (19) both say FIVE states and both enumerate four; the schema is data, so a fifth is one line the day it is named, and naming it is a vocabulary judgement belonging to the researcher rather than to this build. The discrepancy is carried here, not resolved.
Nothing meaning "already covered" exists at any position: an undispositioned item is REPORTED as outstanding, never named as a state.
const CategoryLapse = "lapse"
CategoryLapse is the one category whose records must state WHEN the discipline gave way. It is spelled once here because two gates ask the question — the ledger reader (core/capture) and the committed-ledger gate (core/lint) — and a second copy would let one of them go on accepting what the other refuses.
const PositionWidening = "widening"
PositionWidening is the reading position whose items are PROPOSALS: the one position where acceptance is admission into a candidate set, and therefore the one whose answer set is wider than a disposition (spc-67). It is named because two packages now branch on it, and a position spelled as a literal in a branch is a position that can drift out of the table below without anything saying so.
const RecordReadLimit = 1 << 20
RecordReadLimit is the byte cap on ONE record of these families, and it lives here for the same reason the property allow-list does: both readers of the family must apply it, and a cap the board applies loosely while the verb applies tightly means an oversized disposition stands on the board and is refused by the verb — the ledger then says two things about one file. There were two caps, eight megabytes apart, before this was one.
A reading record and a disposition are single-screen documents. The cap is not there to bound legitimate content; it is there so a device, or a file swapped for a huge one, cannot make a read unbounded. The issue family applies the same cap for the same reason (GHSA-fh9j-8xmg-m33f): an issue record is a page, and the largest one this repository has ever carried is under one sixtieth of it.
Variables ¶
var ( // Severities is the capture-time severity enum. Severities = []string{"nitpick", "minor", "major", "critical"} // Categories is the loose issue taxonomy. Categories = []string{ "bug", "documentation", "drift", "inconsistency", "tech-debt", "security", "ux", "process", "architectural-insight", "future-work-seed", "observation", "lapse", } // Sources is the surfacing channel enum. Sources = []string{ "plan-review", "impl-review", "manual-test", "review-followup", "agent-finding", "agent-observation", "user-observation", "drift-detection", "memory-curation", } )
The closed enum value sets from issue.schema.json. capture validates a record's severity/category/source against these, and record_schema mirrors the same membership check for the committed-ledger gate (iss-2608270908342889). Held once here so the two gates cannot disagree about what a legal value is.
var AdmissionKnown = knownSet(AdmissionRequired)
AdmissionKnown is the admission's additionalProperties:false allow-list. The record has no optional half: an admission is exactly the proposal, the run and the grounds, and a key outside that set is a field nothing reads.
var AdmissionRequired = []string{"schema_version", "id", "run", "proposal", "grounds"}
AdmissionRequired is every property an admission record carries. `proposal` names the widening item admitted (an rdi-N); `run` is the run whose candidate set it joins; `grounds` is free text and non-empty, the analogue of the disposition_grounds a rejection already requires.
It is the ONE list: core/lint's adm store declares its requiredFields from this value, so the gate and the schema cannot disagree about what a well-formed admission carries.
var DispositionAvailability = map[string]map[string]bool{ "widening": { DispositionAccepted: true, DispositionRejected: false, DispositionDeclined: true, }, "entailment": { DispositionAccepted: true, DispositionRejected: true, DispositionDeclined: false, DispositionHeld: true, }, "comparative": { DispositionAccepted: true, DispositionRejected: true, DispositionDeclined: false, DispositionHeld: true, }, "detection": { DispositionAccepted: true, DispositionRejected: true, DispositionDeclined: false, DispositionHeld: true, }, }
DispositionAvailability is the per-position availability of each state: the coupling ruling (19) put on the schema, which the disposition validates against by reading `position` off the keyed reading record.
A pair the design has NOT ruled is ABSENT from the inner map, and absence is three-valued on purpose: `held` at the widening position was deferred by the facilitator on 2026-08-30 with a revisit point at the first widening run's dispositions, so that one row ships unfilled and its refusal is not armed. An unfilled pair is permitted quietly rather than refused, because refusing a combination nobody has ruled would decide the deferral by implementation.
var DispositionKnown = dispositionKnown()
DispositionKnown is the disposition's allow-list.
var DispositionRequired = []string{"schema_version", "id", "item", "state"}
DispositionRequired is what every disposition carries whatever its state. `disposition_grounds` is NOT here: it is required on every state except `held`, which is a per-state rule rather than a schema-wide one.
var DispositionStates = []string{ DispositionAccepted, DispositionRejected, DispositionDeclined, DispositionHeld, }
DispositionStates is the shipped state vocabulary.
var HoldMoscowValues = []string{"must", "should", "could", "wont"}
HoldMoscowValues is the stated (dormant) grammar of the MoSCoW axis.
var Known = map[string]bool{ "schema_version": true, "id": true, "slug": true, "severity": true, "category": true, "source": true, "found_during": true, "found_at": true, "lapsed_at": true, "details": true, "suggested_fix": true, "related_intents": true, "promoted_to": true, "related_specs": true, "related_issues": true, "synthesis_clusters": true, "wontfix_reason": true, "resolution": true, "resolved_by": true, "blocked_by": true, "shipped_in": true, "origin": true, "production_mode": true, "impact": true, "grounds": true, "created": true, "updated": true, }
Known is issue.schema.json's additionalProperties:false allow-list: every property a well-formed issue record may carry. capture's reader refuses a record with any key outside this set (skipping it, so it goes invisible to every capture surface), and record_schema reports the same key so the committed-ledger gate refuses what the reader refuses (iss-2608261447039180). It is the ONE copy both read.
var Positions = positionValues()
Positions is the position values alone, in ReadingPositions order — for a membership check and for the message that quotes the legal set.
var ReadingBodyFields = bodyFieldsByPosition()
ReadingBodyFields is the per-position required body set, derived from ReadingPositions so the table and the lookup cannot disagree.
var ReadingKnown = readingKnown()
ReadingKnown is the reading record's additionalProperties:false allow-list: the envelope, every body field of every position, and the two optional properties below. A key outside it is refused, exactly as it is on an issue.
var ReadingPositions = []ReadingPosition{ {Position: PositionWidening, Regime: "generative", Fields: []string{"configuration", "what_admits_it"}}, {Position: "entailment", Regime: "explicative", Fields: []string{"claim_surfaced", "claim_type", "what_implies_it"}}, {Position: "comparative", Regime: "evaluative", Fields: []string{"candidate_id", "criterion", "characterisation"}}, {Position: "detection", Regime: "registrative", Fields: []string{"tension", "constraint_in_play", "why_a_tension"}}, }
ReadingPositions is the closed set of positions, each with its body.
itd-180 offers a discriminated union and names a fallback; the FALLBACK is what ships. Go has no discriminated union, and this package's whole idiom is already "the schema is a value both the writer and the gate read" — four Go types would be four places for one schema to drift. So: one record type, an untyped body, and the per-position required-field set held here as data.
var ReadingRequired = []string{
"schema_version", "id", "run", "manifest", "position", "regime", "pattern",
}
ReadingRequired is the reading record's envelope: every property an item carries whatever position returned it. `pattern` is here rather than in a body for ruling (18)'s reason — it is a universal core condition.
var Required = []string{
"schema_version", "id", "slug", "severity", "category", "source", "found_during",
}
Required is every property the issue schema marks required, in the order a record writes them. A record missing one is not a lax record: the ledger reader refuses it and skips it, so it goes silently invisible to every capture surface while still sitting in the ledger — which is what record_schema reports.
var RequiredStrings = Required[1:]
RequiredStrings is Required minus schema_version — the required properties whose value is a string. schema_version carries the integer version and is checked against the readers this repository ships, so it is validated on its own before the string-typed properties are walked. It is a slice OF Required rather than a second literal, so the two can never disagree about the set.
var ReservedHoldFields = []string{"hold_frame_location", "hold_moscow"}
ReservedHoldFields are the two-axis hold field: reserved, grammar stated, and DORMANT. frame-location is free text naming the frame element; MoSCoW is one of HoldMoscowValues. Reserving costs nothing and retrofitting is expensive, so the fields are in the schema now — but a populated value is refused until activation is ruled, which makes the reservation a behaviour rather than a comment.
var ReservedSurpriseFields = []string{"occasioned_by"}
ReservedSurpriseFields are reserved and DORMANT (spc-58, out of scope: "the surprise entry, reserved here and populated in Iteration 2"). The reading's output, the researcher's disposition, and the surprise that occasions abduction are three acts and three records; this reserves the third's join key in the family now. A populated value is REFUSED until the shape is ruled, so the reservation is a behaviour rather than a comment.
var SlugRe = regexp.MustCompile(`^[a-z0-9]+(-[a-z0-9]+)*$`)
SlugRe is the kebab-case slug pattern (lower-case alphanumerics joined by single hyphens). A slug becomes a filename, so both the ledger writer and the record-lint gate hold it to exactly this shape.
var StatusDirs = []string{"open", "resolved", "wontfix"}
StatusDirs is the issue ledger's status-directory list, in the order a surface renders them. The directory a record sits in IS its status — there is no status field — so this list is simultaneously the set of folders the writer provisions, the set the readers scan, and the set the deterministic gates scope their pathspecs to. Those three had four spellings between them (lint's own list, two literals in capture's allocator, and the shell gate's pathspec), and the day a SIBLING family joined the ledger tree was the day the fourth spelling became a silent divergence: a record can only land somewhere every side agrees to look.
It lives here for the same reason the property allow-list does — the one leaf both core/capture and core/lint already read the ledger's schema from. The shell gate cannot import Go and therefore holds the second and last spelling, pinned to this value by a test.
var SurpriseKnown = knownSet(SurpriseRequired)
SurpriseKnown is the surprise entry's allow-list.
var SurpriseRequired = []string{"schema_version", "id", "occasioned_by"}
SurpriseRequired is every property a surprise entry carries. `occasioned_by` names whatever occasioned it and is the record's whole join: an rdi-N detection, an adm-N admission, or a consequence named in prose. The surprise ITSELF is the record's body, where a reader can write more than a frontmatter value holds.
Functions ¶
func DispositionFileID ¶ added in v0.7.0
DispositionFileID returns the id a ledger filename claims and whether it claims one at all. A file naming nothing (a README, a stray note) is not an answer and contributes neither presence nor a supersession edge.
func DispositionStateAvailable ¶ added in v0.7.0
DispositionStateAvailable reports whether state is available at position, and whether that pair has been RULED at all. A caller refuses only on (available=false, ruled=true): an unruled pair is the deferral above, and deciding it here would settle by implementation what the facilitator deferred.
func LapsedAtRequired ¶ added in v0.7.0
LapsedAtRequired reports whether a category obliges a lapsed_at value. The property is optional for every category and required for exactly this one: a lapse entry with no lapse time is retrospective reconstruction wearing the evidence's clothes, which is the thing the lapse log exists to detect.
func ReadingRegime ¶ added in v0.7.0
ReadingRegime is the supply regime a position implies ("registrative" for the detection position, and so on) — also the design record's name for the body that position returns, which is why a refusal quotes it: a message then names the shape the reader will look up rather than only the position that produced it. An unknown position yields "", which the caller reports as an unknown position rather than as a regime mismatch.
func StandingDispositionIDs ¶ added in v0.7.0
func StandingDispositionIDs(records []DispositionRecord) []string
StandingDispositionIDs returns the ids of the records no sibling supersedes, sorted — the answers currently in force, which is exactly one in a healthy ledger. None means the item is unanswered, which the outstanding report says out loud and no state names; more than one is a ledger fault the write path refuses, and no reader may pick a winner from it.
The superseded set is built only from WELL-FORMED records, which is the whole convergence: a record neither reader can read retires nothing, and it does not vanish either.
func ValidLapsedAt ¶ added in v0.7.0
ValidLapsedAt reports whether a non-empty lapsed_at value is well formed: an RFC 3339 instant. A bare date names a day rather than a moment and free text names nothing a reader can order, so neither can carry the claim the property makes. The offset is not constrained to Z — RFC 3339 fixes the instant either way — while the convention the record pages state is UTC.
Types ¶
type DispositionRecord ¶ added in v0.7.0
type DispositionRecord struct {
// ID is the record's id, taken from its filename.
ID string
// State is the disposition's state, or "" when the record does not carry one.
State string
// ExitCondition is what would end a held disposition.
ExitCondition string
// Supersedes is the disposition this one replaces, or "" when it replaces
// none. It is EMPTY on a record that is not well-formed, whatever the bytes
// say: a record no reader can read cannot be trusted to retire another.
Supersedes string
// WellFormed reports whether the frontmatter block is one every reader of
// this ledger can read: opened on the first line, closed, and carrying no
// duplicated top-level key. A record that is not well-formed still STANDS —
// dropping it would let a malformed file silently remove the answer it claims
// to replace — so it is the caller who is told there is something here to
// deal with.
WellFormed bool
}
DispositionRecord is one disposition as the standing computation sees it: the fields that decide what is in force, plus whether the record is well-formed enough to be trusted with them.
func ParseDisposition ¶ added in v0.7.0
func ParseDisposition(id, content string) DispositionRecord
ParseDisposition reads one disposition's frontmatter. It is deliberately its own small scanner rather than either package's: the strict ledger parser refuses more than this question needs to know, and the lenient line scanner reads past shapes that make a record untrustworthy. What both sides need is exactly this — the three deciding fields, and an honest verdict on whether the block they came from can be read at all.
type ReadingPosition ¶ added in v0.7.0
type ReadingPosition struct {
// Position is the envelope's `position` value.
Position string
// Regime is the supply regime this position implies, and the name of the
// item body it returns.
Regime string
// Fields are the body properties an item at this position must carry. The
// pattern named is NOT among them: it is an envelope field, because a
// universal core condition must not live in a variant part (ruling (18)).
Fields []string
}
ReadingPosition binds one reading position to the supply regime it implies and the body its items carry.
Two vocabularies meet here and both are load-bearing, so they are bound in one place rather than left to agree by habit: Position is the value the envelope carries (the instrument's own name for where it read from), and Regime is the supply regime that position was read under, which also names the item body it returns. Ruling (17) is what makes the pair necessary — "detection" stays the name of the Step-6 instrument and of its REGISTRATIVE body — and a table that held only one of the two names would leave the other to drift in prose.
The regime is resolvable by position ALONE, which is the property ruling (4) and ruling (18) rest on: it is stated in the reading's definition and no operator input can set it. Binding the pair here is what lets the ingest check that rather than take a caller's word for it.