Development record
disembark-reads-a-repo-s-naming-and-internals-conventions-in
Summary
spc-13 delivers itd-96: two conventions-tier Source adapters that ground
constraints/naming and internals on the files a team naturally writes — a
NAMING.md or naming page under docs/ for naming, an ARCHITECTURE.md or
architecture/explanation tree plus the package layout for internals. A
repository with conventional docs but no .abcd/ record now carries both
sections in its lifeboat instead of two blanks. glossary is untouched:
convGlossarySource already owns it, and this spec adds no second adapter for
it.
Scope
- Adapters (
internal/core/lifeboat/sources_conventions.go):convNamingSource(constraints/naming) andconvInternalsSource(internals), bothTierConventions, both siblings ofconvGlossarySource. - Registration (
conventionSources()inprobe.go): one line each. With spc-12'sconvOpenQuestionsSourcethis brings the conventions tier to fourteen adapters. - Tier gate (
hasConventionsinprobe.go): the new adapters' own name lists are appended to the candidate union, per the comment that already forbids narrowing the gate below what the adapters read — otherwise a repo carrying only aNAMING.mdorARCHITECTURE.mdwould have the whole Tier-1 set skipped and blank falsely. - Depends on spc-12 for
(*SourceContext).WalkFiles, whichconvInternalsSourceuses for its layout scan. spc-13 stacks on spc-12; it does not re-land the primitive. - No mapping change, no new dependency.
Approach
convNamingSource — constraints/naming
Preference order, first match wins:
- A dedicated naming document —
ctx.FindFirst("NAMING.md", "NAMING", "naming.md"), then the firstdocs/entry whose lower-cased name starts withnaming(the sameListDir-prefix idiomconvGlossarySourceuses fordocs/glossary*). Cited alone,ConfidenceMedium. - Fallback: the glossary document. A project that never wrote a naming
registry usually encodes its reserved vocabulary in its glossary, so the
glossary is real evidence for naming — but weaker, because a glossary
defines terms rather than ruling on what may be renamed. Cited as
"<path> (glossary fallback — no dedicated naming document)",ConfidenceLow. - Neither → a blank naming both search sets in
Searchedand asking the human question.
Status is StatusPartial in both non-blank cases — the ceiling the mapping
row predicts for this section, and the honest one: neither a naming page nor a
glossary enumerates a project's full reserved vocabulary. The strength of the
signal is carried by Confidence (medium for a dedicated document, low for the
glossary fallback), not by inflating the status.
Distinctness from glossary is structural, not incidental. The two
adapters declare different Section() values, so the orchestrator indexes them
into different coverage rows and neither can displace the other. On a
glossary-only repository the report shows glossary partial/medium cited to
GLOSSARY.md, and constraints/naming partial/low cited to the same file
with the fallback qualifier — visibly a weaker, derived reading rather than a
duplicate row. A test asserts the two rows differ in confidence and in cited
string on that fixture.
convInternalsSource — internals
Two independent signals, combined:
- Architecture prose.
ctx.FindFirst("ARCHITECTURE.md", "ARCHITECTURE", "architecture.md", "docs/architecture.md"), then the directoriesdocs/architecture,docs/design,docs/explanation(Diátaxis), in that preference order. A file is read and measured with the existingconvProseBytes/convGroundedProseBytesthreshold — the same measureconvContextSourceuses for a README, reused rather than re-invented. A directory counts as prose evidence when it holds at least one Markdown file. - Package layout.
WalkFilesfrom., keeping the top-two path segments of every file under a recognised source root (internal,pkg,src,lib,cmd,app) — the packages a rescuer must navigate. Cited as"<root>/<pkg>/"entries, capped atmaxLayoutCitations(50) with the overflow reported as a count.WalkFiles'struncatedflag, when set, is reported in the citation so a capped scan never reads as a complete one.
Outcomes:
| Signals present | Status | Confidence |
|---|---|---|
| Architecture prose above the threshold (± layout) | StatusPartial |
ConfidenceHigh |
| Architecture doc present but thin, or a doc directory with no prose measured | StatusPartial |
ConfidenceMedium |
| Layout only, no architecture doc | StatusPartial |
ConfidenceLow |
| Neither | StatusBlank with Searched + Question |
— |
As with naming, StatusPartial is the ceiling: an ARCHITECTURE.md plus a
package listing describes the shape of a system, not its internals chapters.
This matches the mapping row's conventions prediction, which stays unedited.
Resolved open questions (itd-96 § Open Questions)
| Question | Decision |
|---|---|
| Naming vs glossary — what is naming's distinct source? | A dedicated naming document (NAMING.md, docs/naming*) is naming's primary source; the glossary is an explicitly-qualified fallback at lower confidence. The two sections are distinct rows with distinct evidence strings; no second glossary adapter is added. |
Which paths map to internals? |
ARCHITECTURE.md (and spellings) → docs/architecture.md → docs/architecture/ → docs/design/ → docs/explanation/, in that preference order, plus the package layout as an independent second signal. |
| What counts as "package layout", and the missing primitive? | Top-two path segments under internal, pkg, src, lib, cmd, app, gathered with spc-12's WalkFiles. A bounded recursive walk is needed (a top-level ListDir cannot see internal/core/lifeboat), and it is the shared primitive both intents asked for — landed once, in spc-12. |
| Extraction heuristics and status thresholds | The existing convProseBytes ≥ convGroundedProseBytes threshold separates real architecture prose from a stub. Status ceilings at StatusPartial for both sections (the mapping contract's conventions prediction); the distinction lives in Confidence. |
| Confidence levels | Naming: medium (dedicated doc) / low (glossary fallback). Internals: high (real prose) / medium (thin doc) / low (layout only). |
| Reserved-vocabulary spellings | NAMING.md, NAMING, naming.md, and any docs/ entry whose name starts with naming (case-insensitive). Heading-shape sniffing inside a glossary is not attempted — it would guess at a convention that has no standard. |
Acceptance-criteria satisfaction
- Naming docs → non-blank, cites the file — a fixture with
NAMING.mdassertsconstraints/namingpartial,TierConventions, citingNAMING.md. - ARCHITECTURE.md + layout → non-blank, cites both — a fixture with
ARCHITECTURE.mdand aninternal/<pkg>/tree assertsinternalsnon-blank citing the doc and the layout entries. - Neither → honest blanks — a bare fixture asserts both sections blank with
populated
Searchedand a non-emptyQuestion. - Read-only — the byte-for-byte tree-invariance test from spc-12 covers the whole probe, both new adapters included.
- No duplicate
glossaryadapter — a glossary-only fixture assertsglossaryis still grounded byconvGlossarySource, thatconstraints/namingis partial with the fallback qualifier and lower confidence, and thatconventionSources()contains exactly one adapter whoseSection()isglossary. - Both tiers present → one deterministic result — the unchanged
beats/tierRankreduction; the native adapters keep winning where a record exists, and the report names the winning tier.
Frontmatter
| id | spc-13 |
|---|---|
| type | spec |
| lifecycle | closed |
.abcd/development/specs/closed/spc-13-disembark-reads-a-repo-s-naming-and.md
open on GitHub ↗ · commit history ↗
References1
- itd-96Disembark Reads A Repo's Naming And Internals Conventions Into Its Lifeboatimplements