yam-flow 0.1.5 → 0.1.7

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.
@@ -68,6 +68,28 @@ export interface UeyeSurfaceContext {
68
68
  local_only: boolean;
69
69
  truth_status: TruthStatus;
70
70
  }
71
+ export interface UeyeDesignGateCheck {
72
+ id: string;
73
+ label: string;
74
+ status: 'pass' | 'fail' | 'warning' | 'not_checked';
75
+ required: boolean;
76
+ next_action: string;
77
+ }
78
+ export interface UeyeDesignCompletionGate {
79
+ schema: 'yam.ueye-design-completion-gate.v1';
80
+ mode: 'fast' | 'strict';
81
+ completion_claim: 'draft' | 'needs-polish' | 'done';
82
+ ready_to_claim_done: boolean;
83
+ design_score: number | null;
84
+ min_design_score: number;
85
+ checks: UeyeDesignGateCheck[];
86
+ p0: string[];
87
+ p1: string[];
88
+ warnings: string[];
89
+ blockers: string[];
90
+ next_action: string;
91
+ truth_status: TruthStatus;
92
+ }
71
93
  export interface RollbackHint {
72
94
  schema: 'yam.rollback-hint.v1';
73
95
  touched_files: string[];
@@ -91,6 +113,14 @@ export interface RuntimeBackendEvidence {
91
113
  evidence_id: string;
92
114
  command: string;
93
115
  cleanup_checked: boolean;
116
+ started_at: string;
117
+ stopped_at: string;
118
+ exit_code: number | null;
119
+ pid: number | null;
120
+ port: number | null;
121
+ cleanup_method: string;
122
+ cleanup_observed: boolean;
123
+ left_running_intentionally: boolean;
94
124
  note: string;
95
125
  truth_status: TruthStatus;
96
126
  }
@@ -99,12 +129,16 @@ export interface UeyeRunReport {
99
129
  reference_sources: UeyeVisualProvenance[];
100
130
  implementation_sources: UeyeVisualProvenance[];
101
131
  surface_context: UeyeSurfaceContext;
132
+ design_completion_gate: UeyeDesignCompletionGate;
102
133
  comparison_result: string;
103
134
  design_quality: string;
104
135
  blocked_reason: string;
105
136
  next_action: string;
106
137
  truth_status: TruthStatus;
107
138
  }
139
+ export interface UeyeRunReportInput extends Partial<Omit<UeyeRunReport, 'design_completion_gate'>> {
140
+ design_completion_gate?: Partial<UeyeDesignCompletionGate> & Record<string, unknown>;
141
+ }
108
142
  export interface MediaGenerationProof {
109
143
  schema: 'yam.media-generation-proof.v1';
110
144
  tool_name: string;
@@ -145,6 +179,7 @@ export interface ProofSummary {
145
179
  rollbackHint?: unknown;
146
180
  runtimeBackendEvidence?: unknown;
147
181
  mediaProof?: unknown;
182
+ designCompletion?: unknown;
148
183
  }
149
184
  export interface ProofOptions {
150
185
  requireRealRuntime?: boolean;
@@ -177,6 +212,7 @@ export interface YamCompletionProof {
177
212
  rollbackHint: string[];
178
213
  runtimeBackendEvidence: string[];
179
214
  mediaProof: string[];
215
+ designCompletion: string[];
180
216
  cleanup: unknown;
181
217
  changed: string[];
182
218
  skipped: string[];
@@ -190,10 +226,11 @@ export interface YamCompletionProof {
190
226
  }
191
227
  export declare function buildUeyeVisualProvenance(input?: Partial<UeyeVisualProvenance>): UeyeVisualProvenance;
192
228
  export declare function buildUeyeSurfaceContext(input?: Partial<UeyeSurfaceContext>): UeyeSurfaceContext;
229
+ export declare function buildUeyeDesignCompletionGate(input?: Partial<UeyeDesignCompletionGate> & Record<string, unknown>): UeyeDesignCompletionGate;
193
230
  export declare function buildRollbackHint(input?: Partial<RollbackHint>): RollbackHint;
194
231
  export declare function buildMissionPatchEnvelope(input?: Partial<MissionPatchEnvelope>): MissionPatchEnvelope;
195
232
  export declare function buildRuntimeBackendEvidence(input?: Partial<RuntimeBackendEvidence>): RuntimeBackendEvidence;
196
- export declare function buildUeyeRunReport(input?: Partial<UeyeRunReport>): UeyeRunReport;
233
+ export declare function buildUeyeRunReport(input?: UeyeRunReportInput): UeyeRunReport;
197
234
  export declare function buildMediaGenerationProof(input?: Partial<MediaGenerationProof>): MediaGenerationProof;
198
235
  export declare function isTruthStatus(value?: unknown): value is TruthStatus;
199
236
  export declare function weakestTruth(...statuses: unknown[]): TruthStatus;
@@ -52,6 +52,93 @@ export function buildUeyeSurfaceContext(input = {}) {
52
52
  truth_status: isTruthStatus(input.truth_status) ? input.truth_status : 'partial'
53
53
  };
54
54
  }
55
+ export function buildUeyeDesignCompletionGate(input = {}) {
56
+ const completionClaim = normalizeUeyeCompletionClaim(input.completion_claim);
57
+ const mode = String(input.mode || '').toLowerCase() === 'strict' || completionClaim === 'done' ? 'strict' : 'fast';
58
+ const designScore = numberOrNull(input.design_score);
59
+ const minDesignScore = numberOrNull(input.min_design_score) ?? 8;
60
+ const p0 = asList(input.p0);
61
+ const p1 = asList(input.p1);
62
+ const hasReference = Boolean(input.has_reference);
63
+ const hasImplementation = Boolean(input.has_implementation_screenshot);
64
+ const comparisonResult = String(input.comparison_result || 'not-verified');
65
+ const designQuality = String(input.design_quality || 'not-checked');
66
+ const blockedReason = String(input.blocked_reason || '');
67
+ const strictOrDone = mode === 'strict' || completionClaim === 'done';
68
+ const checks = [
69
+ designGateCheck('direction_lock', 'Design direction and target screen were locked before judging completion', Boolean(input.direction_locked) ? 'pass' : 'not_checked', strictOrDone, 'record the target screen and design direction before claiming done'),
70
+ designGateCheck('reference_read', 'Reference read proof exists when reference is used', !hasReference ? 'not_checked' : Boolean(input.reference_read) ? 'pass' : 'fail', hasReference && strictOrDone, 'record concrete reference observations before claiming reference-led work is done'),
71
+ designGateCheck('implementation_screenshot', 'Real implementation screenshot or screen evidence exists', hasImplementation ? 'pass' : 'fail', strictOrDone, 'capture or provide implementation screenshot before claiming done'),
72
+ designGateCheck('reference_comparison', 'Reference comparison is recorded when reference is used', !hasReference ? 'not_checked' : ['matched', 'similar', 'not-applicable'].includes(comparisonResult) ? 'pass' : 'fail', hasReference, 'compare against the reference or mark the difference as intentional before claiming done'),
73
+ designGateCheck('design_quality', 'Design quality result is pass', designQuality === 'pass' ? 'pass' : designQuality === 'needs-polish' ? 'warning' : 'fail', strictOrDone, 'resolve design quality issues or keep the result as needs-polish/partial'),
74
+ designGateCheck('p0_clear', 'No P0 visual blockers remain', p0.length ? 'fail' : 'pass', true, 'fix P0 blockers before any done claim'),
75
+ designGateCheck('p1_clear', 'No P1 major visual issues remain', p1.length ? 'fail' : 'pass', strictOrDone, 'fix or explicitly defer P1 issues before claiming done'),
76
+ designGateCheck('cta_affordance', 'Primary CTA and interaction affordances were checked', Boolean(input.cta_checked) ? 'pass' : 'not_checked', strictOrDone, 'check primary CTA clarity and interaction affordances before claiming done'),
77
+ designGateCheck('state_coverage', 'Primary UI states were checked', Boolean(input.states_checked) ? 'pass' : 'not_checked', strictOrDone, 'check default/loading/error/empty/disabled states or keep completion partial'),
78
+ designGateCheck('mobile_coverage', 'Mobile/responsive behavior was checked', Boolean(input.mobile_checked || input.responsive_checked) ? 'pass' : 'not_checked', strictOrDone, 'check mobile/responsive behavior before claiming done'),
79
+ designGateCheck('accessibility_visuals', 'Contrast/accessibility-relevant visuals were checked', Boolean(input.contrast_checked || input.accessibility_checked) ? 'pass' : 'not_checked', strictOrDone, 'check contrast/accessibility-relevant visuals before claiming done')
80
+ ];
81
+ if (designScore !== null || strictOrDone) {
82
+ checks.push(designGateCheck('design_score', `Design score is at least ${minDesignScore}`, designScore !== null && designScore >= minDesignScore ? 'pass' : designScore === null ? 'not_checked' : 'fail', false, `record --design-score ${minDesignScore} or higher when using score-based completion`));
83
+ }
84
+ const blockers = [
85
+ ...p0.map((item) => `P0: ${item}`),
86
+ ...(blockedReason ? [blockedReason] : []),
87
+ ...checks
88
+ .filter((check) => check.required && check.status !== 'pass')
89
+ .map((check) => `${check.id}: ${check.next_action}`)
90
+ ];
91
+ const warnings = [
92
+ ...p1.map((item) => `P1: ${item}`),
93
+ ...checks
94
+ .filter((check) => !check.required && ['fail', 'warning', 'not_checked'].includes(check.status))
95
+ .map((check) => `${check.id}: ${check.next_action}`)
96
+ ];
97
+ const ready = completionClaim === 'done' && blockers.length === 0;
98
+ const truth = blockers.some((item) => item.startsWith('P0:')) || blockedReason ? 'blocked'
99
+ : ready ? 'verified'
100
+ : strictOrDone ? 'partial'
101
+ : hasImplementation ? 'partial'
102
+ : 'assumed';
103
+ return {
104
+ schema: 'yam.ueye-design-completion-gate.v1',
105
+ mode,
106
+ completion_claim: completionClaim,
107
+ ready_to_claim_done: ready,
108
+ design_score: designScore,
109
+ min_design_score: minDesignScore,
110
+ checks,
111
+ p0,
112
+ p1,
113
+ warnings,
114
+ blockers,
115
+ next_action: blockers[0] || (ready ? 'done claim is supported by the recorded design gate' : warnings[0] || 'keep the Ueye result as draft or needs-polish until a done claim is needed'),
116
+ truth_status: truth
117
+ };
118
+ }
119
+ function normalizeUeyeCompletionClaim(value = '') {
120
+ const text = String(value || '').toLowerCase();
121
+ if (text === 'done' || text === 'complete' || text === 'completed')
122
+ return 'done';
123
+ if (text === 'needs-polish' || text === 'needs_polish' || text === 'polish')
124
+ return 'needs-polish';
125
+ return 'draft';
126
+ }
127
+ function designGateCheck(id, label, status, required, nextAction) {
128
+ return {
129
+ id,
130
+ label,
131
+ status,
132
+ required,
133
+ next_action: nextAction
134
+ };
135
+ }
136
+ function numberOrNull(value = null) {
137
+ if (value === undefined || value === null || value === '')
138
+ return null;
139
+ const number = Number(value);
140
+ return Number.isFinite(number) ? number : null;
141
+ }
55
142
  export function buildRollbackHint(input = {}) {
56
143
  return {
57
144
  schema: 'yam.rollback-hint.v1',
@@ -78,6 +165,13 @@ export function buildMissionPatchEnvelope(input = {}) {
78
165
  export function buildRuntimeBackendEvidence(input = {}) {
79
166
  const backend = normalizeRuntimeBackend(input.backend);
80
167
  const claim = normalizeRuntimeClaim(input.claim);
168
+ const cleanupObserved = Boolean(input.cleanup_observed);
169
+ const leftRunningIntentionally = Boolean(input.left_running_intentionally);
170
+ const exitCode = numberOrNull(input.exit_code);
171
+ const pid = numberOrNull(input.pid);
172
+ const port = numberOrNull(input.port);
173
+ const stoppedAt = String(input.stopped_at || '');
174
+ const cleanupMethod = String(input.cleanup_method || '');
81
175
  return {
82
176
  schema: 'yam.runtime-backend-evidence.v1',
83
177
  backend,
@@ -85,8 +179,24 @@ export function buildRuntimeBackendEvidence(input = {}) {
85
179
  evidence_id: String(input.evidence_id || ''),
86
180
  command: String(input.command || ''),
87
181
  cleanup_checked: Boolean(input.cleanup_checked),
182
+ started_at: String(input.started_at || ''),
183
+ stopped_at: stoppedAt,
184
+ exit_code: exitCode,
185
+ pid,
186
+ port,
187
+ cleanup_method: cleanupMethod,
188
+ cleanup_observed: cleanupObserved,
189
+ left_running_intentionally: leftRunningIntentionally,
88
190
  note: String(input.note || ''),
89
- truth_status: isTruthStatus(input.truth_status) ? input.truth_status : runtimeBackendTruth(backend, claim, Boolean(input.cleanup_checked))
191
+ truth_status: isTruthStatus(input.truth_status) ? input.truth_status : runtimeBackendTruth(backend, claim, {
192
+ cleanupChecked: Boolean(input.cleanup_checked),
193
+ cleanupObserved,
194
+ leftRunningIntentionally,
195
+ stoppedAt,
196
+ exitCode,
197
+ pid,
198
+ cleanupMethod
199
+ })
90
200
  };
91
201
  }
92
202
  export function buildUeyeRunReport(input = {}) {
@@ -104,19 +214,30 @@ export function buildUeyeRunReport(input = {}) {
104
214
  : comparisonResult === 'matched' && hasImplementation ? 'verified'
105
215
  : hasImplementation ? 'partial'
106
216
  : 'partial';
217
+ const gate = buildUeyeDesignCompletionGate({
218
+ ...input.design_completion_gate,
219
+ has_reference: references.length > 0,
220
+ has_implementation_screenshot: hasImplementation,
221
+ comparison_result: comparisonResult,
222
+ design_quality: String(input.design_quality || 'not-checked'),
223
+ blocked_reason: blockedReason
224
+ });
225
+ const shouldApplyDesignGate = gate.mode === 'strict' || gate.completion_claim === 'done' || gate.blockers.length > 0;
226
+ const finalTruth = shouldApplyDesignGate ? weakestTruth(derivedTruth, gate.truth_status) : derivedTruth;
107
227
  return {
108
228
  schema: 'yam.ueye-run-report.v1',
109
229
  reference_sources: references,
110
230
  implementation_sources: implementations,
111
231
  surface_context: buildUeyeSurfaceContext({
112
232
  ...input.surface_context,
113
- truth_status: isTruthStatus(input.surface_context?.truth_status) ? input.surface_context?.truth_status : derivedTruth
233
+ truth_status: isTruthStatus(input.surface_context?.truth_status) ? input.surface_context?.truth_status : finalTruth
114
234
  }),
235
+ design_completion_gate: gate,
115
236
  comparison_result: comparisonResult,
116
237
  design_quality: String(input.design_quality || 'not-checked'),
117
238
  blocked_reason: blockedReason,
118
- next_action: String(input.next_action || (derivedTruth === 'verified' ? 'no action required' : 'capture or provide implementation screenshot before claiming verified visual status')),
119
- truth_status: isTruthStatus(input.truth_status) ? input.truth_status : derivedTruth
239
+ next_action: String(input.next_action || gate.blockers[0] || (finalTruth === 'verified' ? 'no action required' : 'capture or provide implementation screenshot before claiming verified visual status')),
240
+ truth_status: isTruthStatus(input.truth_status) ? input.truth_status : finalTruth
120
241
  };
121
242
  }
122
243
  export function buildMediaGenerationProof(input = {}) {
@@ -229,6 +350,9 @@ export function classifyEvidenceTruth(summary = {}, options = {}) {
229
350
  for (const media of asList(summary.mediaProof)) {
230
351
  rows.push(evidenceRow('evidence', media, readStructuredTruth(media, 'partial')));
231
352
  }
353
+ for (const designCompletion of asList(summary.designCompletion)) {
354
+ rows.push(evidenceRow('visual', designCompletion, readStructuredTruth(designCompletion, 'partial')));
355
+ }
232
356
  for (const runtime of asList(summary.runtime)) {
233
357
  rows.push(evidenceRow('runtime', runtime, classifyRuntimeEvidence(runtime, options)));
234
358
  }
@@ -262,6 +386,15 @@ export function applyProofTruthCaps(summary = {}, options = {}) {
262
386
  cappedTruth = weakestTruth(cappedTruth, 'partial');
263
387
  unverified.push('real_visual_evidence_missing');
264
388
  }
389
+ const designCompletionTruth = designCompletionCap(summary.designCompletion);
390
+ if (designCompletionTruth) {
391
+ cappedTruth = weakestTruth(cappedTruth, designCompletionTruth);
392
+ if (designCompletionTruth === 'blocked')
393
+ blockers.push('ueye_design_completion_blocked');
394
+ if (!['verified', 'proven'].includes(designCompletionTruth)) {
395
+ unverified.push('ueye_design_completion_not_verified');
396
+ }
397
+ }
265
398
  if (requested !== cappedTruth) {
266
399
  caps.push(`requested ${requested} capped to ${cappedTruth} by evidence`);
267
400
  }
@@ -319,6 +452,7 @@ export function buildYamCompletionProof(summary = {}, options = {}) {
319
452
  rollbackHint: asList(summary.rollbackHint),
320
453
  runtimeBackendEvidence: asList(summary.runtimeBackendEvidence),
321
454
  mediaProof: asList(summary.mediaProof),
455
+ designCompletion: asList(summary.designCompletion),
322
456
  cleanup: summary.cleanup || '',
323
457
  changed: asList(summary.changed),
324
458
  skipped: asList(summary.skipped),
@@ -394,6 +528,12 @@ function readStructuredTruth(value = '', fallback = 'partial') {
394
528
  return fallback;
395
529
  }
396
530
  }
531
+ function designCompletionCap(value = '') {
532
+ const items = asList(value);
533
+ if (!items.length)
534
+ return null;
535
+ return items.reduce((weakest, item) => weakestTruth(weakest, readStructuredTruth(item, 'partial')), 'proven');
536
+ }
397
537
  function strongestSupportedTruth(rows = []) {
398
538
  if (rows.some((row) => row.truth === 'blocked'))
399
539
  return 'blocked';
@@ -487,15 +627,21 @@ function normalizeRuntimeClaim(value = '') {
487
627
  return 'blocked';
488
628
  return 'unknown';
489
629
  }
490
- function runtimeBackendTruth(backend, claim, cleanupChecked = false) {
630
+ function runtimeBackendTruth(backend, claim, details = {}) {
491
631
  if (claim === 'blocked')
492
632
  return 'blocked';
493
633
  if (backend === 'none' || claim === 'not_started')
494
634
  return 'skipped';
495
635
  if (backend === 'unknown' || claim === 'unknown')
496
636
  return 'partial';
497
- if (claim === 'cleanup_verified' || cleanupChecked)
498
- return 'proven';
637
+ const hasClosureEvidence = Boolean(details.stoppedAt || details.exitCode !== null || details.cleanupMethod);
638
+ if (claim === 'cleanup_verified' || details.cleanupChecked) {
639
+ if (details.cleanupObserved && hasClosureEvidence)
640
+ return 'proven';
641
+ if (details.leftRunningIntentionally && (details.pid !== null || details.cleanupMethod))
642
+ return 'partial';
643
+ return 'real_required_missing';
644
+ }
499
645
  if (claim === 'observed' || claim === 'stopped' || claim === 'started')
500
646
  return 'verified';
501
647
  return 'partial';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yam-flow",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Progressive proof-first agent flow: start fast, deepen deliberately, stay honest by design.",
5
5
  "type": "module",
6
6
  "author": "0kim0bos",
@@ -16,7 +16,7 @@
16
16
  "node": ">=18"
17
17
  },
18
18
  "bin": {
19
- "yam": "./dist/bin/yam.js"
19
+ "yam": "dist/bin/yam.js"
20
20
  },
21
21
  "types": "dist/lib/trust-kernel.d.ts",
22
22
  "exports": {
@@ -0,0 +1,33 @@
1
+ # Cleanup Scan
2
+
3
+ `yam cleanup scan` is advisory only.
4
+
5
+ It helps identify confusing local surfaces before a route starts drifting:
6
+
7
+ - active hooks
8
+ - project-local skill folders
9
+ - competing instruction files
10
+ - old skill/package traces
11
+ - stale proof or runtime artifacts
12
+
13
+ It must not delete, rename, disable, uninstall, or rewrite anything.
14
+
15
+ Use it when:
16
+
17
+ - routes feel unexpectedly heavy
18
+ - old instructions keep influencing a project
19
+ - install state is unclear
20
+ - proof artifacts may be mistaken for current evidence
21
+
22
+ Safe cleanup requires explicit user approval and a backup-minded next action.
23
+
24
+ Every finding should include:
25
+
26
+ - `risk_level`
27
+ - `surface`
28
+ - `why_it_matters`
29
+ - `safe_next_action`
30
+ - `destructive: false`
31
+ - `truth_status`
32
+
33
+ If cleanup is not needed, say so plainly and keep moving.
@@ -7,9 +7,14 @@ Every `yam` route should end with a compact handoff that helps the next run avoi
7
7
  Include these when they are useful and keep them short:
8
8
 
9
9
  - What changed or what was found.
10
+ - Change insight for non-specialists: what the touched code does, how it changed, and why it matters.
10
11
  - What verification ran.
11
12
  - What was not checked.
12
13
  - Truth status, when verification or runtime claims matter.
14
+ - Security notes when auth, payment, DB, secrets, permissions, deployment, dependency, or public-release surfaces are relevant.
15
+ - Source boundaries when reference material shaped the decision.
16
+ - Context pressure or cleanup findings when they could affect the next run.
17
+ - Publish blocker evidence when npm/release work fails.
13
18
  - Structured diagnostic next action, when a check found a concrete next step.
14
19
  - Remaining tasks.
15
20
  - Fix-first items before planned tasks.
@@ -57,7 +62,7 @@ For `$ueye`, include source evidence, states/viewports checked, and P0-P3 issues
57
62
 
58
63
  For `$deep` and `$mission`, include evidence, remaining risks, remaining tasks, and fix-first items.
59
64
 
60
- Do not pad the final answer when there are no meaningful remaining tasks or fix-first items.
65
+ Do not pad the final answer when there are no meaningful remaining tasks or fix-first items, but say so plainly when the user expects a handoff.
61
66
 
62
67
  When budget drift matters, include or run `yam measure <route>` with approximate files, commands, report lines, and seconds.
63
68
 
@@ -2,12 +2,16 @@
2
2
 
3
3
  Escalate by recommendation, not silent mode switching.
4
4
 
5
+ Security is the first lens. Before convenience, speed, or visual polish, look for sensitive surfaces a non-specialist may miss.
6
+
5
7
  Recommend `$deep` when work touches:
6
8
 
7
9
  - DB schema or data mutation.
8
10
  - Supabase destructive commands, migrations, production writes, RLS, or policy changes.
9
11
  - Auth, payment, billing, permissions.
10
12
  - Security-sensitive code.
13
+ - Secret handling, environment variables, tokens, and credentials.
14
+ - Dependency, package, install, release, or supply-chain changes.
11
15
  - Deployment or release configuration.
12
16
  - Broad refactor or many files.
13
17
  - Failing verification.
@@ -44,6 +44,7 @@ Runtime proof should include:
44
44
  - PID, port, URL, session, pane, screenshot id, started_at, stopped_at, and exit_code when available.
45
45
  - Checks before and after.
46
46
  - Cleanup result.
47
+ - `cleanup_method`, `cleanup_observed`, and `left_running_intentionally` when relevant.
47
48
  - Truth status: proven, verified, partial, fixture_only, fixture_instrumented_real, integration_optional, real_required_missing, skipped, blocked, assumed.
48
49
 
49
50
  ## Runtime Evidence Mini
@@ -58,6 +59,9 @@ Minimum fields:
58
59
  - `command` or check name
59
60
  - `target`: URL, port, process, or service
60
61
  - `pid`, `port`, `url`, `exit_code`, `screenshot_id`, `started_at`, `stopped_at`
62
+ - `cleanup_method`
63
+ - `cleanup_observed`
64
+ - `left_running_intentionally`
61
65
  - `process`: session, pane, or `unknown` when process detail is unavailable
62
66
  - `observation`: before and after notes
63
67
  - `cleanup`: status and evidence
@@ -68,6 +72,9 @@ Truth caps:
68
72
 
69
73
  - Missing process/target evidence cannot support `proven`.
70
74
  - Missing cleanup evidence cannot support a cleanup-complete claim.
75
+ - `cleanup_checked` alone is not enough for `proven`.
76
+ - `cleanup_observed` plus exit, closure, or cleanup method evidence can support `proven`.
77
+ - `left_running_intentionally` is acceptable only when explicitly recorded and reported.
71
78
  - Optional runtime checks may be `integration_optional`; required but unavailable runtime checks should be `real_required_missing`, `blocked`, or `partial`.
72
79
 
73
80
  ## Cleanup Rule
@@ -1,6 +1,6 @@
1
1
  # Scout
2
2
 
3
- `scout` is practical investigation and judgment, not academic research.
3
+ `scout` is broad practical investigation and judgment. It gives the user wider sight before implementation, then compresses the result into a decision.
4
4
 
5
5
  Use for:
6
6
 
@@ -12,15 +12,19 @@ Use for:
12
12
  - Third-party judgment before implementation.
13
13
  - Objective and subjective evaluation together.
14
14
  - Macro, realistic, and future-facing direction checks.
15
+ - Security-centered direction checks.
16
+ - Reference scans that find useful patterns to rework into yam style.
15
17
 
16
18
  Default behavior:
17
19
 
18
- - Define the question narrowly.
20
+ - Define the decision clearly.
19
21
  - Prefer official or primary sources.
20
- - Gather 3-7 high-signal references by default.
22
+ - Gather 3-7 high-signal references for focused scouting, or more when the user asks for a wide scan.
21
23
  - Use current docs proof only for modern SDK/API/cloud-service behavior where stale knowledge is plausible.
22
24
  - Summarize options and recommendation.
23
25
  - Separate fact, inference, opinion, and recommendation.
26
+ - Keep source boundaries clear: cite what was read and do not present reference-derived judgment as direct verification.
27
+ - Put security before convenience: auth, payment, DB, secrets, permissions, deployment, supply chain, and public release get called out early.
24
28
  - Do not change code unless the user asks.
25
29
 
26
30
  Judgment format:
@@ -30,6 +34,8 @@ Judgment format:
30
34
  - Macro view: category direction and broad movement.
31
35
  - Realistic view: what can be done soon with the current project and skill level.
32
36
  - Future view: second-order effects, durability, and what may age well or badly.
37
+ - Security view: sensitive surfaces, safer defaults, failure modes, and what a non-specialist might miss.
38
+ - Rework view: what ideas should be adapted into yam style and what should be rejected.
33
39
 
34
40
  Escalate:
35
41
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  `yam` should grow a proof-first trust layer, but not a proof-first cage.
4
4
 
5
- The goal is to help a beginner start small and then move toward professional implementation with evidence, without making every step feel like a release gate.
6
- This is not a lightweight-only direction. `yam-lite` is light; `yam` is progressive.
5
+ The goal is to help a non-specialist start with momentum and then move toward professional implementation with evidence, wider judgment, security-first guidance, and useful change insight.
6
+ This is not a lightweight-only direction. `yam-lite` is light; `yam` is progressive and is allowed to become deeper as the user's knowledge and project risk grow.
7
7
 
8
8
  ## Depth Ladder
9
9
 
@@ -13,6 +13,9 @@ 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
+ - explain what changed in plain language when code or behavior changes
17
+ - treat security as the first project lens
18
+ - preserve source boundaries when outside references shaped the judgment
16
19
 
17
20
  Then depth increases by route:
18
21
 
@@ -70,6 +73,7 @@ On demand:
70
73
  - tmux/process cleanup truth.
71
74
  - Source-intelligence proof for current docs.
72
75
  - Destructive DB/Supabase command detection and production-write caution.
76
+ - Security-first risk surfacing for non-specialists.
73
77
  - Fake-vs-real and runtime truth matrix checks, reduced to local route-scoped helpers.
74
78
  - Feature/release inventory as an optional doctor, not a default gate.
75
79
 
@@ -86,6 +90,14 @@ On demand:
86
90
  - Compact design direction.
87
91
  - P0 visual gates for design-heavy work.
88
92
 
93
+ ## Change Insight Inputs
94
+
95
+ - What the touched code or artifact is responsible for.
96
+ - What changed in behavior, contract, UI, or safety posture.
97
+ - Why the change matters to the product or user.
98
+ - What remains uncertain or unverified.
99
+ - What should be fixed first before the next planned task.
100
+
89
101
  ## Reject
90
102
 
91
103
  - Always-on Team route.
@@ -11,6 +11,7 @@ This is the small trust kernel that keeps `yam` honest without turning every tas
11
11
  - fake versus real evidence distinction
12
12
  - runtime truth matrix idea
13
13
  - visual evidence caps
14
+ - Ueye design completion gate
14
15
  - DB/Supabase destructive-signal detection
15
16
 
16
17
  ## Rejected
@@ -38,6 +39,7 @@ The module provides:
38
39
  - fake/real policy
39
40
  - runtime truth matrix
40
41
  - completion proof object creation
42
+ - Ueye design completion gate creation
41
43
 
42
44
  ## Policy
43
45
 
@@ -51,5 +53,6 @@ For example:
51
53
  - Mock/fixture evidence cannot become real runtime `proven`.
52
54
  - Required runtime evidence that is missing becomes `real_required_missing`.
53
55
  - Cleanup claims require cleanup evidence.
56
+ - Ueye `done` claims require a passing design completion gate or stay capped at `partial` or `blocked`.
54
57
 
55
58
  This keeps the trust layer progressive and route-scoped.
@@ -38,8 +38,12 @@ Never say `verified` when the correct status is `partial`, `skipped`, `blocked`,
38
38
 
39
39
  Never say `proven` for runtime work unless the runtime evidence exists.
40
40
 
41
+ Never say cleanup is `proven` from a cleanup intention alone. Cleanup needs observed exit, closure, or an explicit intentional-left-running record.
42
+
41
43
  Never say full visual `verified` when the only evidence is a reference image, generated image, code reading, or text-only critique.
42
44
 
45
+ Ueye preflight is `partial` by design. It can identify design risks before work starts, but it cannot prove visual quality without implementation screenshot/comparison evidence.
46
+
43
47
  For ordinary routes, prefer `verified`, `partial`, `skipped`, `blocked`, or `assumed`.
44
48
  For `$deep` runtime verification and `$mission`, use the more precise runtime statuses when they prevent overclaiming.
45
49
 
@@ -26,7 +26,7 @@ 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 --design-quality needs-polish --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 --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.
@@ -190,6 +190,55 @@ Dimensions:
190
190
  Report findings as P0-P3. Keep P2/P3 short unless the user requested a full polish pass.
191
191
  For each relevant design dimension, use `pass`, `needs-polish`, or `fails`.
192
192
 
193
+ ### Design Completion Gate
194
+
195
+ Purpose: prevent Ueye from declaring visual work complete before the design evidence supports that claim.
196
+
197
+ Use when the output says the UI is done, complete, polished, final, or verified.
198
+
199
+ Minimum fields:
200
+
201
+ - `completion_claim`: draft / needs-polish / done
202
+ - `mode`: fast / strict
203
+ - `ready_to_claim_done`
204
+ - `design_score`, when used
205
+ - `min_design_score`
206
+ - `checks`
207
+ - `p0`
208
+ - `p1`
209
+ - `warnings`
210
+ - `blockers`
211
+ - `next_action`
212
+ - `truth_status`
213
+
214
+ Required for a done claim when relevant:
215
+
216
+ - direction locked
217
+ - reference read proof for reference-led work
218
+ - implementation screenshot or source-screen evidence
219
+ - reference comparison for reference-led work
220
+ - design quality pass
221
+ - no P0 blockers
222
+ - no unresolved P1 issues unless explicitly deferred
223
+ - CTA affordance checked
224
+ - primary states checked
225
+ - mobile/responsive behavior checked
226
+ - contrast/accessibility-relevant visuals checked
227
+
228
+ Example:
229
+
230
+ ```bash
231
+ 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 --json
232
+ ```
233
+
234
+ Attach to proof when needed:
235
+
236
+ ```bash
237
+ yam proof --route ueye --truth verified --visual "implementation screenshot evidence recorded" --design-completion '{"completion_claim":"done","has_implementation_screenshot":true,"design_quality":"pass","states_checked":true,"mobile_checked":true,"contrast_checked":true,"cta_checked":true,"direction_locked":true,"truth_status":"verified"}'
238
+ ```
239
+
240
+ 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
+
193
242
  ### Review Continuity And Comparison Report
194
243
 
195
244
  Use this when a Ueye task continues a previous visual review, rechecks a fix, or compares two review runs.
@@ -222,3 +271,4 @@ Do not claim continuity from memory alone. Link it to a previous report, screens
222
271
  - Reference-only evidence can support direction, not implementation proof.
223
272
  - Generated-only evidence can support ideation or annotation, not implemented-screen verification.
224
273
  - Missing screenshots, unavailable browser, or text-only review should cap the result at `partial`, `blocked`, or `assumed`.
274
+ - A done claim with a missing or failing design completion gate should cap the result at `partial` or `blocked`.