yam-flow 0.1.6 → 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.
@@ -113,6 +113,14 @@ export interface RuntimeBackendEvidence {
113
113
  evidence_id: string;
114
114
  command: string;
115
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;
116
124
  note: string;
117
125
  truth_status: TruthStatus;
118
126
  }
@@ -165,6 +165,13 @@ export function buildMissionPatchEnvelope(input = {}) {
165
165
  export function buildRuntimeBackendEvidence(input = {}) {
166
166
  const backend = normalizeRuntimeBackend(input.backend);
167
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 || '');
168
175
  return {
169
176
  schema: 'yam.runtime-backend-evidence.v1',
170
177
  backend,
@@ -172,8 +179,24 @@ export function buildRuntimeBackendEvidence(input = {}) {
172
179
  evidence_id: String(input.evidence_id || ''),
173
180
  command: String(input.command || ''),
174
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,
175
190
  note: String(input.note || ''),
176
- 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
+ })
177
200
  };
178
201
  }
179
202
  export function buildUeyeRunReport(input = {}) {
@@ -604,15 +627,21 @@ function normalizeRuntimeClaim(value = '') {
604
627
  return 'blocked';
605
628
  return 'unknown';
606
629
  }
607
- function runtimeBackendTruth(backend, claim, cleanupChecked = false) {
630
+ function runtimeBackendTruth(backend, claim, details = {}) {
608
631
  if (claim === 'blocked')
609
632
  return 'blocked';
610
633
  if (backend === 'none' || claim === 'not_started')
611
634
  return 'skipped';
612
635
  if (backend === 'unknown' || claim === 'unknown')
613
636
  return 'partial';
614
- if (claim === 'cleanup_verified' || cleanupChecked)
615
- 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
+ }
616
645
  if (claim === 'observed' || claim === 'stopped' || claim === 'started')
617
646
  return 'verified';
618
647
  return 'partial';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yam-flow",
3
- "version": "0.1.6",
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",
@@ -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.
@@ -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
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: scout
3
- description: Lightweight investigation and judgment route. Use when the user invokes $scout or asks to find options, references, docs, tools, product direction, or third-party perspective before implementation.
3
+ description: Broad investigation and judgment route. Use when the user invokes $scout or asks to find options, references, docs, tools, product direction, security implications, or third-party perspective before implementation.
4
4
  ---
5
5
 
6
6
  # yam Scout
@@ -15,21 +15,27 @@ Use for:
15
15
  - Third-party judgment before committing to a direction.
16
16
  - Objective and subjective evaluation together.
17
17
  - Macro, realistic, and future-facing judgment.
18
+ - Broad reference scans when the user needs wider perspective.
19
+ - Security-centered direction checks before implementation.
20
+ - Finding patterns worth reworking into yam style.
18
21
 
19
22
  ## Principles
20
23
 
21
- - Scout, do not sprawl.
24
+ - Scout broadly enough to see the field, then compress the judgment.
22
25
  - Token economy is part of quality.
23
26
  - Reuse `yam.project.md` before broad context reading when present.
24
27
  - Prefer official and primary sources.
28
+ - Keep source boundaries clear: cite what was read, separate fact from inference, and do not blur reference material into yam claims.
25
29
  - Use current docs proof only when SDK/API/cloud-service freshness matters.
26
- - Keep the question narrow.
30
+ - Keep the decision clear, but do not make the field of view artificially narrow when the user asks for a broad scan.
27
31
  - Do not change code unless the user asks.
28
32
  - Return a practical recommendation.
29
33
  - Separate fact, inference, opinion, and recommendation.
30
34
  - Treat "objective" as evidence plus constraints, not certainty theater.
31
35
  - Treat "subjective" as named taste, product instinct, and likely user perception.
32
- - Keep source count bounded by default; use `$deep` only when the user asks for heavy verification.
36
+ - Security is the first lens: call out auth, payment, DB, secrets, permission, deployment, supply-chain, and public-release risks early.
37
+ - Source count should match the decision: 3-7 high-signal sources for focused scouting, more when the user explicitly asks for wide research.
38
+ - Use `$deep` when the user asks for heavy verification or when false confidence would be costly.
33
39
 
34
40
  ## Workflow
35
41
 
@@ -41,11 +47,12 @@ Use for:
41
47
  - product/technical direction memo
42
48
  - risk discovery
43
49
  3. Read `yam.project.md` first when project direction matters.
44
- 4. Gather 3-7 high-signal sources by default.
50
+ 4. Gather enough high-signal sources to support the decision; keep source quality higher than source volume.
45
51
  5. Compare options by fit, risk, cost, implementation effort, and durability.
46
- 6. Give both objective and subjective judgment when useful.
47
- 7. Recommend a direction.
48
- 8. State uncertainty and what would change the recommendation.
52
+ 6. Identify security and trust implications before convenience or aesthetics.
53
+ 7. Give both objective and subjective judgment when useful.
54
+ 8. Recommend a direction and which ideas are worth reworking into yam style.
55
+ 9. State uncertainty and what would change the recommendation.
49
56
 
50
57
  ## Output
51
58
 
@@ -57,9 +64,12 @@ Use concise sections:
57
64
  - Macro / realistic / future view when the decision benefits from it.
58
65
  - Alternatives.
59
66
  - Risks.
67
+ - Security lens.
68
+ - Ideas to rework into yam style.
60
69
  - Sources or local evidence.
70
+ - Remaining tasks or useful next improvements.
61
71
 
62
- Use `references/token-economy.md`; default to 3-7 high-signal sources.
72
+ Use `references/token-economy.md`; default to 3-7 high-signal sources unless the user asks for a broad research scan.
63
73
  Use `references/current-docs.md` for current SDK/API/cloud-service questions.
64
74
  Use `references/context-reuse.md`; do not rescout known decisions unless they may be stale.
65
75
  Use `references/markdown-management.md` before creating or updating project packs.