@flancer32/skill-adsm-ctx 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to this package are documented in this file.
4
4
 
5
+ ## 0.4.0 - 2026-09-23
6
+
7
+ ### Added
8
+
9
+ - Added optional, capability-based Verification Layer support, with specifications grouped by the primary product, architecture, environment, or code target.
10
+ - Added validation for verification block structure, populated categories, metadata capabilities, and adoption without a declared capability; older and unadopted contexts remain valid.
11
+ - Added guidance for verification evidence, re-verification, Responsible Context, and the Software Evolution Loop across the bundled skill and project context.
12
+
13
+ ### Changed
14
+
15
+ - Kept the four ordered declarative documentation levels and defined `verification/` as an optional cross-cutting block rather than another authority level.
16
+ - Raised the context metadata baseline to `0.2.0` and updated initialization templates to advertise `verification-layer` without creating empty scaffolding.
17
+ - Updated design, validation, upgrade, audit, and documentation guidance to preserve existing contexts and require explicit, durable verification specifications before adoption.
18
+ - Reconciled product and architecture documents, semantic skins, README, and tests around the boundary between declarative context and operational evidence.
19
+ - Clarified that the package does not execute tests, collect monitoring data, persist feedback state, or coordinate distributed incidents; refreshed the dependency lockfile.
20
+
5
21
  ## 0.3.0 - 2026-08-14
6
22
 
7
23
  ### Changed
package/README.md CHANGED
@@ -14,7 +14,8 @@ The package includes:
14
14
 
15
15
  - the `adsm-ctx` CLI for lifecycle operations;
16
16
  - the `adsm-ctx` skill payload for AI agents;
17
- - reusable `ctx/` templates for bootstrapping ADSM-compatible projects.
17
+ - reusable `ctx/` templates for bootstrapping ADSM-compatible projects;
18
+ - optional Verification Layer documentation lifecycle support;
18
19
  - working templates for agent-produced reports.
19
20
 
20
21
  ## Purpose
@@ -26,7 +27,8 @@ Use this package when you need to:
26
27
  - validate whether an existing context follows expected ADSM structure;
27
28
  - audit a documentation corpus against ADSM documentation quality criteria;
28
29
  - compress a documentation corpus while preserving accepted project meaning;
29
- - upgrade a context when ADSM conventions evolve.
30
+ - upgrade a context when ADSM conventions evolve;
31
+ - design, validate, audit, or compress an optional cross-cutting Verification Layer.
30
32
 
31
33
  This package acts as an orchestration layer. It provides generic structure, lifecycle guidance, validation, documentation quality audit guidance, documentation compression guidance, and upgrade entry points. When project-specific context is required, it should direct the agent to use specialized skills when they are available.
32
34
 
@@ -144,7 +146,7 @@ teq --host @flancer32/skill-adsm-ctx adsm-ctx:validate .
144
146
 
145
147
  ### `init`
146
148
 
147
- Creates the minimal ADSM-compatible context structure, starter documents, and `ctx/adsm.json` metadata.
149
+ Creates the minimal ADSM-compatible context structure, starter documents, and `ctx/adsm.json` metadata. The metadata advertises the `verification-layer` convention capability, but initialization does not create `ctx/docs/verification/` or empty categories.
148
150
 
149
151
  ### `design`
150
152
 
@@ -152,7 +154,7 @@ Provides guidance for classifying the project, choosing relevant documentation b
152
154
 
153
155
  ### `validate`
154
156
 
155
- Checks baseline paths, required documentation levels, required `AGENTS.md` files, metadata, body/skin pairing, localized skin names, local markdown document links, and structural projection checks. When the repository provides a deterministic validator, run it and report errors and warnings separately. Validation reports findings without modifying project content.
157
+ Checks baseline paths, required declarative documentation levels, optional Verification Layer structure when adopted, required `AGENTS.md` files, metadata, body/skin pairing, localized skin names, redundant `Agent Document` sections in skins, local markdown document links, and other formal structural projection checks. It does not score semantic-skin length, cognitive load, or human readability; those belong to `quality-audit`. Validation reports findings without modifying project content.
156
158
 
157
159
  ### `quality-audit`
158
160
 
