yam-flow 2.1.0 → 2.2.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.
@@ -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.1",
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
 
@@ -0,0 +1,150 @@
1
+ # Scout Wide Scan
2
+
3
+ Use this reference when `$scout` needs broad search, powerful outside patterns, ecosystem comparison, agent/harness discovery, or source-heavy direction setting.
4
+
5
+ ## Activation
6
+
7
+ Use wide scan when the user asks for:
8
+
9
+ - Broad search or "find powerful patterns".
10
+ - Tool, library, agent, harness, protocol, or market landscape comparison.
11
+ - Third-party perspective before committing to a direction.
12
+ - Evidence from multiple source classes.
13
+ - Ideas worth reworking into yam style.
14
+
15
+ Do not use wide scan for:
16
+
17
+ - Stable direct answers.
18
+ - Small implementation tasks.
19
+ - Local code questions that a focused file read answers.
20
+ - Heavy verification; use `$deep`.
21
+ - Real subagent/team execution; use `$mission` unless the user explicitly asks for parallel agent work inside the current route and the environment supports it.
22
+
23
+ ## Scan Lanes
24
+
25
+ 1. Decision frame: name the decision, audience, constraints, and what would change the recommendation.
26
+ 2. Source map: decide which source classes are needed before reading deeply.
27
+ 3. Acquisition: gather enough sources; recover blocked high-signal sources only when needed.
28
+ 4. Triage: rank sources by authority, freshness, relevance, bias, and directness.
29
+ 5. Comparison: compare by fit, risk, cost, implementation effort, durability, and evidence quality.
30
+ 6. Opposition pass: name the strongest argument against the preferred direction.
31
+ 7. Synthesis: compress into a practical recommendation and yam-style rework ideas.
32
+ 8. Evidence ledger: record the important claims, evidence, confidence, and uncertainty.
33
+
34
+ ## Source Map
35
+
36
+ Prefer a small balanced map over a large pile:
37
+
38
+ - Official or primary source: docs, specs, vendor pages, source repos, standards.
39
+ - Implementation evidence: source code, examples, package metadata, changelogs, local files.
40
+ - Third-party analysis: credible writeups, benchmarks, incident reports, adoption notes.
41
+ - Community evidence: issues, forum posts, social reports, user complaints; useful but lower trust.
42
+ - Contrarian source: the best reason the attractive option may be wrong.
43
+ - Local evidence: project constraints, existing route boundaries, installed tools, package scripts.
44
+
45
+ Default focused scout remains 3-7 high-signal sources. Wide scan may use more, but stop once the decision is supported and marginal sources repeat what is already known.
46
+
47
+ ## Acquisition Ladder
48
+
49
+ 1. Use local project context packs and relevant local files first when the decision is project-specific.
50
+ 2. Use official or primary docs for current SDK/API/cloud-service behavior.
51
+ 3. Use ordinary web search or documentation search for accessible external sources.
52
+ 4. Use platform-specific public APIs or feeds when they are cleaner than rendered pages.
53
+ 5. Use blocked-source fallback only for high-signal sources that ordinary access cannot read.
54
+
55
+ Blocked-source fallback:
56
+
57
+ - Treat `insane-search` as a source acquisition subroutine.
58
+ - Use it for blocked/WAF/platform-protected sources such as X, Reddit, YouTube, Naver, LinkedIn, Medium, Substack, or similar pages when they matter to the decision.
59
+ - Preserve provenance: original URL, access path, trace or fallback note, and whether the content came from API, cache, feed, rendered HTML, or archive.
60
+ - Do not use it for ordinary searches that normal web search can handle.
61
+ - Do not treat authentication, paywall, private data, or rate-limit boundaries as something to force through.
62
+
63
+ ## Evidence Ledger
64
+
65
+ Use a compact ledger for broad scans:
66
+
67
+ ```text
68
+ Claim:
69
+ Evidence:
70
+ Source class:
71
+ Confidence: high / medium / low
72
+ Uncertainty:
73
+ Decision impact:
74
+ ```
75
+
76
+ Keep the ledger short. Include only claims that materially shape the recommendation.
77
+
78
+ ## Parallel Research
79
+
80
+ Scout stays single-agent by default.
81
+
82
+ Use real subagents or parallel agent lanes only when all are true:
83
+
84
+ - The user explicitly asked for subagents, delegation, or parallel agent work.
85
+ - The available environment provides real subagent tools.
86
+ - The questions are independent and self-contained.
87
+ - The results can be summarized without flooding the main context.
88
+
89
+ Good lanes:
90
+
91
+ - Official/docs lane.
92
+ - Implementation/source lane.
93
+ - Community/contrarian lane.
94
+ - Security/risk lane.
95
+
96
+ Bad lanes:
97
+
98
+ - Multiple agents reading the same sources.
99
+ - Delegating the immediate blocking question.
100
+ - Role-playing subagents when no real subagent tool is available.
101
+ - Turning a normal scout into `$mission`.
102
+
103
+ ## Opposition Pass
104
+
105
+ Before the recommendation, ask:
106
+
107
+ - What would make the best pick fail in this project?
108
+ - Which source is least trustworthy or most stale?
109
+ - What is the strongest cheaper/simpler alternative?
110
+ - What security or operational risk is easy to miss?
111
+ - What would we need to verify before implementation?
112
+
113
+ Report the opposition pass briefly. It should sharpen the recommendation, not bury it.
114
+
115
+ ## Output
116
+
117
+ Use the normal Scout shape, adding only the sections that help:
118
+
119
+ - Best pick.
120
+ - Objective judgment.
121
+ - Subjective judgment.
122
+ - Macro / realistic / future view.
123
+ - Alternatives.
124
+ - Risks.
125
+ - Security lens.
126
+ - Opposition pass.
127
+ - Evidence ledger.
128
+ - Ideas to rework into yam style.
129
+ - Sources or local evidence.
130
+ - Remaining tasks.
131
+
132
+ ## Source Clarity
133
+
134
+ When outside systems shape the answer, preserve boundaries:
135
+
136
+ - Fact: what the source says or what local files show.
137
+ - Inference: what follows from comparing sources.
138
+ - Opinion: taste, product instinct, or likely user perception.
139
+ - Recommendation: the action Scout would take.
140
+
141
+ Useful outside patterns to rework, not copy wholesale:
142
+
143
+ - Agent Skills: progressive disclosure through `SKILL.md` plus optional references/scripts/assets.
144
+ - Deep Research: multi-step search, backtracking, citations, and synthesis.
145
+ - Coding-agent subagents: isolated read-only research lanes for context-heavy side tasks.
146
+ - Agents SDK-style guardrails and tracing: lightweight checks and evidence records around runs.
147
+ - Deep Agents-style harnesses: planning, context offloading, subagents, memory, and human checkpoints.
148
+ - MCP/ACP-style protocols: standard tool/resource discovery and agent-client boundaries.
149
+
150
+ Keep yam's bias: start with momentum, deepen deliberately, stay security-first, and avoid always-on orchestration.
@@ -14,15 +14,20 @@ Use for:
14
14
  - Macro, realistic, and future-facing direction checks.
