yam-flow 2.0.0 → 2.2.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/AGENTS.md +7 -5
- package/CHANGELOG.md +26 -0
- package/COMMANDS.md +10 -4
- package/DECISIONS.md +3 -0
- package/README.md +17 -9
- package/dist/bin/yam.js +211 -30
- package/dist/lib/trust-kernel.d.ts +31 -1
- package/dist/lib/trust-kernel.js +128 -6
- package/package.json +2 -1
- package/references/final-report.md +17 -11
- package/references/honest-completion.md +13 -0
- package/references/study-note.md +69 -0
- package/references/tool-trust-layer.md +6 -1
- package/references/ueye-proof.md +42 -1
- package/references/ueye.md +29 -3
- package/references/verification-levels.md +130 -25
- package/skills/deep/SKILL.md +10 -2
- package/skills/mission/SKILL.md +10 -1
- package/skills/quick/SKILL.md +6 -2
- package/skills/ueye/SKILL.md +5 -1
- package/src/bin/yam.ts +217 -31
- package/src/lib/trust-kernel.ts +155 -7
- package/templates/yam.project.md +5 -1
- package/yam.manifest.json +6 -3
package/dist/lib/trust-kernel.js
CHANGED
|
@@ -236,24 +236,32 @@ export function buildLoopReport(input = {}) {
|
|
|
236
236
|
? input.stages.map((stage) => buildLoopStage(stage))
|
|
237
237
|
: [];
|
|
238
238
|
const evidence = asList(input.evidence);
|
|
239
|
+
const touchedFiles = asList(input.touched_files || input.touched_file);
|
|
240
|
+
const readFiles = asList(input.read_files || input.read_file);
|
|
241
|
+
const verifiedFiles = asList(input.verified_files || input.verified_file);
|
|
242
|
+
const skippedChecks = asList(input.skipped_checks || input.skipped_check);
|
|
243
|
+
const stopCondition = shortText(input.stop_condition);
|
|
244
|
+
const resumeHint = shortText(input.resume_hint);
|
|
245
|
+
const readinessState = normalizeReadinessState(input.readiness_state);
|
|
239
246
|
const coveredRequirements = asList(input.covered_requirements || input.covered_requirement);
|
|
240
247
|
const uncoveredRequirements = asList(input.uncovered_requirements || input.uncovered_requirement);
|
|
241
248
|
const blockers = asList(input.blockers || input.blocked);
|
|
242
249
|
const blockedBy = asList(input.blocked_by);
|
|
243
|
-
const blockedKind = shortText(input.blocked_kind || (uncoveredRequirements.length ? 'requirement_uncovered' : blockers.length || blockedBy.length ? 'evidence_missing' : ''));
|
|
250
|
+
const blockedKind = shortText(input.blocked_kind || (readinessState === 'blocked' ? 'readiness_blocked' : uncoveredRequirements.length ? 'requirement_uncovered' : blockers.length || blockedBy.length ? 'evidence_missing' : ''));
|
|
244
251
|
const failureCause = shortText(input.failure_cause);
|
|
245
252
|
const recoveryHint = shortText(input.recovery_hint);
|
|
246
253
|
const avoidanceNote = shortText(input.avoidance_note);
|
|
247
254
|
const evidenceStamp = shortText(input.evidence_stamp || input.source_digest, 320);
|
|
248
255
|
const sourceDigest = shortText(input.source_digest || input.evidence_stamp, 320);
|
|
249
256
|
const hasBlockedStage = stages.some((stage) => stage.status === 'blocked' || stage.status === 'failed');
|
|
250
|
-
const hasBlockerSignal = Boolean(blockers.length || blockedBy.length || blockedKind || uncoveredRequirements.length);
|
|
257
|
+
const hasBlockerSignal = Boolean(blockers.length || blockedBy.length || blockedKind || uncoveredRequirements.length || readinessState === 'blocked');
|
|
251
258
|
const requestedTruth = isTruthStatus(input.truth_status) ? input.truth_status : '';
|
|
252
259
|
const derivedTruth = hasBlockerSignal || hasBlockedStage ? 'blocked'
|
|
253
260
|
: evidence.length && stages.some((stage) => stage.status === 'passed') ? 'verified'
|
|
254
261
|
: evidence.length || stages.length ? 'partial'
|
|
255
262
|
: 'assumed';
|
|
256
|
-
const
|
|
263
|
+
const readinessCap = readinessState === 'blocked' ? 'blocked' : readinessState === 'degraded' ? 'partial' : '';
|
|
264
|
+
const truth = requestedTruth ? weakestTruth(requestedTruth, derivedTruth, readinessCap) : weakestTruth(derivedTruth, readinessCap);
|
|
257
265
|
const studyNote = buildStudyNote(input.study_note && typeof input.study_note === 'object' ? input.study_note : input);
|
|
258
266
|
const intentLabel = normalizeToolIntentLabel(input.intent_label || input.tool_intent);
|
|
259
267
|
return {
|
|
@@ -270,6 +278,13 @@ export function buildLoopReport(input = {}) {
|
|
|
270
278
|
evidence_level: normalizeLoopEvidenceLevel(input.evidence_level),
|
|
271
279
|
evidence_stamp: evidenceStamp,
|
|
272
280
|
source_digest: sourceDigest,
|
|
281
|
+
touched_files: touchedFiles,
|
|
282
|
+
read_files: readFiles,
|
|
283
|
+
verified_files: verifiedFiles,
|
|
284
|
+
skipped_checks: skippedChecks,
|
|
285
|
+
stop_condition: stopCondition,
|
|
286
|
+
resume_hint: resumeHint,
|
|
287
|
+
readiness_state: readinessState,
|
|
273
288
|
covered_requirements: coveredRequirements,
|
|
274
289
|
uncovered_requirements: uncoveredRequirements,
|
|
275
290
|
blockers,
|
|
@@ -278,7 +293,7 @@ export function buildLoopReport(input = {}) {
|
|
|
278
293
|
truth_status: truth,
|
|
279
294
|
intent_label: intentLabel,
|
|
280
295
|
tool_intent: intentLabel,
|
|
281
|
-
next_action: shortText(input.next_action || (uncoveredRequirements.length ? `cover requirement before claiming complete: ${uncoveredRequirements[0]}` : hasBlockerSignal ? 'resolve the blocker before claiming this loop complete' : 'record the next smallest useful action')),
|
|
296
|
+
next_action: shortText(input.next_action || (readinessState === 'blocked' ? 'restore readiness before claiming this loop complete' : uncoveredRequirements.length ? `cover requirement before claiming complete: ${uncoveredRequirements[0]}` : hasBlockerSignal ? 'resolve the blocker before claiming this loop complete' : 'record the next smallest useful action')),
|
|
282
297
|
safe_retry: shortText(input.safe_retry || (hasBlockerSignal ? 'retry only after the blocker is resolved and new evidence is recorded' : 'not required')),
|
|
283
298
|
recovery_hint: recoveryHint,
|
|
284
299
|
fix_first_items: asList(input.fix_first_items || input.fix_first_item),
|
|
@@ -305,6 +320,7 @@ export function buildUeyeRunReport(input = {}) {
|
|
|
305
320
|
const blockedReason = String(input.blocked_reason || '');
|
|
306
321
|
const comparisonResult = String(input.comparison_result || 'not-verified');
|
|
307
322
|
const hasImplementation = implementations.length > 0;
|
|
323
|
+
const deepVisualReview = buildUeyeDeepVisualReview(input.deep_visual_review);
|
|
308
324
|
const derivedTruth = blockedReason ? 'blocked'
|
|
309
325
|
: !references.length && !hasImplementation ? 'assumed'
|
|
310
326
|
: comparisonResult === 'matched' && hasImplementation ? 'verified'
|
|
@@ -319,7 +335,8 @@ export function buildUeyeRunReport(input = {}) {
|
|
|
319
335
|
blocked_reason: blockedReason
|
|
320
336
|
});
|
|
321
337
|
const shouldApplyDesignGate = gate.mode === 'strict' || gate.completion_claim === 'done' || gate.blockers.length > 0;
|
|
322
|
-
const
|
|
338
|
+
const deepTruthCap = deepVisualReview.truth_status === 'assumed' ? '' : deepVisualReview.truth_status;
|
|
339
|
+
const finalTruth = shouldApplyDesignGate ? weakestTruth(derivedTruth, gate.truth_status, deepTruthCap) : weakestTruth(derivedTruth, deepTruthCap);
|
|
323
340
|
return {
|
|
324
341
|
schema: 'yam.ueye-run-report.v1',
|
|
325
342
|
reference_sources: references,
|
|
@@ -329,13 +346,74 @@ export function buildUeyeRunReport(input = {}) {
|
|
|
329
346
|
truth_status: isTruthStatus(input.surface_context?.truth_status) ? input.surface_context?.truth_status : finalTruth
|
|
330
347
|
}),
|
|
331
348
|
design_completion_gate: gate,
|
|
349
|
+
deep_visual_review: deepVisualReview,
|
|
332
350
|
comparison_result: comparisonResult,
|
|
333
351
|
design_quality: String(input.design_quality || 'not-checked'),
|
|
334
352
|
blocked_reason: blockedReason,
|
|
335
|
-
next_action: String(input.next_action || gate.blockers[0] || (finalTruth === 'verified' ? 'no action required' : 'capture or provide implementation screenshot before claiming verified visual status')),
|
|
353
|
+
next_action: String(input.next_action || gate.blockers[0] || deepVisualReview.blockers[0] || (finalTruth === 'verified' ? 'no action required' : 'capture or provide implementation screenshot before claiming verified visual status')),
|
|
336
354
|
truth_status: isTruthStatus(input.truth_status) ? input.truth_status : finalTruth
|
|
337
355
|
};
|
|
338
356
|
}
|
|
357
|
+
export function buildUeyeDeepVisualReview(input = {}) {
|
|
358
|
+
const acceptanceCriteria = asList(input.acceptance_criteria || input.acceptance_criterion);
|
|
359
|
+
const touchedFiles = asList(input.touched_files || input.touched_file);
|
|
360
|
+
const readFiles = asList(input.read_files || input.read_file);
|
|
361
|
+
const verifiedFiles = asList(input.verified_files || input.verified_file);
|
|
362
|
+
const skippedChecks = asList(input.skipped_checks || input.skipped_check);
|
|
363
|
+
const residualRisks = asList(input.residual_risks || input.residual_risk);
|
|
364
|
+
const deepVisualChecks = asList(input.deep_visual_checks || input.deep_visual_check);
|
|
365
|
+
const designSystemEvidence = asList(input.design_system_evidence || input.design_system);
|
|
366
|
+
const implementationEvidence = asList(input.implementation_evidence || input.implementation_evidence_item);
|
|
367
|
+
const stateMatrix = buildStateMatrix(input.state_matrix, input);
|
|
368
|
+
const stopCondition = shortText(input.stop_condition);
|
|
369
|
+
const resumeHint = shortText(input.resume_hint);
|
|
370
|
+
const blockers = [
|
|
371
|
+
...asList(input.blockers || input.blocked),
|
|
372
|
+
...(Object.values(stateMatrix).some((status) => status === 'fail' || status === 'blocked') ? ['state_matrix: fix failed or blocked UI states before claiming done'] : [])
|
|
373
|
+
];
|
|
374
|
+
const warnings = [
|
|
375
|
+
...asList(input.warnings || input.warning),
|
|
376
|
+
...skippedChecks.map((check) => `skipped: ${check}`),
|
|
377
|
+
...residualRisks.map((risk) => `risk: ${risk}`),
|
|
378
|
+
...(acceptanceCriteria.length && !implementationEvidence.length ? ['implementation_evidence: record how the UI was checked against acceptance criteria'] : [])
|
|
379
|
+
];
|
|
380
|
+
const hasAnySignal = Boolean(acceptanceCriteria.length ||
|
|
381
|
+
touchedFiles.length ||
|
|
382
|
+
readFiles.length ||
|
|
383
|
+
verifiedFiles.length ||
|
|
384
|
+
skippedChecks.length ||
|
|
385
|
+
residualRisks.length ||
|
|
386
|
+
stopCondition ||
|
|
387
|
+
resumeHint ||
|
|
388
|
+
deepVisualChecks.length ||
|
|
389
|
+
designSystemEvidence.length ||
|
|
390
|
+
implementationEvidence.length ||
|
|
391
|
+
Object.keys(stateMatrix).length);
|
|
392
|
+
const truth = blockers.length ? 'blocked'
|
|
393
|
+
: hasAnySignal && skippedChecks.length ? 'partial'
|
|
394
|
+
: hasAnySignal && implementationEvidence.length ? 'verified'
|
|
395
|
+
: hasAnySignal ? 'partial'
|
|
396
|
+
: 'assumed';
|
|
397
|
+
return {
|
|
398
|
+
schema: 'yam.ueye-deep-visual-review.v1',
|
|
399
|
+
acceptance_criteria: acceptanceCriteria,
|
|
400
|
+
touched_files: touchedFiles,
|
|
401
|
+
read_files: readFiles,
|
|
402
|
+
verified_files: verifiedFiles,
|
|
403
|
+
skipped_checks: skippedChecks,
|
|
404
|
+
residual_risks: residualRisks,
|
|
405
|
+
stop_condition: stopCondition,
|
|
406
|
+
resume_hint: resumeHint,
|
|
407
|
+
deep_visual_checks: deepVisualChecks,
|
|
408
|
+
design_system_evidence: designSystemEvidence,
|
|
409
|
+
state_matrix: stateMatrix,
|
|
410
|
+
implementation_evidence: implementationEvidence,
|
|
411
|
+
blockers,
|
|
412
|
+
warnings,
|
|
413
|
+
next_action: shortText(input.next_action || blockers[0] || warnings[0] || (hasAnySignal ? 'continue with the recorded Ueye verification boundary' : 'record acceptance criteria and visual evidence when Ueye needs deep verification')),
|
|
414
|
+
truth_status: isTruthStatus(input.truth_status) ? input.truth_status : truth
|
|
415
|
+
};
|
|
416
|
+
}
|
|
339
417
|
function buildStudyNoteSection(section, fallback, kind) {
|
|
340
418
|
const source = section && typeof section === 'object' ? section : fallback;
|
|
341
419
|
const code = shortText(source.code);
|
|
@@ -432,6 +510,50 @@ function normalizeLoopEvidenceLevel(value = '') {
|
|
|
432
510
|
return text;
|
|
433
511
|
return 'none';
|
|
434
512
|
}
|
|
513
|
+
function normalizeReadinessState(value = '') {
|
|
514
|
+
const text = String(value || '').toLowerCase().replace(/[-\s]/g, '_');
|
|
515
|
+
if (['usable', 'degraded', 'blocked', 'unknown'].includes(text))
|
|
516
|
+
return text;
|
|
517
|
+
return 'unknown';
|
|
518
|
+
}
|
|
519
|
+
function buildStateMatrix(rawStateMatrix = null, input = {}) {
|
|
520
|
+
const result = {};
|
|
521
|
+
if (rawStateMatrix && typeof rawStateMatrix === 'object' && !Array.isArray(rawStateMatrix)) {
|
|
522
|
+
for (const [key, value] of Object.entries(rawStateMatrix)) {
|
|
523
|
+
const name = shortText(key, 80);
|
|
524
|
+
if (name)
|
|
525
|
+
result[name] = normalizeStateCheckStatus(value);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
for (const item of asList(input.state_check)) {
|
|
529
|
+
const [name = '', rawStatus = 'checked'] = item.split(':');
|
|
530
|
+
const key = shortText(name, 80);
|
|
531
|
+
if (key)
|
|
532
|
+
result[key] = normalizeStateCheckStatus(rawStatus);
|
|
533
|
+
}
|
|
534
|
+
for (const key of ['default', 'loading', 'error', 'empty', 'disabled', 'hover', 'focus', 'mobile']) {
|
|
535
|
+
const value = input[`${key}_state`];
|
|
536
|
+
if (value !== undefined)
|
|
537
|
+
result[key] = normalizeStateCheckStatus(value);
|
|
538
|
+
}
|
|
539
|
+
return result;
|
|
540
|
+
}
|
|
541
|
+
function normalizeStateCheckStatus(value = '') {
|
|
542
|
+
const text = String(value || '').toLowerCase().replace(/[-\s]/g, '_');
|
|
543
|
+
if (['pass', 'checked', 'verified', 'ok'].includes(text))
|
|
544
|
+
return 'pass';
|
|
545
|
+
if (['fail', 'failed', 'broken'].includes(text))
|
|
546
|
+
return 'fail';
|
|
547
|
+
if (['blocked', 'missing'].includes(text))
|
|
548
|
+
return 'blocked';
|
|
549
|
+
if (['skipped', 'skip'].includes(text))
|
|
550
|
+
return 'skipped';
|
|
551
|
+
if (['partial', 'needs_polish', 'warning'].includes(text))
|
|
552
|
+
return 'partial';
|
|
553
|
+
if (['not_checked', 'unknown'].includes(text))
|
|
554
|
+
return 'not_checked';
|
|
555
|
+
return shortText(value, 80) || 'checked';
|
|
556
|
+
}
|
|
435
557
|
function shortText(value = '', limit = 240) {
|
|
436
558
|
const text = String(value || '').trim().replace(/\s+/g, ' ');
|
|
437
559
|
if (text.length <= limit)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yam-flow",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Progressive proof-first agent flow: start fast, deepen deliberately, stay honest by design.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "0kim0bos",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"pack:dry-run": "npm pack --dry-run",
|
|
60
60
|
"publish:dry": "npm publish --dry-run --access public",
|
|
61
61
|
"forbidden-names:check": "node ./scripts/check-forbidden-names.mjs",
|
|
62
|
+
"study-note:check": "node ./dist/bin/yam.js study-note check --json",
|
|
62
63
|
"package-boundary:check": "node ./scripts/check-package-boundary.mjs",
|
|
63
64
|
"dist:freshness": "node ./scripts/check-dist-freshness.mjs",
|
|
64
65
|
"registry:check": "node ./scripts/check-registry-version.mjs",
|
|
@@ -4,10 +4,10 @@ Every `yam` route should end with a compact handoff that helps the next run avoi
|
|
|
4
4
|
|
|
5
5
|
## Required Closing Check
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Always keep final reports short. Include these when they apply:
|
|
8
8
|
|
|
9
9
|
- What changed or what was found.
|
|
10
|
-
- Change insight for non-specialists: what the touched code does,
|
|
10
|
+
- Change insight for non-specialists: what the touched code or artifact does, what role it has, where it runs or is read, what changed, what behavior is expected, one useful syntax/structure insight, and what remains uncertain.
|
|
11
11
|
- What verification ran.
|
|
12
12
|
- What was not checked.
|
|
13
13
|
- Truth status, when verification or runtime claims matter.
|
|
@@ -16,7 +16,7 @@ Include these when they are useful and keep them short:
|
|
|
16
16
|
- Context pressure or cleanup findings when they could affect the next run.
|
|
17
17
|
- Publish blocker evidence when npm/release work fails.
|
|
18
18
|
- Structured diagnostic next action, when a check found a concrete next step.
|
|
19
|
-
- Study Note
|
|
19
|
+
- Study Note whenever code, config, release metadata, documentation, or project artifacts changed, even if no yam skill was explicitly invoked. This item is required for changed artifacts, not optional.
|
|
20
20
|
- Remaining tasks.
|
|
21
21
|
- Fix-first items before planned tasks.
|
|
22
22
|
- Recommended direction and why that next step matters when the handoff would otherwise be ambiguous.
|
|
@@ -58,15 +58,21 @@ Examples:
|
|
|
58
58
|
|
|
59
59
|
## Study Note
|
|
60
60
|
|
|
61
|
-
Use this
|
|
61
|
+
Use this whenever implementation changed code or any project artifact changed:
|
|
62
62
|
|
|
63
|
-
- What code
|
|
64
|
-
- What role that code plays.
|
|
65
|
-
-
|
|
66
|
-
- What
|
|
67
|
-
-
|
|
63
|
+
- What code or artifact changed.
|
|
64
|
+
- What role that code or artifact plays in the project.
|
|
65
|
+
- Where it runs, renders, validates, builds, publishes, or is read.
|
|
66
|
+
- What was wrong, missing, unclear, or risky.
|
|
67
|
+
- What changed: before/after behavior or guidance, and what behavior the change should produce.
|
|
68
|
+
- One small syntax, API, schema, or structure insight for a non-specialist.
|
|
69
|
+
- Architecture hygiene when relevant: avoid dumping unrelated logic into `page.tsx`, one-off component CSS into `global.css`, or structured product data into broad DB `jsonb` blobs when existing project boundaries, scoped styles, typed tables, constraints, or indexes fit better.
|
|
70
|
+
- What was verified, or why verification is partial/skipped/blocked.
|
|
71
|
+
- What remains uncertain.
|
|
68
72
|
|
|
69
|
-
Keep it short. If the information is not known, say so instead of inventing it.
|
|
73
|
+
Keep it short: 4-7 lines for ordinary work, longer only when risk, learning value, `$deep`, `$mission`, release, runtime, or DB work justifies it. If the information is not known, say so instead of inventing it.
|
|
74
|
+
|
|
75
|
+
Use `references/study-note.md`.
|
|
70
76
|
|
|
71
77
|
## Handoff Direction
|
|
72
78
|
|
|
@@ -83,7 +89,7 @@ Use this when the next run needs a clear starting point:
|
|
|
83
89
|
- Avoidance note when a repeated mistake should be easy to spot; durable memory still uses explicit `yam memory add`.
|
|
84
90
|
- Owner route, scope owner, and side effects when more than one person or route may continue the work.
|
|
85
91
|
|
|
86
|
-
`yam loop report` can record this as a handoff artifact with `fix_first_items`, `remaining_tasks`, `recommended_direction`, `implementation_notes`, `why_this_next`, `blocked_by`, `covered_requirements`, `uncovered_requirements`, `blocked_kind`, `failure_cause`, `recovery_hint`, `safe_retry`, `evidence_level`, `evidence_stamp`, `owner_route`, `owner_scope`, `scope_owner`, `side_effects`, and `avoidance_note`.
|
|
92
|
+
`yam loop report` can record this as a handoff artifact with `fix_first_items`, `remaining_tasks`, `recommended_direction`, `implementation_notes`, `why_this_next`, `blocked_by`, `covered_requirements`, `uncovered_requirements`, `touched_files`, `read_files`, `verified_files`, `skipped_checks`, `stop_condition`, `resume_hint`, `readiness_state`, `blocked_kind`, `failure_cause`, `recovery_hint`, `safe_retry`, `evidence_level`, `evidence_stamp`, `owner_route`, `owner_scope`, `scope_owner`, `side_effects`, and `avoidance_note`.
|
|
87
93
|
|
|
88
94
|
## Route Weight
|
|
89
95
|
|
|
@@ -35,6 +35,19 @@ Verification: not run; change was limited to copy/CSS and inspected locally.
|
|
|
35
35
|
|
|
36
36
|
For larger work, include proof summary and residual risk.
|
|
37
37
|
|
|
38
|
+
Use the L0-L5 Verification Ladder:
|
|
39
|
+
|
|
40
|
+
- L0 stated.
|
|
41
|
+
- L1 inspected.
|
|
42
|
+
- L2 local check.
|
|
43
|
+
- L3 integrated.
|
|
44
|
+
- L4 release/runtime/visual proof.
|
|
45
|
+
- L5 bounded deep.
|
|
46
|
+
|
|
47
|
+
Escalate when the claim touches public release, UI done, auth, payment, DB, runtime, deployment, broad refactor, security, high learning value, or explicit user intent.
|
|
48
|
+
|
|
49
|
+
Bounded heavy verification must stop after the smallest meaningful proof set passes, or after three relevant checks have run and remaining uncertainty is listed as blocked, skipped, or remaining work.
|
|
50
|
+
|
|
38
51
|
## Runtime Guard
|
|
39
52
|
|
|
40
53
|
Runtime work needs stronger evidence because long-running processes can create false success:
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Study Note v3
|
|
2
|
+
|
|
3
|
+
Study Note is required whenever code, config, release metadata, documentation, or project artifacts changed, even if no yam skill was explicitly invoked.
|
|
4
|
+
|
|
5
|
+
The goal is not to write a tutorial for every change. The goal is to help a non-developer or non-specialist learn the meaning of the changed code or artifact a little at a time, without hiding uncertainty or padding the final report.
|
|
6
|
+
|
|
7
|
+
Study Note v3 adds two expectations:
|
|
8
|
+
|
|
9
|
+
- Explain where the changed code or artifact sits in the project flow: role, execution point, before/after behavior, and expected result.
|
|
10
|
+
- Add a small architecture hygiene check when implementation touched UI, styles, data shape, or storage boundaries.
|
|
11
|
+
|
|
12
|
+
## Final Report Shape
|
|
13
|
+
|
|
14
|
+
This is final-report writing guidance, not a new CLI JSON schema. The current CLI artifact remains `yam.study-note.v1` with `problem`, `change`, `why_it_matters`, `learning_note`, `limits`, and `truth_status`. When using `yam loop report`, map the guidance below into the existing fields and put unknowns in `limits`.
|
|
15
|
+
|
|
16
|
+
Keep the default note short: 4-7 lines for ordinary work, longer only for `$deep`, `$mission`, release, DB, runtime, or learning-heavy work.
|
|
17
|
+
|
|
18
|
+
Include:
|
|
19
|
+
|
|
20
|
+
- Touched code/artifact: the file, function, component, config, or artifact that changed.
|
|
21
|
+
- Code/artifact role: what that code or artifact does in the project.
|
|
22
|
+
- Execution point: when or where it runs, loads, renders, validates, builds, publishes, or is read by another tool.
|
|
23
|
+
- Problem meaning: what was wrong, missing, unclear, or risky, and how the symptom appeared.
|
|
24
|
+
- Before/after: what the old behavior or guidance allowed, and what the new behavior or guidance should produce.
|
|
25
|
+
- Syntax or structure insight: one small language, API, schema, or structure insight for a non-specialist.
|
|
26
|
+
- Verification note: what was checked, or why verification is partial/skipped/blocked.
|
|
27
|
+
- Limits: what is not known; do not invent missing cause, behavior, or verification.
|
|
28
|
+
|
|
29
|
+
When relevant, include an architecture hygiene line:
|
|
30
|
+
|
|
31
|
+
- UI hygiene: do not dump unrelated state, data loading, actions, formatting, and large helper logic into `page.tsx`; keep route files focused and move reusable or complex work into local components, hooks, utilities, or server actions that match the project pattern.
|
|
32
|
+
- CSS hygiene: do not dump one-off component styling into `global.css`; prefer existing tokens, component styles, modules, utility classes, or scoped styles unless the rule is genuinely global.
|
|
33
|
+
- Data hygiene: do not use a broad DB `jsonb` blob as the default answer for structured product data; prefer named columns, typed tables, constraints, indexes, and migrations when the data has stable meaning, query needs, security policy, or reporting value.
|
|
34
|
+
- Boundary hygiene: keep auth, payment, DB, secret, release, and public-facing surfaces explicit; note when a change did or did not touch those sensitive paths.
|
|
35
|
+
|
|
36
|
+
## Compact Example
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
Study Note:
|
|
40
|
+
- Touched code: `buildLoopReport`, the function that turns loop inputs into report JSON.
|
|
41
|
+
- Code role: it decides whether a loop can honestly say it is verified, partial, or blocked.
|
|
42
|
+
- Execution point: it runs when `yam loop report` builds the final report artifact.
|
|
43
|
+
- Before/after: before, unfinished requirements could be easy to miss; after, `uncovered_requirements` lowers the truth status to blocked and points the next action at the missing requirement.
|
|
44
|
+
- Syntax/structure: the code uses an array length check plus a conditional default to choose safer report fields.
|
|
45
|
+
- Verification: typecheck and CLI smoke covered the JSON shape.
|
|
46
|
+
- Hygiene: report logic stayed in the report builder instead of spreading status rules across unrelated command code.
|
|
47
|
+
- Limits: this does not infer requirements from prose; the agent or user still has to provide them.
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## When Nothing Changed
|
|
51
|
+
|
|
52
|
+
For pure Q&A, planning, scouting, or review with no changed artifact, do not force a Study Note. Say `No code or project artifact changed` when that prevents ambiguity.
|
|
53
|
+
|
|
54
|
+
## Tone
|
|
55
|
+
|
|
56
|
+
- Use plain language before implementation jargon.
|
|
57
|
+
- Explain the code's responsibility before explaining the patch.
|
|
58
|
+
- Explain the execution point before claiming behavior.
|
|
59
|
+
- Prefer one practical syntax or structure insight over broad teaching.
|
|
60
|
+
- Tie the note to evidence. If no check ran, say so.
|
|
61
|
+
- Keep remaining tasks separate from Study Note.
|
|
62
|
+
|
|
63
|
+
## What To Avoid
|
|
64
|
+
|
|
65
|
+
- Do not guess root cause when it was not verified.
|
|
66
|
+
- Do not over-explain common syntax when it distracts from the touched code.
|
|
67
|
+
- Do not turn every final report into a long lesson.
|
|
68
|
+
- Do not claim the user learned something; just leave a useful learning path.
|
|
69
|
+
- Do not present "put it all in `page.tsx`", "put it all in `global.css`", or "store it all in `jsonb`" as the easy default when project structure should carry the responsibility.
|
|
@@ -13,7 +13,8 @@ Every route carries a basic contract:
|
|
|
13
13
|
- use context packs or memory before broad re-reading
|
|
14
14
|
- verify only what was actually checked
|
|
15
15
|
- report remaining tasks and fix-first issues when useful
|
|
16
|
-
-
|
|
16
|
+
- include a Study Note when code, config, release metadata, documentation, or project artifacts changed
|
|
17
|
+
- explain what changed, what role it has, what behavior is expected, and one useful syntax or structure insight in plain language
|
|
17
18
|
- treat security as the first project lens
|
|
18
19
|
- preserve source boundaries when outside references shaped the judgment
|
|
19
20
|
|
|
@@ -26,6 +27,8 @@ Then depth increases by route:
|
|
|
26
27
|
- `$deep`: prove risky single-agent work with stronger runtime/tool evidence.
|
|
27
28
|
- `$mission`: coordinate real subagents/team lanes with cross-verification.
|
|
28
29
|
|
|
30
|
+
Verification should follow the L0-L5 ladder: stated, inspected, local check, integrated, release/runtime/visual proof, bounded deep. Serious claims can require serious evidence, but stop after the smallest meaningful proof set passes or after remaining uncertainty is clearly handed off.
|
|
31
|
+
|
|
29
32
|
## Surfaces To Wrap
|
|
30
33
|
|
|
31
34
|
- Local CLI/app readiness.
|
|
@@ -94,6 +97,8 @@ On demand:
|
|
|
94
97
|
|
|
95
98
|
- What the touched code or artifact is responsible for.
|
|
96
99
|
- What changed in behavior, contract, UI, or safety posture.
|
|
100
|
+
- What syntax, schema, or structure insight helps a non-specialist understand the change.
|
|
101
|
+
- What verification level supports the claim.
|
|
97
102
|
- Why the change matters to the product or user.
|
|
98
103
|
- What remains uncertain or unverified.
|
|
99
104
|
- What should be fixed first before the next planned task.
|
package/references/ueye-proof.md
CHANGED
|
@@ -26,12 +26,13 @@ Ueye is one route. It should not split into separate lite/deep skills. Use these
|
|
|
26
26
|
```bash
|
|
27
27
|
yam ueye capture --url http://localhost:3000 --out .yam/screens/home.png
|
|
28
28
|
yam ueye compare --reference ./reference.png --actual .yam/screens/home.png --json
|
|
29
|
-
yam ueye report --reference ./reference.png --actual .yam/screens/home.png --completion-claim done --design-quality pass --direction-locked --reference-read --states-checked --mobile-checked --contrast-checked --cta-checked --provider-context local --execution-surface in-app-browser --browser-surface in-app-browser --preserved-state --json
|
|
29
|
+
yam ueye report --reference ./reference.png --actual .yam/screens/home.png --acceptance-criterion "primary CTA remains visible on mobile" --design-system-evidence "uses existing button token" --implementation-evidence "browser screenshot reviewed" --state-check default:pass --state-check mobile:partial --completion-claim done --design-quality pass --direction-locked --reference-read --states-checked --mobile-checked --contrast-checked --cta-checked --provider-context local --execution-surface in-app-browser --browser-surface in-app-browser --preserved-state --json
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
- `capture` uses a project-local capture backend when present, then reports `blocked` instead of installing dependencies or pretending a screenshot exists.
|
|
33
33
|
- `compare` is local-only and dependency-free. It records hashes, dimensions, comparison result, and visual provenance. Different screenshots stay `partial`; exact file matches can be `verified`.
|
|
34
34
|
- `report` records the Ueye run as reference sources, implementation sources, comparison result, surface context, design quality, blocked reason, next action, and truth status.
|
|
35
|
+
- `report` can also record a deep visual review with acceptance criteria, touched/read/verified files, skipped checks, residual risks, stop condition, resume hint, design-system evidence, implementation evidence, and state matrix.
|
|
35
36
|
- `report` may include continuity fields when a previous review or screenshot is being rechecked.
|
|
36
37
|
- Without capture or user-provided screenshots, report implementation/source review separately from visual verification and cap the visual claim.
|
|
37
38
|
|
|
@@ -239,6 +240,46 @@ yam proof --route ueye --truth verified --visual "implementation screenshot evid
|
|
|
239
240
|
|
|
240
241
|
The design completion gate is a completion judgment. Keep actual source-screen proof in visual evidence, visual provenance, or a Ueye run report. Do not use self-reported gate fields to pretend a missing screenshot was captured.
|
|
241
242
|
|
|
243
|
+
### Deep Visual Review
|
|
244
|
+
|
|
245
|
+
Purpose: let Ueye carry Deep-grade UI verification when the work is serious, without forcing a separate route.
|
|
246
|
+
|
|
247
|
+
Use this when:
|
|
248
|
+
|
|
249
|
+
- The user asks for strong UI/UX verification.
|
|
250
|
+
- A done claim depends on multiple states, viewports, or design-system fit.
|
|
251
|
+
- A previous Ueye review needs a resume-ready handoff.
|
|
252
|
+
- Missing visual evidence should become an explicit residual risk instead of being hidden.
|
|
253
|
+
|
|
254
|
+
Minimum useful fields:
|
|
255
|
+
|
|
256
|
+
- `acceptance_criteria`
|
|
257
|
+
- `touched_files`
|
|
258
|
+
- `read_files`
|
|
259
|
+
- `verified_files`
|
|
260
|
+
- `skipped_checks`
|
|
261
|
+
- `residual_risks`
|
|
262
|
+
- `stop_condition`
|
|
263
|
+
- `resume_hint`
|
|
264
|
+
- `deep_visual_checks`
|
|
265
|
+
- `design_system_evidence`
|
|
266
|
+
- `state_matrix`
|
|
267
|
+
- `implementation_evidence`
|
|
268
|
+
- `truth_status`
|
|
269
|
+
|
|
270
|
+
State matrix examples:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
yam ueye report --state-check default:pass --state-check loading:pass --state-check error:partial --state-check mobile:blocked --json
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Truth rules:
|
|
277
|
+
|
|
278
|
+
- Failed or blocked state matrix rows block the deep visual review.
|
|
279
|
+
- Skipped checks and residual risks keep the result honest as `partial` unless other evidence still supports a narrower claim.
|
|
280
|
+
- Deep visual review evidence does not replace a real implementation screenshot when the claim needs visual proof.
|
|
281
|
+
- A stop condition should explain when to stop verifying; a resume hint should explain the next safe visual action.
|
|
282
|
+
|
|
242
283
|
### Review Continuity And Comparison Report
|
|
243
284
|
|
|
244
285
|
Use this when a Ueye task continues a previous visual review, rechecks a fix, or compares two review runs.
|
package/references/ueye.md
CHANGED
|
@@ -67,6 +67,7 @@ Use these when the task depends on visual truth, reference matching, or design q
|
|
|
67
67
|
4. Design Quality Review.
|
|
68
68
|
5. Review Continuity and Comparison Report.
|
|
69
69
|
6. Design Completion Gate.
|
|
70
|
+
7. Deep Visual Review, when Ueye needs Deep-grade verification.
|
|
70
71
|
|
|
71
72
|
Default bound:
|
|
72
73
|
|
|
@@ -168,6 +169,30 @@ Gate behavior:
|
|
|
168
169
|
- Missing required checks for a done claim should cap truth at partial.
|
|
169
170
|
- Only claim done when the gate says `ready_to_claim_done: true`.
|
|
170
171
|
|
|
172
|
+
### Deep Visual Review
|
|
173
|
+
|
|
174
|
+
Use when Ueye should stay in the UI/design route but needs stronger verification than a quick screenshot note.
|
|
175
|
+
|
|
176
|
+
Record:
|
|
177
|
+
|
|
178
|
+
- acceptance criteria for the visual claim.
|
|
179
|
+
- touched, read, and verified files.
|
|
180
|
+
- skipped checks and why they are acceptable or still risky.
|
|
181
|
+
- residual risks.
|
|
182
|
+
- stop condition for bounded verification.
|
|
183
|
+
- resume hint for the next visual pass.
|
|
184
|
+
- deep visual checks that ran.
|
|
185
|
+
- design-system evidence such as tokens, components, or nearby patterns read.
|
|
186
|
+
- implementation evidence such as screenshot, browser check, source inspection, or responsive check.
|
|
187
|
+
- state matrix for default, loading, error, empty, disabled, hover/focus, and mobile states when relevant.
|
|
188
|
+
|
|
189
|
+
Behavior:
|
|
190
|
+
|
|
191
|
+
- Failed or blocked state matrix rows should block the deep visual review.
|
|
192
|
+
- Skipped checks and residual risks should keep the claim partial unless the remaining claim is narrow and explicitly bounded.
|
|
193
|
+
- Deep visual review does not replace implementation screenshot evidence when the claim depends on seeing the real screen.
|
|
194
|
+
- Stop conditions prevent endless visual proof loops; resume hints make the next pass cheap to restart.
|
|
195
|
+
|
|
171
196
|
### Review Continuity and Comparison Report
|
|
172
197
|
|
|
173
198
|
Use when a screen has more than one visual pass, a reference needs follow-up, or a previous Ueye report should stay connected to the next one.
|
|
@@ -222,9 +247,10 @@ Keep this metadata descriptive. It should support honest visual claims, not forc
|
|
|
222
247
|
7. Reference vs Implementation Matrix when reference fidelity matters.
|
|
223
248
|
8. Design Quality Review.
|
|
224
249
|
9. Design Completion Gate before any done claim.
|
|
225
|
-
10.
|
|
226
|
-
11.
|
|
227
|
-
12.
|
|
250
|
+
10. Deep Visual Review when the work needs acceptance criteria, state matrix, skipped checks, residual risks, stop condition, or resume hint.
|
|
251
|
+
11. Review Continuity and Comparison Report when the work spans multiple passes.
|
|
252
|
+
12. P0/P1 closeout.
|
|
253
|
+
13. Truth status.
|
|
228
254
|
|
|
229
255
|
## Truth Caps
|
|
230
256
|
|