Skip to content

Precision Checks

Precision checks measure a document against its type contract after create_document or update_document writes it. They run inside the PostToolUse hook, they report as text in front of the agent, and they never block a write. The hooks reference covers the event that carries them.

One report prints at most 5 findings, followed by a count of what the cap dropped. Findings arrive in a fixed order, so the same document produces the same head of the list on every write.

[Archcore Precision] .archcore/auth/jwt-strategy.adr.md (advisory):
- vague wording (robust) — replace with a concrete fact, version, threshold, or measurement
- missing section: ## Alternatives Considered
- one alternative recorded — a decision with nothing to compare against records a preference, not a choice
- +2 more finding(s) not shown (report cap 5)

The rules are data, not code. templates/precision.go in the CLI repository holds the lexicons, the section contracts, and the thresholds; internal/advisory/precision.go and internal/advisory/restatement.go read them. A project that installs no plugin gets the same checks, because they ship with the binary.

Every document type carries one of two profiles. The profile decides which checks may report on the type, so an adr is never measured by a step’s word cap and a guide is never graded for a modal it does not owe.

ProfileMeaningTypes
STELines instruct or obligatespec, rule, guide, task-type, brs, strs, syrs, srs
ISOLines argue or describeadr, rfc, doc, prd, plan, idea, rnd, cpat, mrd, brd, urd

Two further tables decide which numbered items a check may read at all.

TableTypes and sectionsWhat the items are
Graded clausesspec: Normative Behavior, Failure Behavior. rule: RuleRequirements graded with a BCP 14 modal
Procedure stepsguide: Steps. task-type: Steps. plan: TasksActions the reader takes

A numbered item outside these sections is prose. An adr enumerates its alternatives without owing them a modal, and the four ISO 29148 types carry their requirements as identified table rows rather than numbered clauses, so neither is graded as a clause.

FindingFires when
Vague wordingThe body uses a word or phrase from the vagueness lexicon. Headings are excluded. Up to 5 offenders are named
Missing sectionA required ## section for the type is absent. See Checked sections
Foreign sectionThe body carries a heading whose content another type owns. See Content ownership
Frontmattertitle is missing or empty, or status is missing or invalid
Placeholder bodyThe body is under 200 characters, counted in characters so a short non-ASCII document is flagged the same way
Cross-document linksThe body links other .archcore/ documents instead of using add_relation. Up to 3 are named
Long code blockA code block of 5 or more lines in a type that argues rather than instructs: adr, rfc, doc, and every vision type except rnd. A rule, a guide, and a cpat are exempt, because the literal text is the artifact
RestatementA statement survived a move from a linked document nearly word for word. See Restatement

The vagueness lexicon covers English (appropriate, robust, scalable, modern, various, optimal, efficient, flexible, convenient, seamless, streamlined), Russian stems (оптимальн, удобн, правильн, надёжн, надежн, гибк, современн, передов, эффективн, масштабируем), and the phrases best practices, as needed, world class, and cutting edge.

These read the graded clauses and the procedure steps of the type, so a type outside both tables never receives them.

FindingFires when
Requirement over 25 wordsA graded clause runs past the word cap
Step over 20 wordsA procedure step runs past the word cap
Compound requirementA graded clause carries two modals. MUST NOT counts once
Condition after the obligationA graded clause states its trigger after the response instead of opening with WHEN, WHILE, or IF
Open-ended listA clause or step ends with etc., and so on, и т.д., or и т.п.
Ambiguous alternativeA clause or step uses and/or or и/или
BCP 14 modal in a stepA procedure step carries MUST, SHOULD, SHALL, or MAY
BCP 14 modal in a claimA numbered item of an ISO-profile type carries a modal. The graded behavior belongs in a linked spec or rule

Modals are matched case-sensitively. A lowercase must in prose is not a graded obligation and is not reported.

TypeFindingFires when
specSHALL notationThe body uses SHALL instead of MUST, SHOULD, or MAY
specOversized specThe body exceeds 80 lines
specSubjectless passiveA graded clause states an obligation with no obligated component as its subject. Up to 3 are named
prdEARS clause in a requirementA numbered requirement opens with WHEN, WHILE, or IF. A prd requirement states an outcome, and the trigger and response form belongs in a spec
ruleNo file targetNo graded clause names a path or a glob, so the code-alignment injection can never match the rule to an edited file
ruleEnforcement names no verifierThe Enforcement section names no hook, lint rule, CI step, or test, and does not say manual review
adrBullets in ContextThe Context section uses a bullet list. Fenced blocks are excluded
adrOne alternative recordedAlternatives Considered holds a single item
adrAlternative with no stated reasonAn alternative does not say what ruled it out. Up to 5 are named
cpatBefore or After holds no code blockThe section describes the form that changed instead of showing it
ThresholdValue
Findings per report5
Minimum body length200 characters
Graded clause length25 words
Procedure step length20 words
spec body length80 lines
Code block length in an ISO-profile type5 lines
Restatement overlap0.85
Documents read per restatement check5

