yam-flow 2.1.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.
@@ -8,6 +8,7 @@ export type RuntimeClaim = 'not_started' | 'started' | 'observed' | 'stopped' |
8
8
  export type LoopStageStatus = 'passed' | 'failed' | 'blocked' | 'skipped' | 'partial' | 'pending' | 'recorded';
9
9
  export type LoopEvidenceLevel = 'none' | 'fixture' | 'smoke' | 'local' | 'real';
10
10
  export type ToolIntent = 'read_only' | 'write' | 'destructive' | 'runtime' | 'visual' | 'publish';
11
+ export type ReadinessState = 'usable' | 'degraded' | 'blocked' | 'unknown';
11
12
  export interface SafetyHit {
12
13
  level: SafetyLevel;
13
14
  reason: string;
@@ -161,6 +162,13 @@ export interface LoopReport {
161
162
  evidence_level: LoopEvidenceLevel;
162
163
  evidence_stamp: string;
163
164
  source_digest: string;
165
+ touched_files: string[];
166
+ read_files: string[];
167
+ verified_files: string[];
168
+ skipped_checks: string[];
169
+ stop_condition: string;
170
+ resume_hint: string;
171
+ readiness_state: ReadinessState;
164
172
  covered_requirements: string[];
165
173
  uncovered_requirements: string[];
166
174
  blockers: string[];
@@ -191,14 +199,35 @@ export interface UeyeRunReport {
191
199
  implementation_sources: UeyeVisualProvenance[];
192
200
  surface_context: UeyeSurfaceContext;
193
201
  design_completion_gate: UeyeDesignCompletionGate;
202
+ deep_visual_review: UeyeDeepVisualReview;
194
203
  comparison_result: string;
195
204
  design_quality: string;
196
205
  blocked_reason: string;
197
206
  next_action: string;
198
207
  truth_status: TruthStatus;
199
208
  }
200
- export interface UeyeRunReportInput extends Partial<Omit<UeyeRunReport, 'design_completion_gate'>> {
209
+ export interface UeyeRunReportInput extends Partial<Omit<UeyeRunReport, 'design_completion_gate' | 'deep_visual_review'>> {
201
210
  design_completion_gate?: Partial<UeyeDesignCompletionGate> & Record<string, unknown>;
211
+ deep_visual_review?: Partial<UeyeDeepVisualReview> & Record<string, unknown>;
212
+ }
213
+ export interface UeyeDeepVisualReview {
214
+ schema: 'yam.ueye-deep-visual-review.v1';
215
+ acceptance_criteria: string[];
216
+ touched_files: string[];
217
+ read_files: string[];
218
+ verified_files: string[];
219
+ skipped_checks: string[];
220
+ residual_risks: string[];
221
+ stop_condition: string;
222
+ resume_hint: string;
223
+ deep_visual_checks: string[];
224
+ design_system_evidence: string[];
225
+ state_matrix: Record<string, string>;
226
+ implementation_evidence: string[];
227
+ blockers: string[];
228
+ warnings: string[];
229
+ next_action: string;
230
+ truth_status: TruthStatus;
202
231
  }
203
232
  export interface MediaGenerationProof {
204
233
  schema: 'yam.media-generation-proof.v1';
@@ -294,6 +323,7 @@ export declare function buildRuntimeBackendEvidence(input?: Partial<RuntimeBacke
294
323
  export declare function buildStudyNote(input?: Partial<StudyNote> & Record<string, unknown>): StudyNote;
295
324
  export declare function buildLoopReport(input?: Partial<LoopReport> & Record<string, unknown>): LoopReport;
296
325
  export declare function buildUeyeRunReport(input?: UeyeRunReportInput): UeyeRunReport;
326
+ export declare function buildUeyeDeepVisualReview(input?: Partial<UeyeDeepVisualReview> & Record<string, unknown>): UeyeDeepVisualReview;
297
327
  export declare function buildMediaGenerationProof(input?: Partial<MediaGenerationProof>): MediaGenerationProof;
298
328
  export declare function isTruthStatus(value?: unknown): value is TruthStatus;
299
329
  export declare function weakestTruth(...statuses: unknown[]): TruthStatus;
@@ -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 truth = requestedTruth ? weakestTruth(requestedTruth, derivedTruth) : derivedTruth;
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 finalTruth = shouldApplyDesignGate ? weakestTruth(derivedTruth, gate.truth_status) : derivedTruth;
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.1.0",
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",
@@ -7,7 +7,7 @@ Every `yam` route should end with a compact handoff that helps the next run avoi
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 or artifact does, what role it has, what changed, what behavior is expected, and what remains uncertain.
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.
@@ -62,9 +62,11 @@ Use this whenever implementation changed code or any project artifact changed:
62
62
 
63
63
  - What code or artifact changed.
64
64
  - What role that code or artifact plays in the project.
65
+ - Where it runs, renders, validates, builds, publishes, or is read.
65
66
  - What was wrong, missing, unclear, or risky.
66
- - What changed and what behavior the change should produce.
67
+ - What changed: before/after behavior or guidance, and what behavior the change should produce.
67
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.
68
70
  - What was verified, or why verification is partial/skipped/blocked.
69
71
  - What remains uncertain.
70
72
 
@@ -87,7 +89,7 @@ Use this when the next run needs a clear starting point:
87
89
  - Avoidance note when a repeated mistake should be easy to spot; durable memory still uses explicit `yam memory add`.
88
90
  - Owner route, scope owner, and side effects when more than one person or route may continue the work.
89
91
 
90
- `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`.
91
93
 
92
94
  ## Route Weight
93
95
 
@@ -1,8 +1,13 @@
1
- # Study Note
1
+ # Study Note v3
2
2
 
3
3
  Study Note is required whenever code, config, release metadata, documentation, or project artifacts changed, even if no yam skill was explicitly invoked.
4
4
 
5
- The goal is not to write a tutorial for every change. The goal is to help a non-specialist learn the meaning of the changed code a little at a time, without hiding uncertainty or padding the final report.
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.
6
11
 
7
12
  ## Final Report Shape
8
13
 
@@ -14,23 +19,32 @@ Include:
14
19
 
15
20
  - Touched code/artifact: the file, function, component, config, or artifact that changed.
16
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.
17
23
  - Problem meaning: what was wrong, missing, unclear, or risky, and how the symptom appeared.
18
- - Change meaning: what changed and what behavior the change should produce.
24
+ - Before/after: what the old behavior or guidance allowed, and what the new behavior or guidance should produce.
19
25
  - Syntax or structure insight: one small language, API, schema, or structure insight for a non-specialist.
20
26
  - Verification note: what was checked, or why verification is partial/skipped/blocked.
21
27
  - Limits: what is not known; do not invent missing cause, behavior, or verification.
22
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
+
23
36
  ## Compact Example
24
37
 
25
38
  ```text
26
39
  Study Note:
27
40
  - Touched code: `buildLoopReport`, the function that turns loop inputs into report JSON.
28
41
  - Code role: it decides whether a loop can honestly say it is verified, partial, or blocked.
29
- - Problem meaning: a report could include unfinished requirements without making the completion risk obvious.
30
- - Change meaning: `uncovered_requirements` now lowers the truth status to blocked and points the next action at the missing requirement.
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.
31
44
  - Syntax/structure: the code uses an array length check plus a conditional default to choose safer report fields.
32
45
  - Verification: typecheck and CLI smoke covered the JSON shape.
33
- - Limits: this does not infer requirements from prose; the agent/user still has to provide them.
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.
34
48
  ```
35
49
 
36
50
  ## When Nothing Changed
@@ -41,6 +55,7 @@ For pure Q&A, planning, scouting, or review with no changed artifact, do not for
41
55
 
42
56
  - Use plain language before implementation jargon.
43
57
  - Explain the code's responsibility before explaining the patch.
58
+ - Explain the execution point before claiming behavior.
44
59
  - Prefer one practical syntax or structure insight over broad teaching.
45
60
  - Tie the note to evidence. If no check ran, say so.
46
61
  - Keep remaining tasks separate from Study Note.
@@ -51,3 +66,4 @@ For pure Q&A, planning, scouting, or review with no changed artifact, do not for
51
66
  - Do not over-explain common syntax when it distracts from the touched code.
52
67
  - Do not turn every final report into a long lesson.
53
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.
@@ -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.
@@ -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. Review Continuity and Comparison Report when the work spans multiple passes.
226
- 11. P0/P1 closeout.
227
- 12. Truth status.
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
 
@@ -52,7 +52,7 @@ Use `references/db-supabase-safety-lite.md` for destructive DB/Supabase, migrati
52
52
  Use `references/current-docs.md` when SDK/API/cloud-service behavior may be current or version-sensitive.
53
53
  Use `references/trust-kernel.md` when the task asks how yam prevents false completion or fake real proof claims.
54
54
  Use `references/honest-completion.md`; do not overclaim verification, runtime, cleanup, or visual proof.
55
- Use `references/study-note.md` when any code, config, docs, release metadata, or project artifact changed.
55
+ Use `references/study-note.md` when any code, config, docs, release metadata, or project artifact changed; include role, execution point, before/after, expected behavior, one syntax/structure insight, verification, limits, and architecture hygiene when relevant.
56
56
  Use `references/final-report.md` to close with remaining tasks and fix-first items when useful.
57
57
  Use `references/token-budget-reporter.md` when a run needs measured budget feedback.
58
58
 
@@ -77,7 +77,8 @@ Stop condition:
77
77
  Include:
78
78
 
79
79
  - What was changed or reviewed.
80
- - Study Note for changed artifacts: what changed, what role it has, what was wrong or missing, what behavior is expected, one useful syntax/structure insight, what was verified, and what remains uncertain.
80
+ - Study Note for changed artifacts: what changed, what role it has, where it runs or is read, what was wrong or missing, before/after behavior, what behavior is expected, one useful syntax/structure insight, what was verified, and what remains uncertain.
81
+ - Architecture hygiene when relevant: flag if the change risks dumping unrelated logic into `page.tsx`, one-off component CSS into `global.css`, or structured product data into broad DB `jsonb` blobs.
81
82
  - Evidence gathered.
82
83
  - Truth status.
83
84
  - Blockers or remaining risk.
@@ -87,7 +87,7 @@ Use `references/db-supabase-safety-lite.md` for destructive DB/Supabase, migrati
87
87
  Use `references/current-docs.md` when any lane depends on current SDK/API/cloud-service behavior.
88
88
  Use `references/verification-levels.md` for L4-L5 mission proof boundaries.
89
89
  Use `references/honest-completion.md`; do not overclaim.
90
- Use `references/study-note.md` for every lane that changes code, config, docs, release metadata, or project artifacts.
90
+ Use `references/study-note.md` for every lane that changes code, config, docs, release metadata, or project artifacts; include role, execution point, before/after, expected behavior, one syntax/structure insight, verification, limits, and architecture hygiene when relevant.
91
91
  Use `references/final-report.md` to close with remaining tasks and fix-first items.
92
92
  Use `references/token-budget-reporter.md` when budget drift matters.
93
93
 
@@ -110,7 +110,8 @@ Report:
110
110
 
111
111
  - What the mission changed.
112
112
  - Role/cross-verification summary.
113
- - Study Note for any lane that changed code, config, docs, release metadata, or project artifacts: what changed, what role it has, what was wrong or missing, what behavior is expected, one useful syntax/structure insight, what was verified, and what remains uncertain.
113
+ - Study Note for any lane that changed code, config, docs, release metadata, or project artifacts: what changed, what role it has, where it runs or is read, what was wrong or missing, before/after behavior, what behavior is expected, one useful syntax/structure insight, what was verified, and what remains uncertain.
114
+ - Architecture hygiene when relevant: flag if the change risks dumping unrelated logic into `page.tsx`, one-off component CSS into `global.css`, or structured product data into broad DB `jsonb` blobs.
114
115
  - Evidence gathered.
115
116
  - Truth status.
116
117
  - Cleanup status.
@@ -70,7 +70,7 @@ Use `references/truth-matrix.md` for truth labels.
70
70
  Use `references/db-supabase-safety-lite.md` when a command or prompt contains DB/Supabase mutation signals.
71
71
  Use `references/token-economy.md` to keep context small.
72
72
  Use `references/context-reuse.md` before broad project reading.
73
- Use `references/study-note.md` when any code, config, docs, or project artifact changed.
73
+ Use `references/study-note.md` when any code, config, docs, or project artifact changed; include role, execution point, before/after, expected behavior, one syntax/structure insight, verification, limits, and architecture hygiene when relevant.
74
74
  Use `references/final-report.md` to close with remaining tasks and fix-first items when useful.
75
75
  Use `references/token-budget-reporter.md` when a run needs measured budget feedback.
76
76
 
@@ -79,7 +79,8 @@ Use `references/token-budget-reporter.md` when a run needs measured budget feedb
79
79
  Keep it compact:
80
80
 
81
81
  - What changed or what the scan found.
82
- - Study Note when code, config, docs, or project artifacts changed: what changed, what role it has, what was wrong or missing, what behavior is expected, one useful syntax/structure insight, what was verified, and what remains uncertain.
82
+ - Study Note when code, config, docs, or project artifacts changed: what changed, what role it has, where it runs or is read, what was wrong or missing, before/after behavior, what behavior is expected, one useful syntax/structure insight, what was verified, and what remains uncertain.
83
+ - Architecture hygiene when relevant: flag if the change risks dumping unrelated logic into `page.tsx`, one-off component CSS into `global.css`, or structured product data into broad DB `jsonb` blobs.
83
84
  - What was checked.
84
85
  - What was skipped, blocked, or still risky.
85
86
  - Handoff when useful: fix-first items, remaining tasks, recommended direction, why that next step matters, blocker kind, safe retry, evidence level/stamp, and owner scope when another route or person may continue.
@@ -147,7 +147,7 @@ Use these artifacts for reference-led implementation or serious visual review. K
147
147
 
148
148
  Use `references/ueye.md` and `references/ui-quality.md`.
149
149
  Use `references/verification-levels.md` for visual proof levels and done-claim truth caps.
150
- Use `references/study-note.md` when UI code, design docs, config, or project artifacts changed.
150
+ Use `references/study-note.md` when UI code, design docs, config, or project artifacts changed; include role, execution point, before/after, expected behavior, one syntax/structure insight, verification, limits, and architecture hygiene when relevant.
151
151
  Always consider:
152
152
 
153
153
  - Direction fit.
@@ -173,6 +173,7 @@ Report:
173
173
  - Review continuity/comparison result when this continues a prior Ueye run.
174
174
  - P0-P3 issues or confirmation that no blockers were found.
175
175
  - States/viewports checked.
176
- - Study Note when UI code, design docs, config, or project artifacts changed: what changed, what role it has, what was wrong or missing, what behavior is expected, one useful syntax/structure insight, what was verified, and what remains uncertain.
176
+ - Study Note when UI code, design docs, config, or project artifacts changed: what changed, what role it has, where it runs or is read, what was wrong or missing, before/after behavior, what behavior is expected, one useful syntax/structure insight, what was verified, and what remains uncertain.
177
+ - Architecture hygiene when relevant: flag if the change risks dumping unrelated UI logic into `page.tsx`, one-off component styling into `global.css`, or structured product data into broad DB `jsonb` blobs.
177
178
  - Truth status and visual verification cap.
178
179
  - Handoff when useful: fix-first visual issues, remaining tasks, recommended direction, why that next step matters, blocker kind, safe retry, evidence level/stamp, and owner scope when another route or person may continue.