renma 0.18.0 → 0.18.1
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 +30 -1
- package/README.md +1 -1
- package/architecture.md +7 -6
- package/design.md +39 -32
- package/dist/cli-help.d.ts +4 -4
- package/dist/cli-help.d.ts.map +1 -1
- package/dist/cli-help.js +14 -1
- package/dist/cli-help.js.map +1 -1
- package/dist/commands/scaffold.js +30 -9
- package/dist/commands/scaffold.js.map +1 -1
- package/dist/context-lens.d.ts +1 -0
- package/dist/context-lens.d.ts.map +1 -1
- package/dist/context-lens.js +19 -1
- package/dist/context-lens.js.map +1 -1
- package/dist/diagnostic-ids.d.ts +1 -0
- package/dist/diagnostic-ids.d.ts.map +1 -1
- package/dist/diagnostic-ids.js +1 -0
- package/dist/diagnostic-ids.js.map +1 -1
- package/dist/metadata.d.ts +15 -1
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +235 -0
- package/dist/metadata.js.map +1 -1
- package/dist/model.d.ts +3 -0
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js.map +1 -1
- package/dist/rules.js +69 -23
- package/dist/rules.js.map +1 -1
- package/docs/README.md +2 -1
- package/docs/authoring-guide.md +38 -13
- package/docs/context-lens.md +319 -153
- package/docs/diagnostics.md +3 -1
- package/docs/metadata-budget.md +32 -0
- package/docs/quality-profile.md +17 -5
- package/docs/user-manual.md +14 -2
- package/examples/context-lens/README.md +8 -3
- package/examples/context-lens/contexts/testing/boundary-value-analysis.md +6 -2
- package/examples/context-lens/lenses/testing/spec-review-boundary-values.md +27 -5
- package/examples/context-lens/lenses/testing/test-design-boundary-values.md +27 -5
- package/examples/context-lens/skills/testing/spec-review/SKILL.md +33 -4
- package/package.json +1 -1
package/docs/context-lens.md
CHANGED
|
@@ -1,46 +1,121 @@
|
|
|
1
1
|
# Context Lens Assets
|
|
2
2
|
|
|
3
|
-
`context_lens` is
|
|
3
|
+
`context_lens` is Renma's asset kind for purpose-specific interpretation of one
|
|
4
|
+
or more declared Context Assets. Use a Lens when the same reusable knowledge
|
|
5
|
+
needs to be read with different questions, risks, evidence priorities, or
|
|
6
|
+
output expectations for a particular purpose.
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
A Lens requires Context to interpret. Do not create a Context Lens when there
|
|
9
|
+
is no Context Asset to put in `applies_to`.
|
|
10
|
+
|
|
11
|
+
The governing model is:
|
|
6
12
|
|
|
7
13
|
```text
|
|
8
|
-
|
|
14
|
+
Skill = focused task and workflow
|
|
15
|
+
Context Asset = durable reusable knowledge
|
|
16
|
+
Context Lens = purpose-specific interpretation of Context
|
|
9
17
|
```
|
|
10
18
|
|
|
11
|
-
|
|
19
|
+
The design principles remain:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
Knowledge should be reusable.
|
|
23
|
+
Interpretation should be purpose-oriented.
|
|
24
|
+
Execution should be skill-specific.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
A Lens should make an interpretation reproducible enough that another reviewer
|
|
28
|
+
or LLM can identify the same questions, risks, evidence, and expected output.
|
|
29
|
+
Renma can validate the declared structure and relationships, but it cannot
|
|
30
|
+
deterministically prove that this semantic guidance is professionally sound.
|
|
31
|
+
|
|
32
|
+
See [`examples/context-lens`](../examples/context-lens) for a runnable fixture
|
|
33
|
+
with two valid Lenses, a complete focused workflow, and zero scan findings.
|
|
34
|
+
|
|
35
|
+
## The Problem A Lens Solves
|
|
12
36
|
|
|
13
|
-
|
|
37
|
+
A reusable Context Asset may support several purposes. For example, payment
|
|
38
|
+
retry rules can be interpreted for:
|
|
14
39
|
|
|
15
|
-
|
|
40
|
+
- specification review, emphasizing ambiguity and missing sources of truth;
|
|
41
|
+
- test design, emphasizing boundary values and expected results; or
|
|
42
|
+
- failure analysis, emphasizing observed symptoms and logs.
|
|
43
|
+
|
|
44
|
+
The base facts should not be copied into three Skills. Each Lens records one
|
|
45
|
+
purpose-specific way of reading the same facts, while each Skill retains its
|
|
46
|
+
focused task and workflow.
|
|
47
|
+
|
|
48
|
+
Use a direct relationship when no separate interpretation is needed:
|
|
16
49
|
|
|
17
50
|
```text
|
|
18
|
-
|
|
51
|
+
Skill -> Context Asset
|
|
19
52
|
```
|
|
20
53
|
|
|
21
|
-
|
|
54
|
+
Use a Lens only when purpose-specific interpretation adds meaningful reusable
|
|
55
|
+
structure:
|
|
22
56
|
|
|
23
57
|
```text
|
|
24
|
-
|
|
25
|
-
Interpretation should be purpose-oriented.
|
|
26
|
-
Execution should be skill-specific.
|
|
58
|
+
Skill -> Context Lens -> Context Asset
|
|
27
59
|
```
|
|
28
60
|
|
|
29
|
-
|
|
61
|
+
These are static repository relationships, not a runtime loading pipeline.
|
|
30
62
|
|
|
31
|
-
|
|
63
|
+
## Placement Decision
|
|
32
64
|
|
|
33
|
-
|
|
34
|
-
- a test design lens that focuses on boundary values and expected results
|
|
35
|
-
- a failure analysis lens that focuses on observed symptoms and logs
|
|
65
|
+
Before creating an asset, apply this sequence:
|
|
36
66
|
|
|
37
|
-
|
|
67
|
+
1. Is this the task, workflow, or completion contract? Put it in the Skill.
|
|
68
|
+
2. Is this durable, reusable, source-backed knowledge? Create or reuse a
|
|
69
|
+
Context Asset.
|
|
70
|
+
3. Does declared Context need to be interpreted differently for a specific
|
|
71
|
+
purpose? Create a Context Lens.
|
|
72
|
+
4. Is this a Skill-local overlay or execution variant? Use a Profile if the
|
|
73
|
+
current Profile semantics fit.
|
|
74
|
+
5. Is this supporting detail used by only one Skill? Use a Reference.
|
|
75
|
+
6. Is this a local fixture or demonstration? Use an Example.
|
|
76
|
+
7. Is this only generic persona or tone framing? Usually keep it local; do not
|
|
77
|
+
create an asset solely for the persona.
|
|
38
78
|
|
|
39
|
-
|
|
79
|
+
If review criteria apply only to one workflow and do not interpret reusable
|
|
80
|
+
Context, keep them in the Skill body, a Skill-local Reference, or a Skill-local
|
|
81
|
+
Profile when they genuinely form an overlay or variant.
|
|
40
82
|
|
|
41
|
-
##
|
|
83
|
+
## Lens Fields And Body
|
|
42
84
|
|
|
43
|
-
|
|
85
|
+
Prefer compact, flat frontmatter. Detailed interpretation belongs in the
|
|
86
|
+
Markdown body rather than turning metadata into a prompt template.
|
|
87
|
+
|
|
88
|
+
- `id`: required stable Lens ID. Prefer a `lens.<domain>.<purpose>` style.
|
|
89
|
+
- `type`: recommended `context_lens` discriminator. It is optional under
|
|
90
|
+
`lenses/**` and required when a Lens is stored under `context/**` or
|
|
91
|
+
`contexts/**`.
|
|
92
|
+
- `owner`: required accountable owner.
|
|
93
|
+
- `status`: optional lifecycle state: `experimental`, `stable`, `deprecated`,
|
|
94
|
+
or `archived`.
|
|
95
|
+
- `version`: optional schema version. The supported Lens schema version is `1`.
|
|
96
|
+
- `scope`: optional scope. The supported value is `context`.
|
|
97
|
+
- `purpose`: required short label for why the Context is being interpreted,
|
|
98
|
+
such as `spec_review`, `test_design`, or `failure_analysis`.
|
|
99
|
+
- `applies_to`: required list of existing Context Asset IDs or
|
|
100
|
+
repository-relative paths. These are the assets the Lens interprets.
|
|
101
|
+
- `focus`: optional compact list of questions, risks, checks, or evidence themes
|
|
102
|
+
to emphasize.
|
|
103
|
+
- `expected_outputs`: optional compact list of outputs the interpretation should
|
|
104
|
+
shape.
|
|
105
|
+
|
|
106
|
+
The Markdown body should explain how to apply those fields. It may provide a
|
|
107
|
+
brief professional framing, then should define concrete interpretation
|
|
108
|
+
questions, important risks, evidence expectations, prioritization rules, and
|
|
109
|
+
the expected output. It should not copy the Context or take over the Skill's
|
|
110
|
+
ordered workflow and completion contract.
|
|
111
|
+
|
|
112
|
+
Deprecated aliases such as `target`, `targets`, `output`, and `outputs` produce
|
|
113
|
+
warnings. Use `applies_to` and `expected_outputs`.
|
|
114
|
+
|
|
115
|
+
## Minimal Structural Example
|
|
116
|
+
|
|
117
|
+
A minimal valid Lens declares a stable ID, owner, purpose, and at least one real
|
|
118
|
+
`applies_to` target:
|
|
44
119
|
|
|
45
120
|
```yaml
|
|
46
121
|
---
|
|
@@ -54,164 +129,230 @@ applies_to:
|
|
|
54
129
|
---
|
|
55
130
|
# Spec Review Lens for Boundary Values
|
|
56
131
|
|
|
57
|
-
Review the boundary
|
|
132
|
+
Review the boundary-value Context for ambiguity, missing limits, and unclear
|
|
133
|
+
sources of truth. Cite the specification evidence behind each finding.
|
|
58
134
|
```
|
|
59
135
|
|
|
60
|
-
|
|
136
|
+
This is structurally valid only when the target resolves to a Context Asset. It
|
|
137
|
+
is useful only if the body makes the purpose-specific interpretation concrete
|
|
138
|
+
enough for review.
|
|
139
|
+
|
|
140
|
+
## Persona Framing Is Not A Lens
|
|
141
|
+
|
|
142
|
+
A persona may frame a Lens, but a persona alone does not define one.
|
|
61
143
|
|
|
62
|
-
|
|
144
|
+
Do not create a Lens that says only “Act as a senior QA engineer.” Describe the
|
|
145
|
+
concrete questions, risks, checks, evidence, and expected outputs that the
|
|
146
|
+
professional perspective implies.
|
|
63
147
|
|
|
64
|
-
|
|
148
|
+
### Insufficient Lens
|
|
149
|
+
|
|
150
|
+
```markdown
|
|
151
|
+
# Senior QA Engineer Lens
|
|
152
|
+
|
|
153
|
+
Act as a senior QA engineer.
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
This is insufficient because it:
|
|
157
|
+
|
|
158
|
+
- does not identify what Context is being interpreted;
|
|
159
|
+
- does not define a useful purpose;
|
|
160
|
+
- does not identify review questions or risks;
|
|
161
|
+
- does not say what evidence should be emphasized;
|
|
162
|
+
- does not define an expected output; and
|
|
163
|
+
- can become generic prompt-role wording rather than a reusable interpretation
|
|
164
|
+
asset.
|
|
165
|
+
|
|
166
|
+
### Better Lens
|
|
167
|
+
|
|
168
|
+
The following Context Asset and Lens use repository-defined example IDs. They
|
|
169
|
+
are not built into Renma. An author must create or identify the real Context
|
|
170
|
+
Asset before declaring it in `applies_to`.
|
|
171
|
+
|
|
172
|
+
The complete responsibility chain is:
|
|
173
|
+
|
|
174
|
+
```text
|
|
175
|
+
Context Asset -> reusable test-quality knowledge
|
|
176
|
+
Context Lens -> test-code-review interpretation criteria
|
|
177
|
+
Skill -> review task and output contract
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
#### Example Context Asset
|
|
65
181
|
|
|
66
182
|
```yaml
|
|
67
183
|
---
|
|
68
|
-
id:
|
|
69
|
-
type: context_lens
|
|
184
|
+
id: context.testing.test-quality
|
|
70
185
|
owner: qa-platform
|
|
71
|
-
status:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
- ambiguity
|
|
77
|
-
- missing boundary
|
|
78
|
-
expected_outputs:
|
|
79
|
-
- unresolved questions
|
|
80
|
-
- risk notes
|
|
186
|
+
status: stable
|
|
187
|
+
when_to_use:
|
|
188
|
+
- Reviewing automated test design or implementation quality
|
|
189
|
+
when_not_to_use:
|
|
190
|
+
- Reviewing application behavior without test-quality concerns
|
|
81
191
|
---
|
|
192
|
+
# Test Quality
|
|
193
|
+
|
|
194
|
+
Reliable automated tests trace assertions to intended requirements, avoid
|
|
195
|
+
false confidence, behave deterministically, isolate unrelated state, and emit
|
|
196
|
+
failure evidence that helps distinguish product defects from test defects.
|
|
82
197
|
```
|
|
83
198
|
|
|
199
|
+
This Context Asset owns the reusable test-quality knowledge. A Skill may use it
|
|
200
|
+
directly, or use the following Lens when test-code-review interpretation adds
|
|
201
|
+
reusable structure.
|
|
202
|
+
|
|
203
|
+
#### Context Lens Over The Example Asset
|
|
204
|
+
|
|
84
205
|
```yaml
|
|
85
206
|
---
|
|
86
|
-
id: lens.testing.test-
|
|
207
|
+
id: lens.testing.test-code-review.quality
|
|
87
208
|
type: context_lens
|
|
88
209
|
owner: qa-platform
|
|
89
210
|
status: experimental
|
|
90
|
-
purpose:
|
|
211
|
+
purpose: test_code_review
|
|
91
212
|
applies_to:
|
|
92
|
-
- context.testing.
|
|
213
|
+
- context.testing.test-quality
|
|
93
214
|
focus:
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
215
|
+
- requirement coverage
|
|
216
|
+
- false-positive and false-negative risk
|
|
217
|
+
- determinism
|
|
218
|
+
- test isolation
|
|
219
|
+
- failure diagnosability
|
|
97
220
|
expected_outputs:
|
|
98
|
-
-
|
|
99
|
-
-
|
|
221
|
+
- prioritized findings
|
|
222
|
+
- evidence-backed rationale
|
|
223
|
+
- recommended corrections
|
|
100
224
|
---
|
|
101
|
-
|
|
225
|
+
# Test Code Review Quality Lens
|
|
102
226
|
|
|
103
|
-
|
|
227
|
+
Evaluate the applied test-quality Context from the perspective of an
|
|
228
|
+
experienced QA engineer responsible for release confidence.
|
|
104
229
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
230
|
+
## Interpretation Criteria
|
|
231
|
+
|
|
232
|
+
- Determine whether each test verifies the intended requirement rather than
|
|
233
|
+
merely exercising code.
|
|
234
|
+
- Identify assertions or missing checks that can produce false confidence,
|
|
235
|
+
false positives, or false negatives.
|
|
236
|
+
- Examine whether timing and synchronization assumptions are deterministic.
|
|
237
|
+
- Check whether tests are isolated from unrelated state and ordering.
|
|
238
|
+
- Distinguish product defects from test implementation defects when analyzing
|
|
239
|
+
failures.
|
|
240
|
+
- Prefer failure output that identifies the violated requirement and likely
|
|
241
|
+
underlying cause.
|
|
242
|
+
|
|
243
|
+
## Evidence And Output
|
|
244
|
+
|
|
245
|
+
Cite relevant code, requirements, repository guidance, or observed failure
|
|
246
|
+
evidence. Produce prioritized findings with rationale and recommended
|
|
247
|
+
corrections; keep unresolved assumptions explicit.
|
|
115
248
|
```
|
|
116
249
|
|
|
117
|
-
|
|
250
|
+
The framing sentence is optional. The concrete criteria and evidence contract
|
|
251
|
+
are what make the Lens useful.
|
|
118
252
|
|
|
119
|
-
|
|
253
|
+
The important boundary is:
|
|
120
254
|
|
|
121
|
-
|
|
255
|
+
```text
|
|
256
|
+
Skill defines the review task.
|
|
257
|
+
Lens defines what purpose-specific review judgment means when interpreting Context.
|
|
258
|
+
```
|
|
122
259
|
|
|
123
|
-
|
|
124
|
-
- `type`: recommended `context_lens` discriminator.
|
|
125
|
-
- `owner`: required accountable owner.
|
|
126
|
-
- `status`: optional lifecycle status: `experimental`, `stable`, `deprecated`, or `archived`.
|
|
127
|
-
- `version`: optional lens schema version. The supported schema version is `1`.
|
|
128
|
-
- `scope`: optional lens scope. The supported scope is `context`.
|
|
129
|
-
- `purpose`: required short purpose label such as `spec_review`, `test_design`, or `failure_analysis`.
|
|
130
|
-
- `applies_to`: required context asset IDs or repository-relative paths this lens interprets.
|
|
131
|
-
- `focus`: optional compact review focus terms.
|
|
132
|
-
- `expected_outputs`: optional compact output expectations.
|
|
260
|
+
## How A Lens Differs From Adjacent Assets
|
|
133
261
|
|
|
134
|
-
|
|
262
|
+
| Asset or responsibility | What it owns |
|
|
263
|
+
| --- | --- |
|
|
264
|
+
| Skill | Focused task or workflow: activation boundaries, inputs, ordered instructions, decisions, constraints, verification, output, and completion criteria |
|
|
265
|
+
| Context Asset | Durable, reusable, source-backed knowledge with independent ownership and lifecycle |
|
|
266
|
+
| Context Lens | Purpose-specific interpretation of one or more declared Context Assets |
|
|
267
|
+
| Profile | Skill-local overlay or variant when current Profile semantics fit |
|
|
268
|
+
| Reference | Supporting detail owned and loaded by one Skill |
|
|
269
|
+
| Example | Skill-local example, fixture, or demonstration |
|
|
270
|
+
| External agent or runtime | Live asset selection, loading or injection, prompt assembly, tool execution, and application of the finished workflow |
|
|
135
271
|
|
|
136
|
-
|
|
272
|
+
A schema-valid Lens can still be semantically weak. Renma can prove that an ID,
|
|
273
|
+
owner, purpose, and `applies_to` relationship to a Context Asset exist. It
|
|
274
|
+
cannot prove that vague focus words, generic persona language, or an
|
|
275
|
+
underspecified body capture useful professional judgment. That quality remains
|
|
276
|
+
an authoring and human-review responsibility; Renma does not call an LLM or add
|
|
277
|
+
subjective Lens scores.
|
|
137
278
|
|
|
138
|
-
|
|
279
|
+
## Canonical Skill Relationships
|
|
139
280
|
|
|
140
|
-
|
|
281
|
+
A canonical Agent Skills `SKILL.md` declares Renma relationships as flat,
|
|
282
|
+
string-valued `metadata.renma.*` fields. List values are JSON-array strings:
|
|
141
283
|
|
|
142
284
|
```yaml
|
|
143
285
|
---
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
286
|
+
name: spec-review
|
|
287
|
+
description: Review specifications for ambiguity and missing boundaries. Use when requirements need evidence-backed review before implementation.
|
|
288
|
+
metadata:
|
|
289
|
+
renma.id: skill.testing.spec-review
|
|
290
|
+
renma.owner: qa-platform
|
|
291
|
+
renma.status: experimental
|
|
292
|
+
renma.requires-context: '["context.testing.boundary-value-analysis"]'
|
|
293
|
+
renma.requires-lens: '["lens.testing.spec-review.boundary-values"]'
|
|
294
|
+
renma.optional-lens: '[]'
|
|
148
295
|
---
|
|
149
|
-
# Spec Review Lens
|
|
150
296
|
```
|
|
151
297
|
|
|
152
|
-
|
|
298
|
+
Do not use pre-0.16 top-level Skill metadata in current examples. The
|
|
299
|
+
`metadata.renma.*` relationships create catalog and graph evidence; they do not
|
|
300
|
+
make Renma select a Lens, load Context, or inject either into an agent.
|
|
153
301
|
|
|
154
|
-
|
|
155
|
-
- `CONTEXT-LENS-PATH-NORMALIZATION-MISMATCH` because `./contexts/testing/missing.md` normalizes to `contexts/testing/missing.md`.
|
|
156
|
-
- `CONTEXT-LENS-TARGET-NOT-FOUND` because the target path does not resolve to a cataloged asset.
|
|
157
|
-
|
|
158
|
-
Blocking Context Lens diagnostics are `error` diagnostics. Warnings are reported by default but do not fail readiness unless another policy makes the repository not ready.
|
|
159
|
-
|
|
160
|
-
## Readiness And Inspect
|
|
161
|
-
|
|
162
|
-
`renma readiness --json` includes an additive `summary.contextLens` object:
|
|
163
|
-
|
|
164
|
-
```json
|
|
165
|
-
{
|
|
166
|
-
"summary": {
|
|
167
|
-
"contextLens": {
|
|
168
|
-
"enabled": true,
|
|
169
|
-
"detected": true,
|
|
170
|
-
"totalLensCount": 2,
|
|
171
|
-
"validLensCount": 2,
|
|
172
|
-
"invalidLensCount": 0,
|
|
173
|
-
"diagnosticCounts": {
|
|
174
|
-
"error": 0,
|
|
175
|
-
"warning": 0,
|
|
176
|
-
"info": 0
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
```
|
|
302
|
+
## Runtime Responsibility Boundary
|
|
182
303
|
|
|
183
|
-
|
|
304
|
+
Renma catalogs and validates repository assets. An external agent or runtime:
|
|
184
305
|
|
|
185
|
-
|
|
306
|
+
- selects relevant assets for a live task;
|
|
307
|
+
- loads or injects Context and Lens content;
|
|
308
|
+
- assembles prompts;
|
|
309
|
+
- executes tools and the focused Skill workflow; and
|
|
310
|
+
- applies or presents the result.
|
|
311
|
+
|
|
312
|
+
Renma does not select or rank Lenses, assemble prompts, inject Context, execute
|
|
313
|
+
a Skill, infer semantic intent, or use an LLM to judge Lens quality.
|
|
186
314
|
|
|
187
315
|
```text
|
|
188
|
-
|
|
189
|
-
- Enabled: yes
|
|
190
|
-
- Detected: yes
|
|
191
|
-
- Lenses: 2/2 valid (0 invalid)
|
|
192
|
-
- Diagnostics: error 0, warning 0, info 0
|
|
193
|
-
- Representative diagnostic: (none)
|
|
194
|
-
- Definition paths: lenses/testing/spec-review-boundary-values.md, lenses/testing/test-design-boundary-values.md
|
|
195
|
-
- Target references: context.testing.boundary-value-analysis
|
|
316
|
+
LLM proposes. Renma verifies. Human approves.
|
|
196
317
|
```
|
|
197
318
|
|
|
198
|
-
|
|
319
|
+
## Diagnostics, Readiness, And Inspect
|
|
199
320
|
|
|
200
|
-
|
|
321
|
+
Context Lens governance diagnostics use stable string codes in `scan` and
|
|
322
|
+
`readiness`. Blocking `error` diagnostics include missing required fields,
|
|
323
|
+
duplicate Lens IDs, unresolved `applies_to` targets, and resolved targets that
|
|
324
|
+
are not Context Assets. Warnings are reported for review but do not fail
|
|
325
|
+
readiness unless another policy makes the repository not ready.
|
|
201
326
|
|
|
202
|
-
|
|
327
|
+
For example, this invalid definition is missing `purpose`, uses a path that
|
|
328
|
+
normalizes differently, and targets no cataloged asset:
|
|
203
329
|
|
|
204
|
-
```
|
|
205
|
-
|
|
330
|
+
```yaml
|
|
331
|
+
---
|
|
332
|
+
id: lens.testing.spec-review.boundary-values
|
|
333
|
+
owner: qa-platform
|
|
334
|
+
applies_to:
|
|
335
|
+
- ./contexts/testing/missing.md
|
|
336
|
+
---
|
|
337
|
+
# Spec Review Lens
|
|
206
338
|
```
|
|
207
339
|
|
|
208
|
-
|
|
340
|
+
Expected diagnostics include:
|
|
341
|
+
|
|
342
|
+
- `CONTEXT-LENS-MISSING-REQUIRED-FIELD`;
|
|
343
|
+
- `CONTEXT-LENS-PATH-NORMALIZATION-MISMATCH`; and
|
|
344
|
+
- `CONTEXT-LENS-TARGET-NOT-FOUND`.
|
|
209
345
|
|
|
210
|
-
|
|
346
|
+
`renma readiness --json` exposes Lens counts and diagnostics under
|
|
347
|
+
`summary.contextLens`; Markdown readiness includes a `Context Lens` section.
|
|
348
|
+
`renma inspect <file> --format text` shows the definition paths, targets, and
|
|
349
|
+
static graph neighborhood. These views report repository evidence, not runtime
|
|
350
|
+
use.
|
|
211
351
|
|
|
212
|
-
## Authoring
|
|
352
|
+
## Authoring And Verification
|
|
213
353
|
|
|
214
|
-
Use `scaffold`
|
|
354
|
+
Use `scaffold` for a starter, then replace every placeholder with
|
|
355
|
+
repository-grounded values:
|
|
215
356
|
|
|
216
357
|
```bash
|
|
217
358
|
renma scaffold context_lens lenses/testing/spec-review-boundary-values.md \
|
|
@@ -221,33 +362,58 @@ renma scaffold context_lens lenses/testing/spec-review-boundary-values.md \
|
|
|
221
362
|
--tags testing,spec-review
|
|
222
363
|
```
|
|
223
364
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
## Good Lens Boundaries
|
|
227
|
-
|
|
228
|
-
A lens should answer:
|
|
229
|
-
|
|
230
|
-
- What purpose is this context being read for?
|
|
231
|
-
- Which context assets does it apply to?
|
|
232
|
-
- What questions, risks, checks, or evidence should be emphasized?
|
|
233
|
-
- What output shape should the agent or human reviewer produce?
|
|
365
|
+
Before review:
|
|
234
366
|
|
|
235
|
-
|
|
367
|
+
1. Replace `purpose`, every `applies_to` target, `focus`, and
|
|
368
|
+
`expected_outputs`.
|
|
369
|
+
2. Confirm that each target is an existing Context Asset and that the Lens adds
|
|
370
|
+
meaningful interpretation rather than copying it.
|
|
371
|
+
3. Keep the focused workflow in the Skill and reusable knowledge in Context.
|
|
372
|
+
4. Replace persona-only wording with concrete criteria, evidence expectations,
|
|
373
|
+
and outputs.
|
|
374
|
+
5. Run:
|
|
236
375
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
## Non-Goals For 0.12.0
|
|
244
|
-
|
|
245
|
-
Renma 0.12.0 intentionally does not implement:
|
|
246
|
-
|
|
247
|
-
- runtime selection
|
|
248
|
-
- prompt assembly
|
|
249
|
-
- context injection
|
|
250
|
-
- automatic LLM judgment or subjective scoring
|
|
251
|
-
- external signal imports from Codex, Claude, IDEs, or similar tools
|
|
376
|
+
```bash
|
|
377
|
+
renma scan . --fail-on high
|
|
378
|
+
renma catalog . --format markdown
|
|
379
|
+
renma graph . --view layered --format mermaid
|
|
380
|
+
renma readiness . --format markdown
|
|
381
|
+
```
|
|
252
382
|
|
|
253
|
-
The
|
|
383
|
+
The final semantic decision belongs to a human reviewer.
|
|
384
|
+
|
|
385
|
+
## Zero-Context Classification Self-Check
|
|
386
|
+
|
|
387
|
+
An unfamiliar author or LLM should classify these cases as follows:
|
|
388
|
+
|
|
389
|
+
1. Payment retry rules and retry limits → **Context Asset**, because they are
|
|
390
|
+
durable domain knowledge that may support several workflows.
|
|
391
|
+
2. Review a test implementation and produce prioritized findings → **Skill**,
|
|
392
|
+
because this is the focused task and output contract.
|
|
393
|
+
3. Emphasize false-confidence risk, determinism, isolation, and diagnosability
|
|
394
|
+
while interpreting shared test-quality guidance → **Context Lens**, because
|
|
395
|
+
it defines purpose-specific interpretation of declared reusable Context.
|
|
396
|
+
4. “Act as a senior QA engineer” → **insufficient by itself**; it may be brief
|
|
397
|
+
local framing, but it does not define concrete interpretation criteria.
|
|
398
|
+
5. A strict Skill-local review variant → **Profile**, when the current Profile
|
|
399
|
+
overlay semantics fit.
|
|
400
|
+
6. Detailed framework-specific notes used only by one review Skill →
|
|
401
|
+
**Reference**, because the detail is locally owned and loaded.
|
|
402
|
+
7. Select the most relevant Lens dynamically for the current task → **external
|
|
403
|
+
agent or runtime**, because Renma core and Lens assets do not perform live
|
|
404
|
+
selection.
|
|
405
|
+
|
|
406
|
+
## Current Non-Goals
|
|
407
|
+
|
|
408
|
+
Renma does not implement:
|
|
409
|
+
|
|
410
|
+
- runtime Lens or Context selection;
|
|
411
|
+
- prompt assembly or Context injection;
|
|
412
|
+
- Skill or tool execution;
|
|
413
|
+
- automatic semantic inference;
|
|
414
|
+
- automatic LLM judgment or subjective Lens scoring; or
|
|
415
|
+
- external runtime signal imports from agents, IDEs, or similar tools.
|
|
416
|
+
|
|
417
|
+
Context Lens support remains deterministic repository governance: discovery,
|
|
418
|
+
metadata and relationship validation, diagnostics, readiness, inspect, graph,
|
|
419
|
+
documentation, and examples.
|
package/docs/diagnostics.md
CHANGED
|
@@ -215,6 +215,7 @@ Context Lens governance diagnostics use stable `code` values in JSON output. `er
|
|
|
215
215
|
| `CONTEXT-LENS-GOVERNANCE-MEANINGLESS` | `warning` | A lens has no purpose, target, focus, expected output, or body guidance. | Add compact governance metadata or reviewed interpretation guidance. |
|
|
216
216
|
| `CONTEXT-LENS-MISSING-REQUIRED-FIELD` | `error` | A lens is missing `id`, `owner`, `purpose`, or `applies_to`. | Add the required field in frontmatter. |
|
|
217
217
|
| `CONTEXT-LENS-PATH-NORMALIZATION-MISMATCH` | `warning` | A path target normalizes to a different repository-relative path. | Use the normalized path shown by the diagnostic. |
|
|
218
|
+
| `CONTEXT-LENS-TARGET-NOT-CONTEXT` | `error` | An `applies_to` target resolves to a cataloged asset whose kind is not `context`. | `applies_to` must reference a Context Asset ID or path; Skills, support assets, other Lenses, and repository metadata are not valid Lens targets. |
|
|
218
219
|
| `CONTEXT-LENS-TARGET-NOT-FOUND` | `error` | An `applies_to` target does not resolve to a cataloged asset ID or path. | Correct the target, add the missing context asset, or update discovery config. |
|
|
219
220
|
| `CONTEXT-LENS-UNPARSEABLE-FRONTMATTER` | `error` | A lens frontmatter block starts with `---` but does not close. | Add the closing `---` delimiter or remove malformed frontmatter. |
|
|
220
221
|
| `CONTEXT-LENS-UNSUPPORTED-KIND` | `warning` or `error` | `type: context_lens` appears under an unsupported artifact kind, or a lens file declares an unsupported type. | Store lens definitions under `lenses/**`, `context/**`, or `contexts/**`, and use `type: context_lens`. |
|
|
@@ -347,7 +348,8 @@ examples by asset kind.
|
|
|
347
348
|
| `QUAL-SKILL-MIXED-RESPONSIBILITY` | Skill may mix workflow and reusable knowledge. | A sufficiently large Skill has multiple distinct reusable-knowledge signals. | Promote only independently owned shared knowledge; keep Skill-local workflow and detail local. |
|
|
348
349
|
| `QUAL-SKILL-PROGRESSIVE-DISCLOSURE` | Progressive disclosure needs review. | Reserved 0.18 focused-workflow contract identifier. | Keep read conditions and core workflow in `SKILL.md`; place details by semantic responsibility. |
|
|
349
350
|
| `QUAL-SKILL-TOKEN-BUDGET` | Skill body exceeds an advisory estimate. | Markdown body exceeds 2,000 or 5,000 estimated tokens. | Review progressive disclosure without splitting or moving content by size alone. |
|
|
350
|
-
| `QUAL-
|
|
351
|
+
| `QUAL-INVALID-TOKEN-BUDGET-OVERRIDE` | Support-asset decision metadata is invalid. | The decision is malformed, unsafe to represent exactly, ambiguous, incomplete, orphaned, duplicated, or unnecessary while the asset remains within its default. | Correct or remove the declaration. Ask about a meaningful split first; use an override only after the user confirms the asset should remain intentionally long. |
|
|
352
|
+
| `QUAL-SUPPORT-ASSET-TOKEN-BUDGET` | Support asset exceeds its effective advisory estimate. | A context, reference, profile, or example exceeds its default or valid declared override. | Ask whether a semantic split preserves coherence and execution order. Split only with user agreement; otherwise record an explicit rationale, never an override added merely to pass diagnostics. |
|
|
351
353
|
| `QUAL-USER-LOCAL-PATHS` | User-local path appears in content. | Guidance includes machine-specific paths such as home directories. | Replace local paths with repository-relative or configurable paths. |
|
|
352
354
|
| `SEC-DESTRUCTIVE-COMMAND` | Destructive command appears. | Content includes risky commands such as forced deletion or reset. | Remove it, gate it with explicit safety guidance, or use a safer command. |
|
|
353
355
|
| `SEC-ENV-COPY` | Environment copying is suggested. | Content copies broad environment or secret-bearing files. | Narrow the copied data and document secret handling. |
|
package/docs/metadata-budget.md
CHANGED
|
@@ -4,11 +4,43 @@ Renma intentionally keeps asset frontmatter small. Frontmatter should work as a
|
|
|
4
4
|
|
|
5
5
|
Use frontmatter for concise fields such as `id`, `owner`, `status`, `tags`, `when_to_use`, `when_not_to_use`, and declared context relationships. Put detailed guidance, examples, procedures, policy rationale, and long routing prose in the markdown body or in referenced context assets.
|
|
6
6
|
|
|
7
|
+
Contexts, references, profiles, and examples also support these top-level
|
|
8
|
+
human-decision fields:
|
|
9
|
+
|
|
10
|
+
```yaml
|
|
11
|
+
token_budget_override: 6000
|
|
12
|
+
token_budget_rationale: "This is a single ordered workflow and splitting it would break execution order."
|
|
13
|
+
token_budget_reviewed_at: "2026-07-12"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`token_budget_override` must be a positive safe integer greater than the asset
|
|
17
|
+
kind's default content limit, and `token_budget_rationale` must be a non-empty
|
|
18
|
+
string. `token_budget_reviewed_at` is optional and must be a real `YYYY-MM-DD`
|
|
19
|
+
date when present. Invalid metadata does not replace the default limit.
|
|
20
|
+
The three fields form one decision bundle: rationale and review-date fields are
|
|
21
|
+
invalid without an override. Duplicate fields, relevant YAML errors, and an
|
|
22
|
+
override declared while the full file remains within its default limit also
|
|
23
|
+
produce `QUAL-INVALID-TOKEN-BUDGET-OVERRIDE`. Renma selects no value from an
|
|
24
|
+
ambiguous or invalid bundle, and catalog output omits all three normalized
|
|
25
|
+
fields.
|
|
26
|
+
|
|
27
|
+
These fields record a declared human decision; Renma never inserts them. When
|
|
28
|
+
the default is exceeded, first ask whether the asset can be split along
|
|
29
|
+
meaningful semantic boundaries without harming coherence or execution order.
|
|
30
|
+
Split only after the user agrees. Use an override only when the user confirms
|
|
31
|
+
the asset should remain intentionally long, and never recommend one merely to
|
|
32
|
+
make diagnostics pass.
|
|
33
|
+
|
|
34
|
+
Renma records and validates this declaration; it cannot prove that a human
|
|
35
|
+
actually reviewed the asset. `token_budget_reviewed_at` is declared provenance,
|
|
36
|
+
not independently verified evidence.
|
|
37
|
+
|
|
7
38
|
Current metadata budget diagnostics:
|
|
8
39
|
|
|
9
40
|
| Finding | Meaning | Typical fix |
|
|
10
41
|
| --- | --- | --- |
|
|
11
42
|
| `META-FRONTMATTER-TOO-LARGE` | Frontmatter has grown beyond the compact index budget. | Move long prose, examples, procedures, or rationale into the body or referenced context assets. |
|
|
12
43
|
| `META-LIST-ITEM-TOO-LONG` | A block-list metadata item is too long to serve as concise routing/index metadata. | Keep the list item short and move detailed conditions into body sections. |
|
|
44
|
+
| `QUAL-INVALID-TOKEN-BUDGET-OVERRIDE` | Support-asset token-budget decision metadata is invalid or ambiguous. | Correct or remove it after an explicit user decision; invalid metadata leaves the default content limit active. |
|
|
13
45
|
|
|
14
46
|
These diagnostics are intentionally advisory. They should help reduce LLM-facing catalog noise and token usage without deleting substantive knowledge.
|