@@ -168,7 +170,7 @@ The default compression corpus is `ctx/docs/`. Operational context such as `ctx/
168
170
 
169
171
  ### `upgrade`
170
172
 
171
- Reads context metadata and reports or applies non-destructive migrations when available. The initial implementation provides the migration mechanism and reports when no migrations apply.
173
+ Checks whether context metadata exists and reports that no automatic migrations are available. Verification Layer adoption remains optional and non-destructive: upgrade does not create verification scaffolding. The command remains the entry point for future explicit migrations.
172
174
 
173
175
  ## Workflow
174
176
 
@@ -195,6 +197,8 @@ product
195
197
 
196
198
  Use the architecture level once product meaning is clear enough to define stable engineering guardrails.
197
199
 
200
+ `ctx/docs/verification/` is optional and cross-cutting. It is not a fifth declarative level. Create it only when a durable verification specification exists; place that specification below the category of the declaration it primarily evaluates.
201
+
198
202
  The bundled architecture templates expect these top-level documents:
199
203
 
200
204
  - `overview.md`
@@ -258,7 +262,7 @@ npm test
258
262
 
259
263
  ## Changelog
260
264
 
261
- See [CHANGELOG.md](CHANGELOG.md) for the prepared, unpublished 0.3.0 release notes.
265
+ See [CHANGELOG.md](CHANGELOG.md) for the prepared, unpublished 0.4.0 release notes.
262
266
 
263
267
  ## Status
264
268
 
@@ -1,9 +1,13 @@
1
1
  # Migrations
2
2
 
3
- This directory is reserved for future context migrations.
3
+ This directory is reserved for explicit context migrations. The `verification-layer` convention is capability-based and optional: it does not require a migration, `ctx/docs/verification/`, empty categories, or placeholder specifications. `adsm-ctx upgrade` therefore preserves existing contexts and reports that no automatic migrations are available.
4
4
 
5
5
  Each migration should be:
6
6
 
7
7
  - versioned;
8
8
  - non-destructive by default;
9
9
  - explicit about prerequisites and post-upgrade manual steps.
10
+
11
+ ## Verification Layer Compatibility
12
+
13
+ Contexts without `capabilities`, with context version `0.1.0`, or without `ctx/docs/verification/` remain valid. A project may add a structurally complete Verification Layer when it has a durable specification; it should then advertise the `verification-layer` capability in `ctx/adsm.json`. Malformed adopted structure is a validation error, while absence is not.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flancer32/skill-adsm-ctx",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Build and evolve project cognitive context for Agent-Driven Software Management (ADSM).",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
package/skill/SKILL.md CHANGED
@@ -22,6 +22,7 @@ Humans own direction, accepted meaning, approval, and accountability. Agents ref
22
22
  | --- | --- |
23
23
  | `init` baseline | [context-lifecycle.md](references/context-lifecycle.md); use the `templates/ctx/` baseline. |
24
24
  | `design` or new branch | [context-lifecycle.md](references/context-lifecycle.md), [design-questionnaire.md](references/design-questionnaire.md), and [specialized-skills.md](references/specialized-skills.md). |
25
+ | Verification Layer or Software Evolution Loop | [document-projections.md](references/document-projections.md), [context-lifecycle.md](references/context-lifecycle.md), [documentation-quality-audit.md](references/documentation-quality-audit.md), and [specialized-skills.md](references/specialized-skills.md). |
25
26
  | `validate` structure | [context-lifecycle.md](references/context-lifecycle.md), [document-projections.md](references/document-projections.md), and the repository-provided deterministic validator when available. Report errors and warnings separately. |
26
27
  | `quality-audit` | Run `validate` first; then load [documentation-quality-audit.md](references/documentation-quality-audit.md). Report findings; do not rewrite project meaning. |
27
28
  | `documentation-compression` | Load [documentation-compression.md](references/documentation-compression.md). Rewrite only with authorization and preserve accepted meaning. |
@@ -39,9 +40,9 @@ Humans own direction, accepted meaning, approval, and accountability. Agents ref
39
40
  - Read a matching `*.skin.<lang>.md` before editing its agent document. Report projection drift or a required human decision instead of silently changing skin-controlled meaning.
40
41
  - Keep `ctx/agent/` project-local: install only its boundary `AGENTS.md`; do not impose tool-specific structure, labels, prompts, roles, or executable profiles.
41
42
  - Keep assets under `ctx/assets/**`; they may illustrate, but never define, authoritative meaning.
42
- - Use only the four ADSM top-level documentation levels under `ctx/docs/`; allow justified nested project structure within them.
43
+ - Preserve the four ordered declarative documentation levels under `ctx/docs/`: `product`, `architecture`, `environment`, and `code`. Allow an optional cross-cutting `verification/` block only as defined in [document-projections.md](references/document-projections.md); it is never a fifth level.
43
44
  - Keep each documentation level to no more than nine direct directories and nine direct ordinary files, excluding `AGENTS.md` and paired `*.skin.<lang>.md` files, where practical; an intentional excess must be stated explicitly in that level's `AGENTS.md`.
44
45
 
45
46
  ## Completion
46
47
 
47
- Finish with explicit validation results, specialization gaps, human decisions, and any preserved project-specific content. Use the relevant templates under `templates/ctx/` for initialization and `templates/work/` only when a working report is requested.
48
+ Finish with explicit validation results, Verification Layer adoption state when relevant, specialization gaps, human decisions, and any preserved project-specific content. Use the relevant templates under `templates/ctx/` for initialization and `templates/work/` only when a working report is requested.
@@ -1,7 +1,7 @@
1
1
  # Context Lifecycle
2
2
 
3
3
  - Path: `skill/references/context-lifecycle.md`
4
- - Changed: `20260814`
4
+ - Changed: `20260917`
5
5
 
6
6
  `adsm-ctx` manages six lifecycle modes for project cognitive context.
7
7
 
@@ -13,10 +13,10 @@ The skill manages generic lifecycle structure. It does not define a project's bu
13
13
 
14
14
  - `init` creates the baseline. Create the root `AGENTS.md`, `ctx/` baseline, starter documents, and `ctx/adsm.json` only where they are missing. Use `templates/ctx/`; create placeholders rather than project facts when context is unknown.
15
15
  - `design` shapes context for the actual project. Classify the project, choose justified generic branches and nested structure, decide whether semantic skins are needed, and route specializations. Use [design-questionnaire.md](design-questionnaire.md) and [specialized-skills.md](specialized-skills.md).
16
- - `validate` checks structural integrity without destructive edits. Check baseline paths, context metadata, the four top-level documentation levels, local `AGENTS.md` placement, document headers, agent/skin pairs, reversible skin naming, compactness, local document links, and `ctx/assets/**` exclusion.
16
+ - `validate` checks formal structural integrity without destructive edits. Check baseline paths, context metadata, the four declarative documentation levels, optional Verification Layer adoption, local `AGENTS.md` placement, document headers, agent/skin pairs, reversible skin naming, redundant `Agent Document` sections, local document links, and `ctx/assets/**` exclusion. Do not score semantic compactness, cognitive load, or word counts.
17
17
  - `quality-audit` guides semantic documentation review. It is report-only by default; use [documentation-quality-audit.md](documentation-quality-audit.md) after validation.
18
18
  - `documentation-compression` guides controlled documentation rewrite that preserves accepted meaning. Use [documentation-compression.md](documentation-compression.md); do not treat it as an automatic semantic rewrite.
19
- - `upgrade` migrates context non-destructively. Read metadata first, preserve project-specific content, and use [upgrade-policy.md](upgrade-policy.md) for safe boundaries.
19
+ - `upgrade` is the non-destructive migration entry point. The current implementation checks for metadata and reports that no automatic migrations are available; preserve project-specific content and use [upgrade-policy.md](upgrade-policy.md) when explicit migrations exist.
20
20
 
21
21
  The lifecycle is iterative. A project may return to `design`, `validate`, `quality-audit`, `documentation-compression`, and `upgrade` many times after initialization.
22
22
 
@@ -30,18 +30,26 @@ It is not a context lifecycle mode.
30
30
 
31
31
  All lifecycle modes that operate on `ctx/docs/` use the documentation projection model in [document-projections.md](document-projections.md).
32
32
 
33
- The lifecycle must preserve ADSM's four top-level documentation levels under `ctx/docs/` while allowing project-specific nested subdirectories inside those levels.
33
+ The lifecycle must preserve ADSM's four ordered declarative documentation levels under `ctx/docs/` while allowing project-specific nested subdirectories inside them and an optional cross-cutting Verification Layer as defined in [document-projections.md](document-projections.md).
34
34
 
35
35
  Validation, audit, compression, and upgrade work must recognize agent documents, semantic skins, agent/skin pairs, orphan skins, projection drift, and `ctx/assets/**` as non-authoritative artifact space.
36
36
 
37
37
  When a repository provides a deterministic validation command, validation work must discover and run it. Report errors and warnings separately; warning-only output is not a clean result. Clear structural errors before a quality audit.
38
38
 
39
+ ## Verification Layer And Software Evolution
40
+
41
+ Verification defines the relation between an accepted declaration and a bounded observation of reality. A signal may arise from an active check, passive runtime observation, or an external report. It becomes an observation only after enough context identifies what was observed, against which applicable expectation, and in what relevant state.
42
+
43
+ An observation supports an assessment such as conformity, deviation, ambiguity, contradiction, or insufficient evidence. A deviation is not a cause. Localization hypotheses remain revisable until targeted evidence supports them. A Responsible Context advances the loop within its authority; resolution feedback alone does not close it. Where closure is required, obtain a new applicable re-verification of the relevant original expectation.
44
+
45
+ The Software Evolution Loop is broader than Verification. Architecture defines boundaries and ownership; supervision defines acceptable uncertainty and required independence; project-local workflow owns routing and operational feedback state; specialized skills provide concrete verification, monitoring, transport, or distributed feedback procedures. `adsm-ctx` provides methodology and documentation lifecycle support, not a runtime coordination system.
46
+
39
47
  ## Shared Boundaries
40
48
 
41
49
  - Establish product meaning before architecture, then architecture before environment or code constraints. Lower levels refine but do not create upstream meaning.
42
50
  - Keep `ctx/docs/filesystem.md` limited to root-level repository navigation. Describe lower structure only in the appropriate local `AGENTS.md` files.
43
51
  - Preserve project-local materials under `ctx/agent/`; this skill defines only its boundary `AGENTS.md` and never invents tool instructions, workflows, labels, events, prompts, profiles, or agent roles.
44
- - Use only `product/`, `architecture/`, `environment/`, and `code/` as ADSM top-level documentation levels. Nested structure within them remains project-specific.
52
+ - Use only `product/`, `architecture/`, `environment/`, and `code/` as ordered ADSM declarative levels. `verification/` may be an optional cross-cutting documentation block, never a fifth level; nested structure remains project-specific.
45
53
  - Keep each documentation level within nine direct directories and nine direct ordinary files, excluding `AGENTS.md` and paired `*.skin.<lang>.md` files, where practical. When a level deliberately exceeds either value, its local `AGENTS.md` must explicitly record a `Documentation Capacity Exception` and the reason.
46
54
  - Place visual, generated, rendered, and auxiliary artifacts under `ctx/assets/**`; they cannot introduce authoritative project meaning.
47
55
  - Read a matching semantic skin before changing its agent document. Report projection drift or a required human decision when a change would alter skin-controlled meaning.
@@ -1,7 +1,7 @@
1
1
  # Design Questionnaire
2
2
 
3
3
  - Path: `skill/references/design-questionnaire.md`
4
- - Changed: `20260610`
4
+ - Changed: `20260917`
5
5
 
6
6
  Use this questionnaire at the start of `design` mode to classify the project and decide which specialized ADSM skills may be relevant.
7
7
 
@@ -42,3 +42,15 @@ Use this questionnaire at the start of `design` mode to classify the project and
42
42
  - If the project includes a browser-based web application, look for a browser documentation skill such as `skill-adsm-doc-web-browser`.
43
43
  - If the project includes other specialized areas, choose the matching skill when available.
44
44
  - If a relevant specialized skill is unavailable, still create the justified ADSM structure, preserve any project-defined semantics, and record the missing specialization as a gap instead of inventing unsupported details.
45
+
46
+ ## Verification Questions
47
+
48
+ 11. Which declared outcomes, boundaries, conditions, or code properties have high practical consequence if wrong?
49
+ 12. Which broad observations provide useful early detection, and which blind spots need narrower diagnostics?
50
+ 13. Which signals may arrive actively, passively, or from external reporters, and what provenance is available?
51
+ 14. Which observations can the current agent perform directly, and which require another Responsible Context, human action, or specialized tooling?
52
+ 15. Does supervision require independent evidence or an independent actor for any concern?
53
+
54
+ ## Verification Design Guidance
55
+
56
+ Do not create `ctx/docs/verification/` merely because these questions were asked. When a durable specification is justified, place it under the category of its primary declaration target, link secondary targets instead of duplicating it, and route concrete test execution, monitoring, signal transport, or distributed feedback work to a specialized skill or project-local design.
@@ -1,7 +1,7 @@
1
1
  # Documentation Projections
2
2
 
3
3
  - Path: `skill/references/document-projections.md`
4
- - Changed: `20260814`
4
+ - Changed: `20260917`
5
5
 
6
6
  Use this reference whenever an agent initializes, designs, validates, audits, compresses, or upgrades ADSM documentation under `ctx/docs/`.
7
7
 
@@ -102,9 +102,9 @@ Validation should report structural drift such as orphan skins.
102
102
 
103
103
  Audit, compression, and upgrade work should report semantic drift when it can be evidenced from the documents.
104
104
 
105
- ## Documentation Levels And Substructure
105
+ ## Documentation Levels And Verification Layer
106
106
 
107
- ADSM defines only four top-level documentation levels under `ctx/docs/`:
107
+ ADSM defines exactly four ordered declarative documentation levels under `ctx/docs/`:
108
108
 
109
109
  ```text
110
110
  ctx/docs/product/
@@ -113,32 +113,47 @@ ctx/docs/environment/
113
113
  ctx/docs/code/
114
114
  ```
115
115
 
116
- Their meanings:
116
+ Their meanings remain:
117
117
 
118
- - `product` — product meaning;
119
- - `architecture` — engineering structure;
120
- - `environment` — runtime and deployment context;
121
- - `code` — implementation mapping.
118
+ - `product` — accepted product meaning;
119
+ - `architecture` — accepted engineering structure;
120
+ - `environment` — accepted runtime and deployment conditions;
121
+ - `code` — accepted implementation and engineering constraints.
122
122
 
123
- ADSM may provide baseline templates and recommendations, but it must not impose a rigid internal subtree inside those levels.
123
+ `ctx/docs/verification/` is an optional cross-cutting documentation block. It relates declarations to observations of reality, but is not a fifth refinement level and does not change declaration authority.
124
124
 
125
- Project-specific nested subdirectories are allowed and should be used when they improve maintainability.
125
+ Create the block only when the project has a durable verification specification. Its root requires `AGENTS.md`; direct categories are optional `product/`, `architecture/`, `environment/`, and `code/`. Create a category only when a durable specification exists beneath it. Do not initialize empty categories or placeholder specifications.
126
+
127
+ A verification specification has one canonical home selected by its **primary verification target**: the declaration or bounded declaration group whose truth it chiefly evaluates. It may link to secondary declarations, executable tests, monitors, environments, dependencies, and other contexts. Mechanism, test framework, source path, CI job, endpoint, reporting context, and current Responsible Context do not determine placement.
128
+
129
+ A specification should state, when relevant:
130
+
131
+ - the primary target and traceability to its declaration;
132
+ - the expected observable corridor;
133
+ - approach and acquisition mode;
134
+ - applicability and prerequisites;
135
+ - bounded interpretation, reach, and blind spots;
136
+ - lifecycle role and follow-up, including re-verification when required; and
137
+ - available access or authority for obtaining the observation.
138
+
139
+ A verification specification is durable documentation. An evidence record records an actual observation and its provenance. Operational Feedback State retains unresolved routing or continuation state. Do not confuse either operational object with a declaration or durable verification specification.
140
+
141
+ Project-specific nesting by risk area, product area, subsystem, use case, integration, or operational surface is allowed inside a primary-target category. It must preserve one canonical specification.
126
142
 
127
143
  Valid examples:
128
144
 
129
145
  ```text
130
146
  ctx/docs/product/domain/ingress.md
131
- ctx/docs/product/domain/memory.md
132
147
  ctx/docs/architecture/runtime/agent-execution.md
133
148
  ctx/docs/environment/deployment/vps.md
134
149
  ctx/docs/code/modules/orchestrator.md
150
+ ctx/docs/verification/product/authentication.md
151
+ ctx/docs/verification/architecture/boundaries/adapter-isolation.md
135
152
  ```
136
153
 
137
- Flat files remain allowed when suitable.
138
-
139
- Do not require flat prefixed names such as `domain-ingress.md` when nested directories are clearer.
154
+ Flat files remain allowed when suitable. Do not require flat prefixed names when nested directories are clearer.
140
155
 
141
- Each of the four documentation levels should contain no more than nine direct subdirectories and no more than nine direct ordinary files. The service-control file `AGENTS.md` and all matching `*.skin.<lang>.md` files are excluded, so an agent document and all of its skins count as one document group. This is a maintainability recommendation, not a reason to collapse meaningful structure.
156
+ Each of the four declarative levels should contain no more than nine direct subdirectories and nine direct ordinary files. The service-control file `AGENTS.md` and all matching `*.skin.<lang>.md` files are excluded, so an agent document and all of its skins count as one document group. This is a maintainability recommendation, not a reason to collapse meaningful structure.
142
157
 
143
158
  When a level deliberately exceeds either value, its own `AGENTS.md` must include a `## Documentation Capacity Exception` section that explicitly records the intentional exception and its reason. Deterministic validation warns about the exceeded recommendation and reports an error when this explicit local declaration is absent.
144
159
 
@@ -187,7 +202,7 @@ Do not use `AGENTS.md` as a replacement for agent documents or skins.
187
202
 
188
203
  Documentation quality audit should:
189
204
 
190
- - recursively include ordinary `*.md` agent documents under the four top-level documentation levels;
205
+ - recursively include ordinary `*.md` agent documents under the four declarative levels and under an adopted `verification/` block;
191
206
  - classify `*.skin.<lang>.md` files as human-facing semantic skins;
192
207
  - detect agent/skin document groups by same basename and directory;
193
208
  - report orphan skins;
@@ -202,6 +217,8 @@ Deterministic validation should:
202
217
  - require every `*.skin.<lang>.md` file to have a paired non-skin `*.md` document and an explicit valid language marker;
203
218
  - require an explicit valid language marker, reversible paired-base resolution, and no redundant `Agent Document` section;
204
219
  - verify local markdown document links under `ctx/docs/**`;
220
+ - accept absence of `ctx/docs/verification/`, but when it is present require its `AGENTS.md`, recognized primary-target category directories, and at least one durable specification in every created category;
221
+ - keep verification category placement and evidence sufficiency as semantic audit work rather than claiming them from directory shape;
205
222
  - warn when a documentation level contains more than nine direct directories or more than nine direct ordinary files (excluding `AGENTS.md` and paired `*.skin.<lang>.md` files), and require an explicit `Documentation Capacity Exception` in that level's `AGENTS.md`;
206
223
  - keep ordinary agent-document shape checks minimal instead of imposing a rigid body template.
207
224
 
@@ -230,3 +247,4 @@ Upgrades should:
230
247
  - report orphan skins and agent/skin conflicts;
231
248
  - avoid introducing required `README.md` files inside `ctx/docs/`;
232
249
  - keep assets under `ctx/assets/**`.
250
+ - preserve primary verification target, applicability, reach, blind spots, and the distinction between specification and evidence when verification documentation is in scope.
@@ -1,7 +1,7 @@
1
1
  # Documentation Compression
2
2
 
3
3
  - Path: `skill/references/documentation-compression.md`
4
- - Changed: `20260708`
4
+ - Changed: `20260917`
5
5
 
6
6
  Use this reference when an agent must compress an existing ADSM cognitive documentation corpus while preserving accepted project meaning.
7
7
 
@@ -34,7 +34,7 @@ Follow this method:
34
34
 
35
35
  The default corpus is `ctx/docs/`.
36
36
 
37
- Documentation compression is intended for declarative project documentation: product, architecture, environment, code, and other project documentation levels under `ctx/docs/`.
37
+ Documentation compression is intended for declarative project documentation under the four ADSM levels: product, architecture, environment, and code, plus an adopted optional Verification Layer when it is in scope.
38
38
 
39
39
  Do not include operational context outside `ctx/docs/` by default, including `ctx/agent/`, generated reports, prompt assets, workflow configuration, runtime materials, `ctx/assets/**`, or other agent-operation artifacts.
40
40
 
@@ -77,6 +77,7 @@ Safe compression may:
77
77
  Safe compression preserves:
78
78
 
79
79
  - product intent and scope;
80
+ - verification primary targets, applicable bounds, blind spots, and the distinction between durable specification, actual evidence, and operational feedback state;
80
81
  - domain terms and relationships;
81
82
  - role and authority boundaries;
82
83
  - architecture boundaries and decisions;
@@ -1,7 +1,7 @@
1
1
  # Documentation Quality Audit
2
2
 
3
3
  - Path: `skill/references/documentation-quality-audit.md`
4
- - Changed: `20260814`
4
+ - Changed: `20260917`
5
5
 
6
6
  Use this reference when an agent must audit an existing documentation corpus as an ADSM cognitive context.
7
7
 
@@ -205,3 +205,18 @@ The audit must not:
205
205
  - mark a corpus incomplete merely because it does not document out-of-scope concerns.
206
206
 
207
207
  The audit may propose correction order and candidate edits, but it must distinguish proposals from accepted project knowledge.
208
+
209
+ ## Verification Layer Review
210
+
211
+ When `ctx/docs/verification/` exists, include it in the default corpus. Review it as cross-cutting specification documentation, not a fifth declarative level and not an evidence or incident archive.
212
+
213
+ Check whether each durable specification:
214
+
215
+ - names a primary verification target and links to the authoritative declaration;
216
+ - states an observable expectation and applicable state or prerequisites;
217
+ - distinguishes observation method from the declaration being evaluated;
218
+ - identifies reach, blind spots, and limits on the conclusion;
219
+ - avoids duplicated specifications for the same expectation; and
220
+ - distinguishes detection, localization, resolution feedback, and re-verification.
221
+
222
+ Report a human decision when supervision, acceptable uncertainty, required independence, Responsible Context routing, evidence retention, or operational feedback-state ownership is missing. Do not infer these policies from test framework, directory name, issue tracker, or a passing result.
@@ -1,7 +1,7 @@
1
1
  # Orchestration Model
2
2
 
3
3
  - Path: `skill/references/orchestration-model.md`
4
- - Changed: `20260715`
4
+ - Changed: `20260917`
5
5
 
6
6
  This skill is a router and baseline manager.
7
7
 
@@ -12,9 +12,10 @@ It is responsible for:
12
12
  - lifecycle guidance;
13
13
  - baseline validation;
14
14
  - migration entry points;
15
+ - Verification Layer documentation lifecycle support and structural validation;
15
16
  - the reserved boundary definition for `ctx/agent/`.
16
17
 
17
- It is not responsible for inventing specialized technical or domain documentation.
18
+ It is not responsible for inventing specialized technical or domain documentation, executing verification, receiving signals, persisting evidence or Operational Feedback State, or coordinating distributed feedback loops.
18
19
 
19
20
  For `ctx/agent/`, this skill may:
20
21
 
@@ -32,7 +33,7 @@ When specialization is needed, the agent should use a matching available skill a
32
33
 
33
34
  Concrete tool-facing materials belong to project-local documentation, explicit human instruction, or an external specialized skill when one is available and relevant.
34
35
 
35
- Specialized skills may add project-specific nested documentation under the four top-level `ctx/docs` levels, but they must preserve agent/skin pairing rules and keep artifacts under `ctx/assets/**`.
36
+ Specialized skills may add project-specific nested documentation under the four declarative `ctx/docs` levels and may implement concrete verification methods or project-local feedback procedures. They must preserve agent/skin pairing rules, keep artifacts under `ctx/assets/**`, and treat `verification/` as optional cross-cutting documentation rather than a fifth level.
36
37
 
37
38
  ## Template Boundary
38
39
 
@@ -1,7 +1,7 @@
1
1
  # Specialized Skills
2
2
 
3
3
  - Path: `skill/references/specialized-skills.md`
4
- - Changed: `20260708`
4
+ - Changed: `20260917`
5
5
 
6
6
  Use specialized skills when the project context requires knowledge that should not live in this generic lifecycle skill.
7
7
 
@@ -11,6 +11,8 @@ Examples of specialization signals:
11
11
  - backend application architecture;
12
12
  - data or persistence modeling;
13
13
  - deployment and runtime environment design;
14
+ - browser, backend, data, security, monitoring, or other concrete verification methods;
15
+ - signal transport, external-report handling, or distributed feedback procedures;
14
16
  - tool-specific agent instructions or workflow design for a concrete execution engine or host platform.
15
17
 
16
18
  Tool-specific specialization signals include:
@@ -27,5 +29,6 @@ Specialized skills must preserve ADSM's documentation projection model:
27
29
 
28
30
  - ordinary `*.md` files under `ctx/docs/**` are agent-facing operational context documents;
29
31
  - `*.skin.<lang>.md` files are human-facing semantic skins for matching agent documents;
30
- - nested subdirectories inside the four top-level documentation levels are allowed;
32
+ - nested subdirectories inside the four declarative documentation levels are allowed;
33
+ - an adopted `ctx/docs/verification/` block remains cross-cutting; specifications use a primary declaration target rather than the mechanism or specialized skill that obtains evidence;
31
34
  - visual, generated, rendered, and auxiliary artifacts belong under `ctx/assets/**`.
@@ -1,19 +1,29 @@
1
1
  # Upgrade Policy
2
2
 
3
3
  - Path: `skill/references/upgrade-policy.md`
4
- - Changed: `20260708`
4
+ - Changed: `20260917`
5
5
 
6
6
  Upgrades must be non-destructive by default.
7
7
 
8
+ ## Verification Layer Compatibility
9
+
10
+ The `verification-layer` context convention capability is optional. Existing contexts without `capabilities`, with context version `0.1.0`, or without `ctx/docs/verification/` remain valid.
11
+
12
+ Safe adoption may add `"verification-layer"` to `ctx/adsm.json` and add a structurally complete verification block only when the project has a real durable specification. It must not create `verification/`, empty categories, placeholder specifications, or copied specifications merely because an upgrade ran.
13
+
14
+ Partial adoption is valid. Structural validation distinguishes absence from malformed adoption. An adopted block requires its root `AGENTS.md`; each created primary-target category must be a directory containing a durable specification. Unknown or unsupported categories and malformed capability metadata are validation findings.
15
+
16
+ ## General Upgrade Boundaries
17
+
8
18
  Safe upgrade behavior includes:
9
19
 
10
- - adding missing files and directories;
11
- - updating metadata when the migration rules are explicit;
12
- - preserving project-authored content unless replacement is proven safe.
20
+ - adding missing files and directories only when migration rules explicitly require them;
21
+ - updating metadata when rules are explicit;
22
+ - preserving project-authored content unless replacement is proven safe;
13
23
  - detecting agent/skin pairs, orphan skins, and projection drift according to `skill/references/document-projections.md`;
14
- - preserving project-specific nested subdirectories under `ctx/docs/product/`, `ctx/docs/architecture/`, `ctx/docs/environment/`, and `ctx/docs/code/`;
24
+ - preserving project-specific nested subdirectories and adopted verification specifications;
15
25
  - keeping visual, generated, rendered, and auxiliary artifacts under `ctx/assets/**`.
16
26
 
17
27
  Unsafe cases should be reported for manual follow-up instead of applied automatically.
18
28
 
19
- Upgrade must not introduce required `README.md` files inside `ctx/docs/` and must not automatically rewrite human-controlled skins when agent/skin meaning is unclear.
29
+ Upgrade must not introduce required `README.md` files inside `ctx/docs/`, automatically rewrite human-controlled skins when meaning is unclear, or claim that adoption provides verification coverage or runtime conformity.
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "schema": "adsm-context",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
+ "capabilities": [
5
+ "verification-layer"
6
+ ],
4
7
  "notes": [
5
8
  "Initial context created from the canonical adsm-ctx template set."
6
9
  ]
@@ -21,6 +21,7 @@ The installed template should describe the project, not restate detailed ADSM me
21
21
  - `code/` — code-level constraints and testing guidance.
22
22
  - `environment/` — runtime and infrastructure assumptions.
23
23
  - `product/` — product meaning, roles, and use cases.
24
+ - `verification/` — optional cross-cutting verification specifications; create it only with a real durable specification.
24
25
  - `AGENTS.md` — entry note for `ctx/docs/`.
25
26
  - `ai-intro.md` — compact agent orientation for the concrete project.
26
27
  - `filesystem.md` — top-level repository map.
@@ -31,6 +32,7 @@ Defines:
31
32
 
32
33
  - The declarative documentation boundary for the project.
33
34
  - The documentation dependency chain from product to code.
35
+ - The optional Verification Layer as a cross-cutting relation, never a fifth declarative level.
34
36
  - The local entry points used to orient agents within `ctx/docs/`.
35
37
 
36
38
  Does NOT define:
@@ -50,6 +52,7 @@ Does NOT define:
50
52
  - Read a matching skin before changing an agent document.
51
53
  - Report a human decision if a requested agent-document change would violate the matching skin.
52
54
  - Keep project-specific nested subdirectories inside `product/`, `architecture/`, `environment/`, and `code/` when they improve maintainability.
55
+ - Create `verification/` only when it contains a durable specification. Its root requires `AGENTS.md`; create primary-target categories only on demand.
53
56
  - Keep each documentation level to no more than nine direct directories and nine direct ordinary files, excluding `AGENTS.md` and paired `*.skin.<lang>.md` files, where practical.
54
57
  - When a level deliberately exceeds either value, add a `## Documentation Capacity Exception` section to that level's `AGENTS.md` that states the exception and its reason.
55
58
  - Put visual, generated, rendered, or auxiliary artifacts under `ctx/assets/**`.
@@ -11,3 +11,7 @@ Describe the test boundary for the project.
11
11
  ## Test Structure
12
12
 
13
13
  List the main test layers, directories, and intended verification scope.
14
+
15
+ ## Verification Target Boundary
16
+
17
+ Keep executable test organization, framework conventions, fixtures, and isolation in this code-level document. When a project adopts `ctx/docs/verification/`, its durable specification states the observed declared expectation and primary target; the executable mechanism remains governed here.
@@ -23,13 +23,15 @@ export default class Service {
23
23
  "",
24
24
  "Recommended agent workflow:",
25
25
  "1. Identify the project class from existing repository signals or user input.",
26
- "2. Keep ADSM's four top-level documentation levels under ctx/docs/: product, architecture, environment, and code.",
27
- "3. Add only project-specific substructure that is justified by the project; nested directories are allowed.",
28
- "4. Treat ordinary *.md files as agent-facing operational context documents and add *.skin.<lang>.md files only where human semantic control is needed.",
29
- "5. Place visual, generated, rendered, or auxiliary artifacts under ctx/assets/ instead of ctx/docs/.",
30
- "6. Detect whether specialized ADSM skills are needed for browser, backend, data, deployment, or other areas.",
31
- "7. If a specialized skill is available, use it for that branch after the generic structure is in place.",
32
- "8. If no specialized skill is available, record the specialization gap and avoid inventing details.",
26
+ "2. Keep ADSM's four ordered declarative documentation levels under ctx/docs/: product, architecture, environment, and code.",
27
+ "3. Add ctx/docs/verification/ only when a durable verification specification is justified; it is cross-cutting, not a fifth level.",
28
+ "4. Place each verification specification under the category of its primary declaration target and link secondary targets instead of duplicating it.",
29
+ "5. Add only project-specific substructure that is justified by the project; nested directories are allowed.",
30
+ "6. Treat ordinary *.md files as agent-facing operational context documents and add *.skin.<lang>.md files only where human semantic control is needed.",
31
+ "7. Place visual, generated, rendered, or auxiliary artifacts under ctx/assets/ instead of ctx/docs/.",
32
+ "8. Detect whether specialized ADSM skills are needed for browser, backend, data, deployment, verification execution, monitoring, or other areas.",
33
+ "9. If a specialized skill is available, use it for that branch after the generic structure is in place.",
34
+ "10. If no specialized skill is available, record the specialization gap and avoid inventing details.",
33
35
  ].join("\n");
34
36
  };
35
37
  }
@@ -8,7 +8,11 @@
8
8
  export default class Constants {
9
9
  constructor() {
10
10
  this.CONTEXT_SCHEMA = "adsm-context";
11
- this.CONTEXT_VERSION = "0.1.0";
11
+ this.CONTEXT_VERSION = "0.2.0";
12
+ this.VERIFICATION_CAPABILITY = "verification-layer";
13
+ this.CONTEXT_CAPABILITIES = Object.freeze([this.VERIFICATION_CAPABILITY]);
14
+ this.VERIFICATION_BLOCK = "verification";
15
+ this.VERIFICATION_TARGETS = Object.freeze(["product", "architecture", "environment", "code"]);
12
16
  this.DOC_LEVEL_MAX_DIRECTORIES = 9;
13
17
  this.DOC_LEVEL_MAX_FILES = 9;
14
18
  this.REQUIRED_PATHS = Object.freeze([
@@ -20,6 +20,7 @@ export default class Metadata {
20
20
  return {
21
21
  schema: constants.CONTEXT_SCHEMA,
22
22
  version: constants.CONTEXT_VERSION,
23
+ capabilities: [...(constants.CONTEXT_CAPABILITIES ?? [])],
23
24
  };
24
25
  };
25
26
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * @namespace Fl32_Skill_Adsm_Ctx_Upgrade_Service
5
- * @description Provides the baseline non-destructive upgrade entry point for ADSM context lifecycle.
5
+ * @description Provides the baseline non-destructive upgrade entry point without automatic migrations.
6
6
  */
