Documentation
¶
Overview ¶
Package ideate is the deterministic frame around abcd's idea-admission protocol (itd-104, spc-18): the three-leg gauntlet an idea may be put through before it is allowed to become a record entry.
DIVISION OF LABOUR. Ideate follows the pattern the disembark synthesis family proved. The HOST runs the judgement — primary-source research, a grill against the existing record, and an independent adversarial review — as agents. This package is the frame: it validates what those legs produced, proves every citation names a real record, and writes the durable verdict. It never fetches a source, never calls a model, and never decides whether an idea is any good.
WHY A RECORD EITHER WAY. The verdict is written whether the idea survives or dies, and it must carry the alternatives that were rejected. A killed idea with no recorded reason is an idea that gets re-proposed in six months; the research directory is where a session looks before re-proposing one. That is why an empty rejected-alternatives list is admissible only behind an explicit marker — silence by omission is exactly the failure the record exists to prevent.
NEVER A GATE. Nothing here is reachable from capture or intent-create. Ideate is an optional verb the routing help names for big, unproven ideas; skipping it is never warned about, and no other verb requires it.
Index ¶
- Constants
- Variables
- func Check(repoRoot string, raw []byte) error
- type CitationError
- type Claim
- type ClaimStatus
- type ClaimTally
- type CurrentState
- type ExistsError
- type GrillHit
- type KillAttempt
- type KillOutcome
- type Leg
- type LegKind
- type Payload
- type RecordPlan
- type RedactionResidualError
- type RejectedAlternative
- type Relation
- type Result
- type Reviewer
- type Ruling
- type Search
- type SlugError
- type Store
- type UnresolvedCitation
- type Verdict
- type Visibility
- type VisibilityError
Constants ¶
const Example = `` /* 1394-byte string literal not displayed */
Example is one verdict payload at SchemaVersion that passes Check: the worked example the input registry shows an agent (spc-2610301431075964 step 1). It lives beside the type it is an example of, so a change to the shape that the example no longer meets fails that package's own test rather than a page nobody re-reads. It cites no record and no corpus key, so it holds in any checkout.
const MaxPayloadBytes = 1 << 20 // 1 MiB
MaxPayloadBytes caps the untrusted verdict document, mirroring the synthesis and release-ingest ceilings. It is exported so a front door can bound its READ at the same ceiling the core enforces — the front-door bound is a convenience, this one is the guarantee.
const MaxSlugLen = 64
MaxSlugLen bounds the idea slug, which reaches a filename. Paired with slugRe it is the lexical half of the write-containment defence.
const ResearchRelDir = ".abcd/development/research/ideas"
ResearchRelDir is the one directory a PUBLIC verdict record is ever written under. It is a constant rather than a parameter: a configurable target would let a verdict land somewhere no future session looks. A public verdict's pointer is a decision record, written through decisions.Record into the decisions folder (spc-2610110931381316, step 3), so ideate names no log path of its own.
A public verdict lands in ResearchRelDir/<root-sha>/, beside a private one's ~/.abcd.noindex/ideas/<root-sha>/ (PrivateRel), so the two stores share one layout and a verdict moved from one to the other keeps its name. The product thinker's ruling of 2026-10-14 (iss-2610090740139804) set both paths, and the ruling of 2026-10-30 (iss-2610300838089246) made private the default: only a verdict the person says is public reaches the repository.
const SchemaVersion = 2
SchemaVersion stamps the verdict payload. It is versioned independently of every other abcd artifact, so a future breaking change to the shape is detectable rather than silently misread by a host composing against the old one.
Variables ¶
var PrivateRel = abcdhome.Rel("ideas")
PrivateRel is the private store's folder under abcd's home, in slash form relative to the person's home directory: ~/.abcd.noindex/ideas. A private verdict lands in PrivateRel/<root-sha>/, owner-only, and records no decision pointing at it, because the decisions folder is committed.
Functions ¶
func Check ¶ added in v0.16.1
Check runs the decoder and the validator Record runs on a verdict payload, and writes nothing: the schema gate, the strict decode, every leg's checks, the redaction scanner the record would be written through, and the resolution of every record a grill hit cites in repoRoot. Source keys ("source:<key>") are not resolved, because the sources corpus is the person's and not the checkout's; Record resolves them against it.
Types ¶
type CitationError ¶
type CitationError struct {
// Unresolved is the sorted, deduped set of ids that name no record.
Unresolved []string
// At is each unresolved id with the part of the verdict it was written in,
// in the order the verdict carries them.
At []UnresolvedCitation
}
CitationError is the citation gate's refusal: the verdict names a record id that does not resolve in this repository, in a grill hit or anywhere else in its legs, so it is reporting on something that is not there. It names every offending id and where each was written, because a composer handed one id at a time re-runs the whole gauntlet once per mistake.
func (*CitationError) Error ¶
func (e *CitationError) Error() string
type Claim ¶
type Claim struct {
Claim string `json:"claim"`
PrimarySource string `json:"primary_source"`
Status ClaimStatus `json:"status"`
}
Claim is one load-bearing claim and the primary source it was checked against.
The binary cannot judge whether a source is PRIMARY — that is the researching agent's obligation, stated in its prompt. What the binary enforces is that a source is named at all, for every claim including an unverifiable one: a claims table row with no source is indistinguishable from an unchecked assertion.
type ClaimStatus ¶
type ClaimStatus string
ClaimStatus is what checking a claim against its primary source established.
const ( // ClaimVerified: the primary source supports the claim, and it is not one of // the sources the idea came from. ClaimVerified ClaimStatus = "verified" // ClaimQuoted: the claim was checked against the idea's own source and // found to say what the idea says it says. That proves the quotation, not // the claim, so it is never verified. ClaimQuoted ClaimStatus = "quoted" // ClaimFalsified: the primary source contradicts it. Three of these killed an // idea in the proven manual run. ClaimFalsified ClaimStatus = "falsified" // ClaimUnverifiable: no primary source settles it either way. This is an // honest outcome, not a pass. ClaimUnverifiable ClaimStatus = "unverifiable" )
type ClaimTally ¶
type ClaimTally struct {
Verified int `json:"verified"`
Quoted int `json:"quoted"`
Falsified int `json:"falsified"`
Unverifiable int `json:"unverifiable"`
}
ClaimTally counts the research leg's outcomes, so a reader of the result knows what the claims table found without re-reading the record.
func (ClaimTally) Total ¶
func (t ClaimTally) Total() int
Total reports how many claims the research leg carried.
type CurrentState ¶ added in v0.16.1
type CurrentState string
CurrentState is the product thinker's choice of whether the adversarial leg may judge the idea against what the repository's product ships today (iss-2610310815034547). The set is CLOSED and the field is REQUIRED: the two modes ask the reviewers different questions, so a record that cannot say which one they answered cannot be read.
const ( // CurrentStateIgnore, the default the command page applies when the person // names neither: the reviewers judge the idea as an ambition for the // product the repository builds. A gap between the idea and what the // product ships today is not a kill attempt; it is what the idea implies // building. CurrentStateIgnore CurrentState = "ignore" // CurrentStateConsider: what the product ships today is in scope, and a // delivery gap may be a kill attempt. CurrentStateConsider CurrentState = "consider" )
func (CurrentState) Valid ¶ added in v0.16.1
func (c CurrentState) Valid() bool
Valid reports whether c is a registered current-state mode.
type ExistsError ¶
type ExistsError struct {
Path string
}
ExistsError is the no-overwrite refusal: a verdict record for this slug already exists under today's date. A second run is either a re-run of the same gauntlet (in which case the first record stands) or a different one (in which case it deserves its own slug); silently replacing the first would erase a recorded reason, which is the one thing this verb exists to preserve.
func (*ExistsError) Error ¶
func (e *ExistsError) Error() string
type GrillHit ¶
type GrillHit struct {
Record string `json:"record"`
Relation Relation `json:"relation"`
Note string `json:"note,omitempty"`
}
GrillHit is one existing record entry that bears on the idea. Record is a cited id and MUST resolve in the repository; Note is optional prose, and is where a reference to a brief section or a principle lives, since neither carries a per-entry id that could be cited.
type KillAttempt ¶
type KillAttempt struct {
Attempt string `json:"attempt"`
Outcome KillOutcome `json:"outcome"`
}
KillAttempt is one adversarial attempt on the idea and what it achieved.
type KillOutcome ¶
type KillOutcome string
KillOutcome is what one adversarial kill attempt achieved.
const ( // KillSurvived: the idea withstood the attempt. KillSurvived KillOutcome = "survived" // KillPartial: the attempt landed but is not on its own fatal. KillPartial KillOutcome = "partial" // KillFatal: the attempt is fatal to the idea as posed. KillFatal KillOutcome = "fatal" )
type Leg ¶
type Leg struct {
Kind LegKind `json:"kind"`
Claims []Claim `json:"claims,omitempty"`
Hits []GrillHit `json:"hits,omitempty"`
Searches []Search `json:"searches,omitempty"`
// Reviewers and Ruling are the adversarial leg's evidence. Kill attempts
// live under the reviewer that made them, never on the leg itself, so a
// record of two reviewers cannot blur into one.
Reviewers []Reviewer `json:"reviewers,omitempty"`
Ruling *Ruling `json:"ruling,omitempty"`
}
Leg is one leg of the gauntlet. It is a union over the three kinds: each kind populates exactly its own evidence field, and a leg carrying another kind's field is a refusal — a payload that smuggles grill hits into the research leg is not a leg abcd knows how to read.
type LegKind ¶
type LegKind string
LegKind identifies one leg of the gauntlet. The three values are also the REQUIRED ORDER: research grounds the idea, the grill checks it against what is already written, and only then does an evaluator who did none of that work try to kill it. Running them in any other order changes what each leg is looking at, so the order is validated rather than assumed.
const ( // LegResearch: every load-bearing claim checked against its primary source. LegResearch LegKind = "research" // LegRecordGrill: does the existing record cover, contradict, or supersede // this? Every hit is cited by record id. LegRecordGrill LegKind = "record-grill" // LegAdversarialReview: a fresh-context, off-policy evaluator that did not // conduct the research, receiving the idea as an artefact of unknown // authorship, trying to kill it. LegAdversarialReview LegKind = "adversarial-review" )
type Payload ¶
type Payload struct {
// SchemaVersion must equal SchemaVersion.
SchemaVersion int `json:"schema_version"`
// PromptVersion is the orchestrating prompt's semver (itd-5).
PromptVersion string `json:"prompt_version"`
// Idea is the idea as captured, in the words it entered the gauntlet with.
Idea string `json:"idea"`
// OriginSources are the sources the idea came from. The list is REQUIRED
// and may be empty: a claim checked only against one of these is quoted,
// not verified, and a verdict that left them out would skip that check by
// omission. An empty list says the idea has no source behind it.
OriginSources []string `json:"origin_sources"`
// CurrentState is whether the adversarial leg judged the idea against what
// the product ships today. Required; see CurrentState.
CurrentState CurrentState `json:"current_state"`
// Legs are the three legs, IN ORDER. An array rather than three named fields
// precisely so the order is a property of the document the binary can check.
Legs []Leg `json:"legs"`
// Verdict is the admission outcome.
Verdict Verdict `json:"verdict"`
// RejectedAlternatives are the options turned down on the way to the verdict.
RejectedAlternatives []RejectedAlternative `json:"rejected_alternatives"`
// NoRejectedAlternatives is the EXPLICIT empty marker. An empty list is
// admissible only with this set; omission is not, and setting it beside a
// populated list is a contradiction the document is refused for.
NoRejectedAlternatives bool `json:"no_rejected_alternatives,omitempty"`
// Reframing is the shape of the idea that survives a reframed verdict. It is
// required for that verdict and refused beside any other, so what graduates
// from a reframed idea is a field of the record, not a reading of its legs.
Reframing string `json:"reframing,omitempty"`
}
Payload is the whole untrusted host-composed verdict document.
type RecordPlan ¶ added in v0.16.1
RecordPlan is what Record would write, composed by PlanRecord and laid by Apply: the result the real run reports (its decision path excepted, whose id the decision writer mints at the write) and every write it would make.
func PlanRecord ¶ added in v0.16.1
PlanRecord does everything Record does before its first write (spc- 2610301431131636): the operands are checked, the payload decoded and validated, every citation and source key resolved, the free text redacted, and both committed artefacts composed and re-scanned. A verdict already recorded under the slug and date is refused here too, in the words the write's exclusive create refuses it in. Nothing is written.
A practice run (`--dry-run`) stops here and reports the plan; Record goes on to Apply it, so the two share every check.
func (RecordPlan) Apply ¶ added in v0.16.1
func (p RecordPlan) Apply() (Result, error)
Apply lays the planned writes. Every refusal Record makes on the input was made in PlanRecord; what remains is the write's own: the exclusive create (a run for the same slug that landed in between), and the pointer, which rolls the verdict back if it cannot be recorded, so a run never leaves half a decision behind.
type RedactionResidualError ¶ added in v0.8.0
RedactionResidualError is the stage-two refusal: the rendered record or its pointer still carries a span the redactor must not commit. It names the KINDS and nothing else — a refusal that quoted the span it refused would publish the leak into the error message, and from there into a terminal and a log.
func (*RedactionResidualError) Error ¶ added in v0.8.0
func (e *RedactionResidualError) Error() string
type RejectedAlternative ¶
type RejectedAlternative struct {
Alternative string `json:"alternative"`
WhyRejected string `json:"why_rejected"`
}
RejectedAlternative is one option considered and turned down, with the reason. Both fields are required: an alternative with no reason records that a choice existed without recording why it was not taken, which is the half of the entry that stops the re-litigation.
type Result ¶
type Result struct {
Slug string `json:"slug"`
Idea string `json:"idea"`
Verdict Verdict `json:"verdict"`
// CurrentState is the mode the adversarial leg ran under.
CurrentState CurrentState `json:"current_state"`
// Graduates reports whether this verdict admits the idea to a draft intent.
// Ideate mints nothing itself; this is the signal the surface relays.
Graduates bool `json:"graduates"`
// Reframing is a reframed verdict's reframing, as recorded: what a
// graduation carries in place of the idea. Empty for any other verdict.
Reframing string `json:"reframing,omitempty"`
// Visibility is the store the verdict was written to.
Visibility Visibility `json:"visibility"`
// Path is the verdict record: repo-relative for a public verdict, and
// ~/-relative for a private one, so no absolute home path is ever echoed.
Path string `json:"path"`
// DecisionPath is the decision record that points at a public verdict,
// repo-relative under the decisions folder; empty for a private verdict,
// which records no decision.
DecisionPath string `json:"decision_path"`
// Claims tallies the research leg.
Claims ClaimTally `json:"claims"`
// GrillHits counts the record-grill hits.
GrillHits int `json:"grill_hits"`
// CitedRecords is the sorted set of record ids the grill cited, every one of
// them proved to resolve — the citation gate's proof, so a reviewer can check
// the record without re-running the resolution.
CitedRecords []string `json:"cited_records"`
// Searches counts the record grill's searches.
Searches int `json:"searches"`
// Reviewers counts the adversarial leg's reviewers.
Reviewers int `json:"reviewers"`
// KillAttempts counts the adversarial leg's attempts, across every reviewer.
KillAttempts int `json:"kill_attempts"`
// RejectedAlternatives counts the recorded alternatives.
RejectedAlternatives int `json:"rejected_alternatives"`
// Redactions counts the secret/PII spans the store-before-commit redactor
// rewrote out of the verdict's free text on the way to the record. It is
// reported rather than kept quiet because redacting in silence is how a
// composer learns nothing about the credential it just pasted (loud-staging).
Redactions int `json:"redactions"`
}
Result is the transport-agnostic outcome of `ideate record`. It is returned only when the record was written; every refusal is an error, so a caller holding a Result knows a durable record exists.
func Record ¶
Record validates the host-composed verdict for slug and writes it.
at is the clock, passed in rather than read: the date lands in a durable filename, so it is an input a test can pin instead of a wall-clock read buried in a writer. The decision record that points at the verdict takes its date from its own minted id, as every decision does.
Every refusal returns BEFORE the first write, with one exception that is handled rather than accepted: if recording the pointer fails after the verdict landed, the verdict is removed again, so a run never leaves half a decision behind.
store names the store, private or public, and the root commit both stores are keyed on (iss-2610090740139804); it is checked beside the slug, before the payload is decoded, so a store that names neither writes nothing. A private verdict goes to planPrivate and applyPrivate and never touches the repository.
A public verdict's artefacts are COMMITTED, so both go through the store-before-commit redactor (redact.go): the verdict's free text is redacted field by field on the way into the validated document, the rendered record and the text of the decision that points at it are re-scanned before either is written, and a scanner that cannot be trusted refuses the run rather than recording under it. A private verdict takes the same gate.
type Reviewer ¶ added in v0.16.0
type Reviewer struct {
Label string `json:"label"`
KillAttempts []KillAttempt `json:"kill_attempts"`
Verdict Verdict `json:"verdict"`
Sources []string `json:"sources"`
// ImpliesBuilding is optional: the gaps between the idea and what the
// product ships today that the reviewer named as what the idea implies
// building. Under the ignore mode such a gap is never a kill attempt, and
// this is where it is kept, because it is the roadmap the exercise exists
// to find (iss-2610310815034547).
ImpliesBuilding []string `json:"implies_building,omitempty"`
}
Reviewer is one adversarial evaluator's whole contribution, kept under its own label: what it tried, what it concluded, and what it consulted.
type Ruling ¶ added in v0.16.0
type Ruling struct {
By string `json:"by"`
Verdict Verdict `json:"verdict"`
Reason string `json:"reason"`
}
Ruling settles a split between reviewers: who ruled, what they ruled, and why. It is required exactly when the reviewers' verdicts differ, because a record that shows a split and no ruling leaves a later reader to guess which reviewer the verdict followed.
type Search ¶ added in v0.16.0
type Search struct {
Terms []string `json:"terms"`
Places []string `json:"places"`
Count *int `json:"count"`
}
Search is one search the record grill ran: the terms it searched for, the places it searched, and how many entries came back. It is what lets an empty grill be told from a broken one — "searched these places for these terms and found nothing" is a finding, and a grill that cannot say so recorded nothing. Count is a pointer so an omitted count is refused rather than read as zero.
type SlugError ¶
SlugError is the refusal for an idea slug that cannot safely become a filename. It is typed because it is an OPERAND fault, not a payload fault: the fix is to re-run with a different slug, not to re-compose the verdict.
type Store ¶ added in v0.14.2
type Store struct {
Visibility Visibility
RootSHA string
Home string
// SourcesDir is the sources corpus a `source:<key>` citation is resolved
// against (internal/core/source). It is passed in rather than found, so a
// test never reads the machine's own corpus; empty, or a directory where no
// corpus exists, means there is nothing to resolve against, and a well-formed
// key is accepted on its shape alone.
SourcesDir string
}
Store names where one verdict is written. RootSHA keys both stores on the repository's root commit, so verdicts about different repositories never share a folder; Home is the person's home directory and is read only for a private verdict.
type UnresolvedCitation ¶ added in v0.16.0
UnresolvedCitation is one id that names no record, and the leg (or the other part of the verdict) it was written in.
type Verdict ¶
type Verdict string
Verdict is the admission outcome. The set is CLOSED: an unregistered verdict is a whole-document refusal, never a coercion, because the verdict is the one line of the record a later session reads first.
const ( // VerdictSurvives: the idea cleared all three legs and may graduate to a draft // intent through the existing quoted-text create. Ideate mints no intent itself. VerdictSurvives Verdict = "survives" // VerdictKilled: a leg was fatal. The record is the reason it stays dead. VerdictKilled Verdict = "killed" // VerdictReframed: the idea as posed does not survive, but a reframing of it // does; the record carries both. VerdictReframed Verdict = "reframed" )
type Visibility ¶ added in v0.14.2
type Visibility string
Visibility names the store a verdict is written to. The front door defaults it to private; Record itself still refuses a store without one, because a caller that names no store has not chosen, and the core never picks for it.
const ( // VisibilityPrivate keeps the verdict in the person's home store. VisibilityPrivate Visibility = "private" // VisibilityPublic commits the verdict to the repository's research store. VisibilityPublic Visibility = "public" )
type VisibilityError ¶ added in v0.14.2
type VisibilityError struct {
Got Visibility
}
VisibilityError is the refusal for a store that names neither private nor public (iss-2610090740139804). It is typed because it is an OPERAND fault: the fix is to name the store and re-run, never to re-compose the verdict. The record verb never reaches it, because it defaults to private.
func (*VisibilityError) Error ¶ added in v0.14.2
func (e *VisibilityError) Error() string