Specs and Specbook
Keep intent and what the code shows as one reviewable specbook, changed by proposals that people approve
What it does
The specbook is the project's record of what the system is meant to do and what is observed to be true of it. It is made of pages, and every page holds claims: single statements with a stable key (SPEC-AUTH-003; an acceptance criterion is SPEC-AUTH-003#AC-2), an authority, and citations to their evidence. Two kinds of claim sit side by side, and the difference matters:
- Intent is what a person decided the system must do. It is the denominator of conformance and readiness.
- Observed is what the code, the typed graph or a document shows. Each observed claim cites what it was read from. It describes what exists and is never a requirement.
The Code map is something else again: layered Markdown generated from the code that describes what exists (system, container, module, file). It is evidence that an observed claim can cite. It is never intent, and nothing is "promoted" out of it.
Nothing changes intent without a person. An assistant proposes a change; a person approves it and publishes the revision. The publish is a compare-and-swap against the revision it was reviewed on, so two people never overwrite each other. A revision is immutable once published, and every edit makes a new draft that carries every untouched key forward.
strata19.get_spec_context reads claims (and the spec Markdown under the project's spec globs) and serves them with their authority, citations and links. It reports what is written, not what the code proves.
The loop
- Edit a claim, in the Specbook pane or by asking an assistant. A proposal appears: one per change, addressed by claim key, never a silent overwrite.
- A person approves the proposal and publishes the revision in the pane. Approving and publishing are the person's buttons: an assistant that calls them is refused with
REQUIRES_HUMAN. - Plan changes (
strata19.spec_manage,action: "plan_changes") names the work that follows the difference between two revisions: items that track a changed claim, and the removals that need a keep-or-remove decision. - The work is built through work items that track claim keys (
strata19.manage_work_itemwithtracksClaimKeys). - When a work item completes, the tests that ran green and are bound to its acceptance conditions are linked
verifies(a deterministic binding, tier T0) and the symbols changed in its scope are linkedimplements(tier T1, for a person to confirm). - A later change to linked code marks the claim Stale and queues a re-check. It is never marked Satisfied automatically, and a T1 link alone never counts as evidence.
The older spec-item ledger (strata19.spec_item_manage) is folded into the specbook: each item becomes a claim (an inferred one, never confirmed, on the intent page that matches its type), each code mapping becomes an implements claim link at tier T1 (or human when a person resolved it), and a mapping's status becomes the claim's evaluation status plus an implementation status: a MISSING mapping reads NotEvaluated with implementation status missing, a drifted one reads Stale. The old actions keep returning the same items, now with their claimKey, and are deprecated. The fold is reversible until the ledger tables are removed.
The published revision is also written to docs/specs/specbook/<page>.md, so the specbook is reviewable in Git. A hand edit there is read back as a proposal, not as a change.
When to use it
Call strata19.get_spec_context before implementing a feature, to check whether the requirement already exists. Use strata19.spec_workspace to browse pages, claims, proposals and revisions. Use strata19.spec_manage propose to change a requirement, and plan_changes after a revision is published. Use strata19.spec_view when the question is about the system above one function: a product, QA or security read of the same material, or the Code map.
Use strata19.spec_link to read a claim's links, and to record one only after a person has confirmed that specific code satisfies a specific claim; a link the system proposed stays at T1 until a person confirms it.
Do not call generate to author requirements: intent is proposed and approved, not generated. Do not use strata19.get_spec_context to browse the whole specbook; that is strata19.spec_workspace. Do not treat observed claims or Code map entries as accepted intent.
How to use it
Check for an existing requirement before implementing:
{ "query": "verification gate" }The response says how many claims matched and how many files were scanned, so an empty answer is explicit (totalChunksMatched: 0 against a scan count), not a silent empty list.
Look at the specbook: the current revision and its pages, then one page's claims:
{ "action": "pages" }{ "action": "page", "revisionId": "rev_…", "pageKey": "capabilities-and-features", "include": "claims" }Propose a change to one claim. Nothing changes until a person approves it:
{
"action": "propose",
"proposal": {
"op": "edit_claim",
"targetKey": "SPEC-AUTH-003",
"patch": { "text": "The system shall expire a session after 30 minutes of inactivity." },
"reason": "Security review asked for a shorter timeout."
}
}After a person has approved and published, plan the work:
{ "action": "plan_changes", "baseRevisionId": "rev_…", "headRevisionId": "rev_…" }Read the links on a claim (all seven link types, with tiers and evidence):
{ "action": "list", "claimKey": "SPEC-AUTH-003" }Recording a human-confirmed link still uses the single-link form:
{
"fromChunkId": "chunk-...",
"toRef": "src/auth/session.ts#expireSession",
"linkType": "implements",
"tier": "human",
"evidence": "Confirmed by jordan — expireSession implements the 30 minute timeout."
}This single-link form still takes the Code map chunk reference (fromChunkId, a deprecated name kept until the old chunk API is removed); everything else on spec_link is addressed by claim key.
The Specbook pane
The pane shows the specbook as pages and claims, with the Code map as its own lens labelled "Generated from code: describes what exists". Each claim card shows its requirement, acceptance criteria, authority, citations, linked code and tests with tier badges, and any open proposals. A proposal card shows the change and its diff. Approve, Reject, Confirm, Remove and Publish are buttons in the pane and the only way to do those acts: they carry proof that a person clicked. A surface that cannot verify a person renders the decision controls disabled with the reason a person must act (approve from a verified surface — the pane of a launched project, or the hosted web app): never faked, never a bare card with silently missing controls.
At session start the plugin tells the assistant, once, how many proposed changes are waiting for a person to approve.
Parameters
Prop
Type
strata19.spec_manage generate with scope ("all" or a list of page keys) generates specbook pages through your host. Without scope it is the Code map generator, which spends real model budget: budgetUsd (hard pre-estimated cap; default from STRATA19_SPECBOOK_BUDGET_USD, then $25.00), lazy (default true), focusGlobs and confirmedTokenBudget. Omit confirmedTokenBudget on the first call to get a cost estimate with no spend; call again with that estimate's totalTokens to run. code_map_generate and code_map_sync are the explicit names for the Code map operations.
What you get back
strata19.spec_workspace returns the revision and its pages, a page's blocks or claims (each claim with its links, evaluation status, tracking work items and open proposals), proposals with their decisions, a diff keyed by stable keys, or the revision history. strata19.spec_manage propose returns the pending proposal; decide and publish return the decision and the resulting revision, or a refusal that names the human step. plan_changes returns the work items affected and the decisions needed. strata19.spec_view returns the requested viewpoint's sections, each carrying its origin and code-evidence status. strata19.spec_link returns the recorded link at the tier supplied (human, T0 or T1) or a claim's links.
Limits
strata19.get_spec_context measures nothing: it reports what the specbook says, never what the code proves; use Verification or Code intelligence for that. A proposal is a draft, not accepted intent, until a person approves it and publishes the revision. An assistant cannot approve, publish, confirm or remove: those calls are refused with REQUIRES_HUMAN, whatever a call claims about who is making it. A T1 link is never evidence that a claim is satisfied. A human-edited block is never overwritten by regeneration without a proposal. Syncing the specbook with a hosted team copy needs the premium entitlement; without it every sync mode answers unavailable and nothing changes.
Related
- Library — where requirements are drafted before they become proposals
- Local data — the opt-in (
autoGenerate: true) auto-generation spend onget_spec_context - Verification — measuring whether code actually satisfies a claim
strata19.get_spec_contextstrata19.spec_workspacestrata19.spec_managestrata19.spec_viewstrata19.spec_link