15
15
  - Security-centered direction checks.
16
16
  - Reference scans that find useful patterns to rework into yam style.
17
+ - Wide scans across tools, agent systems, protocols, harnesses, markets, or third-party ecosystems.
17
18
 
18
19
  Default behavior:
19
20
 
20
21
  - Define the decision clearly.
21
22
  - Prefer official or primary sources.
22
23
  - Gather 3-7 high-signal references for focused scouting, or more when the user asks for a wide scan.
24
+ - For wide scans, build a source map before deep reading: official/primary, implementation evidence, third-party analysis, community evidence, contrarian sources, and local evidence.
23
25
  - Use current docs proof only for modern SDK/API/cloud-service behavior where stale knowledge is plausible.
26
+ - Use blocked-source fallback only when a high-signal source is blocked or platform-protected; treat `insane-search` as source acquisition, not as the default search path.
24
27
  - Summarize options and recommendation.
25
28
  - Separate fact, inference, opinion, and recommendation.
29
+ - Use a compact evidence ledger for broad recommendations.
30
+ - Run an opposition pass when false confidence would make the recommendation brittle.
26
31
  - Keep source boundaries clear: cite what was read and do not present reference-derived judgment as direct verification.
27
32
  - Put security before convenience: auth, payment, DB, secrets, permissions, deployment, supply chain, and public release get called out early.
28
33
  - Do not change code unless the user asks.
@@ -36,9 +41,13 @@ Judgment format:
36
41
  - Future view: second-order effects, durability, and what may age well or badly.
37
42
  - Security view: sensitive surfaces, safer defaults, failure modes, and what a non-specialist might miss.
38
43
  - Rework view: what ideas should be adapted into yam style and what should be rejected.
44
+ - Evidence view: important claim, source class, confidence, uncertainty, and decision impact.
45
+ - Opposition view: the strongest reason the preferred direction could be wrong.
39
46
 
40
47
  Escalate:
41
48
 
42
49
  - Use `question` for direct answers that do not need sources.
43
50
  - Use `deep` only when the user asks for heavy verification.
44
51
  - Use implementation routes only after the user asks to change code.
52
+
53
+ For broad scan mechanics, use `references/scout-wide-scan.md`.
@@ -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.