The missing-section check reads this table. It is narrower than the generated template: a template offers sections the author may fill, and this table lists the ones the type owes its reader.

A heading matches by prefix, followed by whitespace or the end of the line. ## Purpose & Scope therefore satisfies Purpose, and ## Purposeful does not.

TypeChecked sections
adrContext, Decision, Alternatives Considered, Consequences
rfcSummary, Motivation, Detailed Design, Drawbacks, Alternatives
ruleRule, Rationale, Enforcement
guidePrerequisites, Steps, Verification
specPurpose, Surface, Normative Behavior, Conformance
docOverview
prdVision, Problem, Goals, Requirements
ideaIdea, Value, Risks and Constraints
rndApproach, Findings, Recommendation, Next Action
planGoal, Tasks, Acceptance Criteria
mrdMarket Landscape, Competitive Analysis, Market Needs
brdBusiness Objectives, Stakeholders, Success Metrics and ROI
urdUser Personas, User Requirements, Acceptance Criteria
brsBusiness Purpose and Scope, Mission, Goals and Objectives, Business Constraints, Success Criteria
strsPurpose and Scope, Stakeholder Classes, Stakeholder Requirements, Operational Concept
syrsSystem Purpose and Scope, System Requirements, System Interfaces, Verification Approach
srsPurpose and Scope, Software Requirements, External Interfaces, Verification Matrix
task-typeWhen to Use, Steps
cpatWhy, Before, After, Scope

Several sections accept an older spelling so a rename does not turn existing documents into findings. Alternatives satisfies Alternatives Considered, Procedure satisfies Steps, Contract Surface satisfies Surface, Rationale satisfies a cpat’s Why, ConOps satisfies Operational Concept, and Verification satisfies both Verification Approach and Verification Matrix.

Each kind of content has one owning document type and one section inside it. A track produces several documents on one topic and links them with implements, so the boundary decides which document a statement belongs in.

Content kindOwnerSection
Wanted outcome, beneficiary, thresholdprdRequirements
Measured goal with units and a target valueprdGoals and Success Metrics
Graded behavior: EARS clauses, BCP 14 modalsspecNormative Behavior
Interfaces, signatures, states, field-driven rulesspecSurface
Error, edge, and degradation handlingspecFailure Behavior
Phases, tasks, milestones, delivery datesplanTasks
Rejected alternative and the reason it was rejectedadrAlternatives Considered

The foreign-section check names a heading whose content another type owns, and names that type:

section ## Normative Behavior in a prd — a spec owns that content; link the two documents instead

Four types carry an ownership table:

TypeHeadings it must not carryOwner
prdSurface, Normative Behavior, Failure Behavior, Conformance, Solution Overview, Technical Considerationsspec
prdTasks, Timeline, Milestones, Phases, Acceptance Criteriaplan
prdAlternatives Consideredadr
mrd, brd, urdMission, Goals and Objectivesbrs
mrd, brd, urdOperational Concept, Stakeholder Requirementsstrs
mrd, brd, urdSystem Requirements, Verification Approachsyrs
mrd, brd, urdSoftware Requirements, Verification Matrixsrs

Only unambiguous headings carry an owner. A prd names a business constraint inside its Problem Statement without owing the reader a Constraints section, so Constraints is deliberately absent and produces no finding.

The restatement check compares the written document against the documents its content flows from or into, and names a statement that survived the move nearly word for word.

  • Which documents it reads. Neighbours across implements and extends, in both directions, sorted then capped at 5. related and depends_on are excluded: an association implies no content flow, and a dependency orders two documents without moving text between them.
  • What it compares. List items only, at least 6 content-carrying words long. Prose paragraphs and fenced blocks are skipped, because a paragraph restates by summarizing and this comparison would report those at random.
  • What counts as a restatement. Token overlap at or above 0.85. A copied line scores 1.0; a prd requirement and the spec behavior that grades it score well under the threshold.
  • What it reports. At most 3 findings, one per statement however many neighbours carry it.

The check is deliberately restricted to near-verbatim copies. Two documents on one topic share vocabulary, and paraphrase detection would report exactly the pairs that are meant to differ.

If the sync manifest cannot be loaded, the check returns nothing rather than guessing. A missed finding costs a glance; a wrong one costs trust in the report.

  • Hooks covers the PostToolUse event these checks run in, alongside structure validation and the relation cascade notice.
  • Document types describes each type, its template, and the track it belongs to.
  • Document format covers frontmatter fields and file naming.