7
7
 
8
8
  export default class Service {
@@ -13,7 +13,7 @@ export default class Service {
13
13
  */
14
14
  constructor({fs, pathService}) {
15
15
  /**
16
- * Runs the upgrade entry point.
16
+ * Checks for context metadata and reports the current migration availability.
17
17
  *
18
18
  * @param {object} params
19
19
  * @param {string} params.targetPath
@@ -31,7 +31,7 @@ export default class Service {
31
31
  }
32
32
 
33
33
  return {
34
- message: "No migrations are currently available for this context.",
34
+ message: "No automatic migrations are available. Verification Layer adoption is optional and must not create empty scaffolding.",
35
35
  ok: true,
36
36
  };
37
37
  };
@@ -31,7 +31,7 @@ export default class Validate {
31
31
  * ruleId: string,
32
32
  * severity: "error" | "warning"
33
33
  * }[],
34
- * metadata: {schema: string, version: string, initializedAt?: string} | null,
34
+ * metadata: {capabilities?: string[], schema: string, version: string, initializedAt?: string} | null,
35
35
  * missingPaths: string[],
36
36
  * ok: boolean,
37
37
  * projectRoot: string,
@@ -40,7 +40,8 @@ export default class Validate {
40
40
  * bodies: string[],
41
41
  * orphanSkins: string[],
42
42
  * pairs: {body: string, skin: string}[],
43
- * skins: string[]
43
+ * skins: string[],
44
+ * verification: {categories: string[], present: boolean}
44
45
  * },
45
46
  * warningCount: number
46
47
  * }>}
@@ -54,10 +55,16 @@ export default class Validate {
54
55
  ruleId: "required-path",
55
56
  severity: "error",
56
57
  }));
57
- const metadata = readMetadata({constants, fs, pathService, projectRoot});
58
- const projection = inspectProjection({constants, fs, pathService, projectRoot});
58
+ const metadataResult = readMetadata({constants, fs, pathService, projectRoot});
59
+ const projection = inspectProjection({
60
+ constants,
61
+ fs,
62
+ metadata: metadataResult.metadata,
63
+ pathService,
64
+ projectRoot,
65
+ });
59
66
 
60
- if (!metadata.ok) findings.push(metadata.finding);
67
+ findings.push(...metadataResult.findings);
61
68
  findings.push(...projection.findings);
62
69
 
63
70
  const errorCount = findings.filter((entry) => entry.severity === "error").length;
@@ -66,7 +73,7 @@ export default class Validate {
66
73
  return {
67
74
  errorCount,
68
75
  findings,
69
- metadata: metadata.ok ? metadata.metadata : null,
76
+ metadata: metadataResult.ok ? metadataResult.metadata : null,
70
77
  missingPaths,
71
78
  ok: errorCount === 0,
72
79
  projectRoot,
@@ -180,54 +187,80 @@ function parseSkinFilename(file) {
180
187
  * }}
181
188
  */
182
189
  function readMetadata({constants, fs, pathService, projectRoot}) {
190
+ const findings = [];
183
191
  const metadataPath = pathService.join(projectRoot, "ctx", "adsm.json");
184
192
  if (!fs.existsSync(metadataPath)) {
185
- return {
186
- ok: false,
187
- finding: createFinding({
188
- message: "Missing ctx/adsm.json",
189
- path: "ctx/adsm.json",
190
- ruleId: "metadata-file",
191
- severity: "error",
192
- }),
193
- };
193
+ findings.push(createFinding({
194
+ message: "Missing ctx/adsm.json",
195
+ path: "ctx/adsm.json",
196
+ ruleId: "metadata-file",
197
+ severity: "error",
198
+ }));
199
+ return {findings, metadata: null, ok: false};
194
200
  }
195
201
 
196
202
  try {
197
203
  const parsed = JSON.parse(fs.readFileSync(metadataPath, "utf8"));
198
204
  if (parsed.schema !== constants.CONTEXT_SCHEMA) {
199
- return {
200
- ok: false,
201
- finding: createFinding({
202
- message: `Unexpected schema: ${parsed.schema}`,
203
- path: "ctx/adsm.json",
204
- ruleId: "metadata-schema",
205
- severity: "error",
206
- }),
207
- };
205
+ findings.push(createFinding({
206
+ message: `Unexpected schema: ${parsed.schema}`,
207
+ path: "ctx/adsm.json",
208
+ ruleId: "metadata-schema",
209
+ severity: "error",
210
+ }));
208
211
  }
209
212
  if (!parsed.version) {
210
- return {
211
- ok: false,
212
- finding: createFinding({
213
- message: "Missing metadata version",
213
+ findings.push(createFinding({
214
+ message: "Missing metadata version",
215
+ path: "ctx/adsm.json",
216
+ ruleId: "metadata-version",
217
+ severity: "error",
218
+ }));
219
+ }
220
+
221
+ if (Object.hasOwn(parsed, "capabilities")) {
222
+ if (!Array.isArray(parsed.capabilities)) {
223
+ findings.push(createFinding({
224
+ message: "Metadata capabilities must be an array of unique strings",
214
225
  path: "ctx/adsm.json",
215
- ruleId: "metadata-version",
226
+ ruleId: "metadata-capabilities",
216
227
  severity: "error",
217
- }),
218
- };
228
+ }));
229
+ } else {
230
+ const seen = new Set();
231
+ for (const capability of parsed.capabilities) {
232
+ if (typeof capability !== "string" || capability.length === 0 || seen.has(capability)) {
233
+ findings.push(createFinding({
234
+ message: "Metadata capabilities must be an array of unique non-empty strings",
235
+ path: "ctx/adsm.json",
236
+ ruleId: "metadata-capabilities",
237
+ severity: "error",
238
+ }));
239
+ break;
240
+ }
241
+ seen.add(capability);
242
+ if (!(constants.CONTEXT_CAPABILITIES ?? []).includes(capability)) {
243
+ findings.push(createFinding({
244
+ message: `Unknown context capability: ${capability}`,
245
+ path: "ctx/adsm.json",
246
+ ruleId: "metadata-capability-unknown",
247
+ severity: "warning",
248
+ }));
249
+ }
250
+ }
251
+ }
219
252
  }
220
- return {ok: true, metadata: parsed};
253
+
254
+ const ok = findings.every((entry) => entry.severity !== "error");
255
+ return {findings, metadata: ok ? parsed : null, ok};
221
256
  } catch (error) {
222
- return {
223
- ok: false,
224
- finding: createFinding({
225
- message: `Invalid metadata JSON: ${error instanceof Error ? error.message : "Unknown error"}`,
226
- path: "ctx/adsm.json",
227
- ruleId: "metadata-json",
228
- severity: "error",
229
- }),
230
- };
257
+ findings.push(createFinding({
258
+ message: `Invalid metadata JSON: ${error instanceof Error ? error.message : "Unknown error"}`,
259
+ path: "ctx/adsm.json",
260
+ ruleId: "metadata-json",
261
+ severity: "error",
262
+ }));
263
+ return {findings, metadata: null, ok: false};
231
264
  }
232
265
  }
233
266
 
@@ -253,7 +286,7 @@ function readMetadata({constants, fs, pathService, projectRoot}) {
253
286
  * }
254
287
  * }}
255
288
  */
256
- function inspectProjection({constants, fs, pathService, projectRoot}) {
289
+ function inspectProjection({constants, fs, metadata, pathService, projectRoot}) {
257
290
  const docsRoot = pathService.join(projectRoot, "ctx", "docs");
258
291
  const assetsRoot = pathService.join(projectRoot, "ctx", "assets");
259
292
  const findings = [];
@@ -303,6 +336,26 @@ function inspectProjection({constants, fs, pathService, projectRoot}) {
303
336
  pathService,
304
337
  projectRoot,
305
338
  }));
339
+ const verification = inspectVerificationBlock({
340
+ constants,
341
+ docsEntryMap,
342
+ fs,
343
+ pathService,
344
+ projectRoot,
345
+ });
346
+ findings.push(...verification.findings);
347
+ if (
348
+ verification.summary.present
349
+ && metadata
350
+ && !metadata.capabilities?.includes(constants.VERIFICATION_CAPABILITY)
351
+ ) {
352
+ findings.push(createFinding({
353
+ message: `Verification block is present without declared ${constants.VERIFICATION_CAPABILITY} capability`,
354
+ path: "ctx/adsm.json",
355
+ ruleId: "verification-capability-undocumented",
356
+ severity: "warning",
357
+ }));
358
+ }
306
359
 
307
360
  const markdownFiles = [];
308
361
  for (const file of listFiles({fs, pathService, root: docsRoot, prefix: "ctx/docs"})) {
@@ -365,10 +418,129 @@ function inspectProjection({constants, fs, pathService, projectRoot}) {
365
418
  orphanSkins,
366
419
  pairs,
367
420
  skins,
421
+ verification: verification.summary,
368
422
  },
369
423
  };
370
424
  }
371
425
 
426
+ /**
427
+ * Inspects optional Verification Layer adoption without treating it as a fifth
428
+ * declarative documentation level.
429
+ *
430
+ * @param {object} params
431
+ * @param {Fl32_Skill_Adsm_Ctx_Shared_Constants} params.constants
432
+ * @param {Map<string, {name: string, isDirectory: () => boolean, isFile: () => boolean}>} params.docsEntryMap
433
+ * @param {typeof import("node:fs")} params.fs
434
+ * @param {Fl32_Skill_Adsm_Ctx_Shared_Path} params.pathService
435
+ * @param {string} params.projectRoot
436
+ * @returns {{
437
+ * findings: {message: string, path: string, ruleId: string, severity: "error" | "warning"}[],
438
+ * summary: {categories: string[], present: boolean}
439
+ * }}
440
+ */
441
+ function inspectVerificationBlock({constants, docsEntryMap, fs, pathService, projectRoot}) {
442
+ const findings = [];
443
+ const summary = {categories: [], present: false};
444
+ const entry = docsEntryMap.get(constants.VERIFICATION_BLOCK);
445
+ if (!entry) return {findings, summary};
446
+
447
+ summary.present = true;
448
+ const verificationPath = `ctx/docs/${constants.VERIFICATION_BLOCK}`;
449
+ if (!entry.isDirectory()) {
450
+ findings.push(createFinding({
451
+ message: `Verification block is not a directory: ${verificationPath}`,
452
+ path: verificationPath,
453
+ ruleId: "verification-block",
454
+ severity: "error",
455
+ }));
456
+ return {findings, summary};
457
+ }
458
+
459
+ let entries = [];
460
+ try {
461
+ entries = listEntries({
462
+ fs,
463
+ root: pathService.join(projectRoot, ...verificationPath.split("/")),
464
+ });
465
+ } catch (error) {
466
+ findings.push(createFinding({
467
+ message: `Unreadable verification block (${error instanceof Error ? error.message : "Unknown error"})`,
468
+ path: verificationPath,
469
+ ruleId: "verification-block-readable",
470
+ severity: "error",
471
+ }));
472
+ return {findings, summary};
473
+ }
474
+
475
+ const agentsEntry = entries.find((candidate) => candidate.name === "AGENTS.md");
476
+ if (!agentsEntry?.isFile()) {
477
+ findings.push(createFinding({
478
+ message: `Verification block requires ${verificationPath}/AGENTS.md`,
479
+ path: `${verificationPath}/AGENTS.md`,
480
+ ruleId: "verification-agents",
481
+ severity: "error",
482
+ }));
483
+ }
484
+
485
+ const targets = constants.VERIFICATION_TARGETS ?? constants.DOC_LEVELS;
486
+ for (const child of entries) {
487
+ if (child.name === "AGENTS.md") continue;
488
+ if (!targets.includes(child.name)) {
489
+ if (child.isDirectory()) {
490
+ findings.push(createFinding({
491
+ message: `Unsupported verification category: ${child.name}`,
492
+ path: `${verificationPath}/${child.name}`,
493
+ ruleId: "verification-category",
494
+ severity: "error",
495
+ }));
496
+ }
497
+ continue;
498
+ }
499
+
500
+ if (!child.isDirectory()) {
501
+ findings.push(createFinding({
502
+ message: `Verification category is not a directory: ${child.name}`,
503
+ path: `${verificationPath}/${child.name}`,
504
+ ruleId: "verification-category",
505
+ severity: "error",
506
+ }));
507
+ continue;
508
+ }
509
+
510
+ summary.categories.push(child.name);
511
+ const categoryPath = `${verificationPath}/${child.name}`;
512
+ const documents = listFiles({
513
+ fs,
514
+ pathService,
515
+ prefix: categoryPath,
516
+ root: pathService.join(projectRoot, ...categoryPath.split("/")),
517
+ }).filter((file) => (
518
+ file.endsWith(".md")
519
+ && !file.endsWith("/AGENTS.md")
520
+ && !parseSkinFilename(file)
521
+ ));
522
+ if (documents.length === 0) {
523
+ findings.push(createFinding({
524
+ message: `Verification category has no durable specification: ${categoryPath}`,
525
+ path: categoryPath,
526
+ ruleId: "verification-empty-category",
527
+ severity: "error",
528
+ }));
529
+ }
530
+ }
531
+
532
+ if (summary.categories.length === 0) {
533
+ findings.push(createFinding({
534
+ message: `Verification block has no populated primary-target category: ${verificationPath}`,
535
+ path: verificationPath,
536
+ ruleId: "verification-empty-block",
537
+ severity: "error",
538
+ }));
539
+ }
540
+
541
+ return {findings, summary};
542
+ }
543
+
372
544
  /**
373
545
  * Warns when a documentation level exceeds the recommended direct-entry capacity
374
546
  * and requires its local AGENTS.md to make an intentional exception explicit.
@@ -578,6 +750,14 @@ function validateSkinDocument({bodySet, constants, file, skinInfo, text}) {
578
750
  severity: "error",
579
751
  }));
580
752
  }
753
+ if (/^#{1,6}\s+Agent Document\s*#*\s*$/mi.test(text)) {
754
+ findings.push(createFinding({
755
+ message: "Redundant Agent Document section: skin pairing is derived from its filename",
756
+ path: file,
757
+ ruleId: "skin-redundant-agent-document-section",
758
+ severity: "error",
759
+ }));
760
+ }
581
761
  return findings;
582
762
  }
583
763
 
@@ -650,64 +830,6 @@ function normalizeRelativeSegments(parts) {
650
830
  return result;
651
831
  }
652
832
 
653
- /**
654
- * @param {string} text
655
- * @returns {string}
656
- */
657
- function stripFencedCodeBlocks(text) {
658
- return text.replace(/```[\s\S]*?```/g, "");
659
- }
660
-
661
- /**
662
- * Extracts all human-facing skin content while excluding metadata and headings.
663
- *
664
- * @param {string} text
665
- * @returns {string}
666
- */
667
- function extractSkinMetricText(text) {
668
- return stripSkinPresentation(text);
669
- }
670
-
671
- /**
672
- * @param {string} text
673
- * @returns {string}
674
- */
675
- function stripSkinPresentation(text) {
676
- let insideLegacyReference = false;
677
- return stripFencedCodeBlocks(text)
678
- .split("\n")
679
- .filter((line) => {
680
- const trimmed = line.trim();
681
- if (/^##\s+Agent Document\s*$/.test(trimmed)) {
682
- insideLegacyReference = true;
683
- return false;
684
- }
685
- if (insideLegacyReference && /^##\s+/.test(trimmed)) insideLegacyReference = false;
686
- return !insideLegacyReference && !/^#/.test(trimmed) && !/^- (?:Path|Changed): `[^`]+`$/.test(trimmed);
687
- })
688
- .join("\n")
689
- .replace(/^\s*(?:Includes|Excludes):\s*$/gmu, "");
690
- }
691
-
692
- /**
693
- * @param {string} text
694
- * @returns {number}
695
- */
696
- function countWords(text) {
697
- const matches = stripFencedCodeBlocks(text).match(/(?:\p{L}[\p{L}\p{M}\p{N}'’_-]*|\p{N}+)/gu);
698
- return matches ? matches.length : 0;
699
- }
700
-
701
- /**
702
- * @param {string} text
703
- * @returns {number}
704
- */
705
- function countMeaningfulListItems(text) {
706
- return [...stripFencedCodeBlocks(text).matchAll(/^\s*(?:[-*+]|\d+[.)])\s+(.+)$/gmu)]
707
- .filter((match) => countWords(match[1]) > 0)
708
- .length;
709
- }
710
-
711
833
  export const __deps__ = Object.freeze({
712
834
  constants: "Fl32_Skill_Adsm_Ctx_Shared_Constants$",
713
835
  fs: "node:fs",