yam-flow 2.3.2 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -24,18 +24,20 @@
24
24
 
25
25
  ## Latest Update Trigger
26
26
 
27
- When the user says exactly `yam 최신 업데이트 사항 반영해줘` in a chat for this project, treat that phrase as explicit authorization to update the globally installed package and refresh the installed yam skills.
27
+ When the user says exactly `yam 최신 업데이트 사항 반영해줘` in a chat for this project, treat that phrase as explicit authorization to check and apply reviewed updates for yam, Scrapling, and Insane Search.
28
28
 
29
29
  Run these commands sequentially from the yam project directory:
30
30
 
31
31
  ```bash
32
- npm install -g yam-flow
33
- yam install
32
+ yam update check --json
33
+ yam update apply --all --json
34
34
  yam version
35
35
  yam status
36
36
  ```
37
37
 
38
38
  - Request any environment approval required for network access or writes outside the workspace.
39
39
  - Stop at the first failed command, report the blocker, and do not claim that later steps ran.
40
- - After all four commands pass, report the installed version and skill status, then tell the user that Codex can be restarted to reload the updated skills.
40
+ - Treat that exact phrase as one-time authorization for this run only; do not create an unattended updater, hook, or automation.
41
+ - Never edit `.codex/plugins/cache` directly. If Insane Search cannot be updated in place through the official Codex CLI, report `manual_plugin_update_required` and stop.
42
+ - After all four commands pass, summarize every component receipt, report the installed yam version and skill status, then tell the user that Codex can be restarted to reload updated skills/plugins.
41
43
  - Do not restart Codex automatically.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  All notable changes to yam-flow are documented here.
4
4
 
5
+ ## v2.5.0 - 2026-07-30
6
+
7
+ ### Added
8
+
9
+ - Added read-only `yam update check [--json]` for yam, Scrapling, and Insane Search with official registry/manifest versions and source-revision metadata.
10
+ - Added explicitly authorized component/all update application with per-component receipts, a concurrent-run lock, exact stable versions, verification evidence, and rollback guidance.
11
+ - Added isolated Scrapling version environments with `pip check`, HTTP extraction, browser extraction, and atomic executable switching; the previous environment remains available for rollback.
12
+ - Added deterministic temp-only updater smoke coverage, including receipt-failure symlink rollback, manual Codex plugin fallback, strict no-remove/cache behavior, and yam-last `--all` ordering.
13
+
14
+ ### Improved
15
+
16
+ - The build now preserves executable mode on `dist/bin/yam.js`, and dist freshness fails if a global npm install would expose a non-executable `yam` target.
17
+
18
+ ### Security
19
+
20
+ - Insane Search updates pin the official manifest to the exact observed Git revision and use only official Codex CLI commands. A missing safe in-place path returns `manual_plugin_update_required`; an unreadable post-upgrade state fails closed before `add`; yam never removes the plugin first or writes `.codex/plugins/cache` directly.
21
+ - External commands use argument arrays without a shell, version/component allowlists, redacted captured output, and fail-closed apply locking.
22
+ - Existing Scrapling links require a matching yam ownership marker, and an unwritable receipt stops `--all` before any later component mutation.
23
+
24
+ ### Verification
25
+
26
+ - `npm run external-updates-smoke`
27
+ - `npm run typecheck`
28
+ - `npm run verify:self`
29
+ - `npm run cli-smoke`
30
+ - `npm run dist:freshness`
31
+ - `npm run package-boundary:check`
32
+
33
+ ## v2.4.0 - 2026-07-27
34
+
35
+ ### Added
36
+
37
+ - Added ownership-aware skill replacement: an existing active skill is replaced only when the previous yam receipt and complete regular-file inventory and content hashes prove yam ownership, unless the operator explicitly names that skill with `--replace-user-skill`.
38
+ - Added a central CLI help contract so `--help` and `-h` return usage before any command dispatch, including install and uninstall.
39
+ - Added deterministic smoke coverage for user-owned conflicts, explicit replacement, prior-version upgrades, local drift, safe uninstall and rollback, preserved legacy/mirror entries, and help-path state immutability.
40
+ - Added `yam detect [dir] --json` changed-file verification recommendations for dirty, staged, and untracked Git paths. Each advisory records its matched rule, confidence, reason, fallback, and source files; its command plan deduplicates available project commands while retaining rule/file provenance, and unavailable Git scope cannot masquerade as a clean project.
41
+ - Added a deterministic packaged-hook latency and read-only regression smoke for zero, one, and many changed files, including the eight-file prompt cap and bounded Study Note `Stop` behavior.
42
+
43
+ ### Improved
44
+
45
+ - `yam uninstall` now requires a valid receipt and matching active skill hashes, then removes the verified set transactionally. User-owned, locally modified, legacy, retired, and Codex mirror entries that cannot be proven yam-owned are preserved.
46
+ - Install ownership is checked before staging and again immediately before mutation so conflicts fail closed without replacing the existing skill or receipt.
47
+ - `yam doctor` reports safely preserved legacy/retired/mirror entries as informational unproven entries instead of failing with an ineffective reinstall recommendation.
48
+ - `yam cleanup scan` now includes a bounded, advisory-only AGENTS/SKILL directive-duplication budget with exact normalized matching, digests, redacted limited previews, and file/line provenance. It remains non-destructive and never becomes a hard gate.
49
+ - Study Note check, prompt, and `Stop` paths now preserve Git change-scope availability. A non-Git or failed Git probe reports partial truth and a manual-inspection warning instead of silently claiming that no artifacts changed.
50
+
51
+ ### Verification
52
+
53
+ - Passed TypeScript typecheck, clean build, hook latency/read-only smoke, the 174-file install/uninstall transaction smoke, packaged CLI smoke, self-verification, forbidden-name scan, distribution freshness, package-boundary validation, and diff whitespace checks.
54
+
5
55
  ## v2.3.2 - 2026-07-21
6
56
 
7
57
  ### Added
package/COMMANDS.md CHANGED
@@ -143,6 +143,19 @@ yam measure quick --files 3 --commands 1 --report-lines 5 --seconds 40
143
143
  yam template tuning
144
144
  ```
145
145
 
146
+ ## External Updates
147
+
148
+ ```bash
149
+ yam update check
150
+ yam update check --json
151
+ yam update apply --component scrapling --json
152
+ yam update apply --component insane-search --json
153
+ yam update apply --component yam --json
154
+ yam update apply --all --json
155
+ ```
156
+
157
+ `yam update check` is read-only. Every `apply` needs explicit authorization, uses a concurrent-run lock, records a component receipt, and stops on failed/manual results. `--all` runs yam last. Insane Search is never remove-first and `.codex/plugins/cache` is never edited directly.
158
+
146
159
  ## Tool Doctor / Proof / Safety
147
160
 
148
161
  Read-only readiness and evidence helpers. These do not install, deploy, query databases, or run verification by themselves.
@@ -152,6 +165,7 @@ yam tools doctor /path/to/project
152
165
  yam tools doctor /path/to/project --json
153
166
  yam context pressure /path/to/project --json
154
167
  yam cleanup scan /path/to/project --json
168
+ yam detect /path/to/project --json
155
169
  yam study-note check /path/to/project --text "Study Note: The hook handler's role is final-report validation. It runs at Codex Stop. Before it only reminded; after it requests one correction pass. Expected behavior is a complete note. Structure insight: decision=block creates a continuation prompt. Verification checked the packaged CLI. Limits: a restarted real task remains to be observed." --json
156
170
  yam loop report --route quick --intent "fix release readiness" --stage "inspect:passed:read release report" --evidence "typecheck passed" --evidence-level local --evidence-stamp "sha256:release-report" --touched-file src/bin/yam.ts --read-file README.md --verified-file scripts/cli-smoke.mjs --skipped-check "npm publish skipped by design" --stop-condition "stop after readiness evidence is recorded" --resume-hint "rerun release report after npm auth refresh" --readiness-state blocked --covered-requirement "release report is read-only" --uncovered-requirement "npm auth verified" --blocked-kind auth_blocked --failure-cause auth_token_invalid --safe-retry "retry after npm whoami succeeds" --recovery-hint "refresh npm auth, then rerun readiness checks" --fix-first-item "npm auth must be verified before publish" --remaining-task "rerun release report after auth refresh" --recommended-direction "fix npm auth first, then publish manually" --implementation-note "keep loop report read-only" --why-this-next "auth blocks public release claims" --blocked-by "npm whoami E401" --owner-route deep --owner-scope "release readiness only" --scope-owner deep --side-effect "no publish attempted" --avoidance-note "do not retry publish before npm auth is proven" --issue-code "src/bin/yam.ts release report" --issue-role "summarizes release readiness without publishing" --issue-symptom "npm auth failure needs clearer next action" --changed-code "yam loop report" --changed-role "records loop evidence and learning note" --change-summary "added a read-only loop artifact" --why-important "it helps users learn what changed without overclaiming verification" --learning-note "fix blockers before claiming done" --json
157
171
  yam proof /path/to/project
@@ -213,7 +227,8 @@ Supported report shapes:
213
227
  - Ueye design brief/anti-slop: brief dimensions, constraints, invented metrics, placeholder copy, generic visuals, and custom P0 blockers.
214
228
  - Ueye deep visual review: acceptance criteria, touched/read/verified files, skipped checks, residual risks, stop condition, resume hint, design-system evidence, implementation evidence, and state matrix.
215
229
  - Context pressure: project pack age/size, memory summary, dirty scope, scripts, instruction surfaces, and route hint.
216
- - Cleanup scan: advisory-only list of confusing surfaces with destructive=false.
230
+ - Changed-file verification detector: dirty/staged/untracked Git paths grouped into advisory rules with confidence, reason, fallback, source files, and available project commands; the command plan is deduplicated while retaining rule/file provenance, Git-unavailable scope stays low confidence, and no recommendation is executed.
231
+ - Cleanup scan: advisory-only list of confusing surfaces with `destructive=false`, plus a bounded exact-normalized AGENTS/SKILL cross-surface duplication budget with file/line provenance.
217
232
 
218
233
  ## Hooks
219
234
 
package/README.md CHANGED
@@ -97,7 +97,7 @@ yam hook enable study-note --global
97
97
  yam hook status --global
98
98
  ```
99
99
 
100
- The profile installs `UserPromptSubmit` and `Stop` handlers. At `Stop`, yam checks the latest assistant message with the same read-only Study Note Guard used by `yam study-note check`. If changed artifacts lack the required role, execution point, before/after, expected behavior, syntax/structure, verification, limits, or relevant architecture hygiene, Codex receives one correction prompt. A second failed check warns but does not loop forever. The hook never writes the Study Note or runs verification for the agent.
100
+ The profile installs `UserPromptSubmit` and `Stop` handlers. At `Stop`, yam checks the latest assistant message with the same read-only Study Note Guard used by `yam study-note check`. If changed artifacts lack the required role, execution point, before/after, expected behavior, syntax/structure, verification, limits, or relevant architecture hygiene, Codex receives one correction prompt. A second failed check warns but does not loop forever. If Git change scope is unavailable, the guard reports partial truth and keeps a manual-inspection warning visible instead of claiming the project is clean. The hook never writes the Study Note or runs verification for the agent.
101
101
 
102
102
  `yam hook status` reports stale or missing command targets as `broken` and exits nonzero. Run `yam hook enable <profile> --global` again to create a timestamped backup, preserve unrelated hooks, and migrate that profile to the current installed path and event coverage. Restart Codex or open a new task after changing hooks.
103
103
 
@@ -110,16 +110,74 @@ cd ~/Documents/Codex/tools/yam
110
110
  yam install
111
111
  ```
112
112
 
113
- `yam install` stages every managed skill plus the shared `references/` directory, verifies the complete staged file manifest with SHA-256, and only then replaces the active set in `~/.agents/skills/`. If any commit or post-install verification step fails, yam restores the previous managed skill set and receipt.
113
+ `yam install` first checks ownership of every existing active skill. A skill is replaced automatically only when the previous yam receipt names it and its complete regular-file inventory and content hashes still match the receipt. The installer then stages every managed skill plus the shared `references/` directory, verifies the complete staged file manifest with SHA-256, and replaces the verified active set in `~/.agents/skills/`. If any commit or post-install verification step fails, yam restores the previous managed skill set and receipt.
114
+
115
+ If an existing active directory is user-owned, locally modified, or cannot be proven yam-owned, installation stops before staging and preserves it. After reviewing the files, replace only the intended conflicting name explicitly:
116
+
117
+ ```bash
118
+ yam install --replace-user-skill quick
119
+ ```
120
+
121
+ Repeat `--replace-user-skill <name>` for each reviewed conflict. Unproven legacy, retired, and Codex mirror directories are preserved rather than deleted by name.
114
122
 
115
123
  A successful install writes `~/.agents/skills/.yam-flow-install-receipt.json`. The receipt records the package version, source identity, install timestamp, destination, managed skill inventory, and per-file hashes. `yam status` independently recomputes source and installed hashes, so a stale package install, local file change, unexpected file, or modified receipt is reported as drift.
116
124
 
125
+ The receipt is local integrity provenance, not a cryptographic signature or a security boundary against another process running as the same OS user. An actor that can rewrite both the receipt and every recorded file can forge local ownership evidence.
126
+
117
127
  An ordinary install error rolls back automatically. An abrupt process or machine termination can leave `.yam-flow-install.lock` and a hidden transaction directory; `yam status` surfaces the unfinished transaction and yam refuses another mutation while recovery state remains. Remove the lock only after confirming no install is running, and preserve any transaction directory until the previous installation state has been inspected.
118
128
 
119
129
  Manual copying can still make a skill loadable, but it intentionally remains unverified: without a matching receipt, `yam status` exits non-zero and recommends `yam install`.
120
130
 
121
131
  Restart Codex after installing so skills reload.
122
132
 
133
+ ## External Updates
134
+
135
+ Update checks are read-only and never authorize a mutation by themselves:
136
+
137
+ ```bash
138
+ yam update check
139
+ yam update check --json
140
+ ```
141
+
142
+ Apply requires an explicit component or `--all`:
143
+
144
+ ```bash
145
+ yam update apply --component scrapling
146
+ yam update apply --component insane-search
147
+ yam update apply --component yam
148
+ yam update apply --all --json
149
+ ```
150
+
151
+ `--all` processes Scrapling, then Insane Search, then yam so the running updater replaces itself last. It stops at the first failed or manual-only component. Each attempt writes a component receipt under `~/.local/state/yam/update-receipts/` with the old/new version, source revision, checks, side effects, outcome, and rollback guidance. A lock prevents concurrent apply runs.
152
+
153
+ Scrapling updates install an exact stable PyPI version into a new versioned virtual environment. `pip check`, ordinary HTTP extraction, and headless browser extraction must pass before the executable symlink changes atomically; the previous environment is retained. An existing environment must have a matching `.yam-scrapling-install.json` ownership marker before yam will replace its link. Insane Search uses only the official `codex plugin` commands. yam never edits `.codex/plugins/cache`, never removes the plugin first, and returns `manual_plugin_update_required` when the installed Codex CLI cannot update it safely in place.
154
+
155
+ There is no unattended updater. The exact project trigger in `AGENTS.md` grants one-time authorization for a checked `--all` run, and Codex is never restarted automatically.
156
+
157
+ ### Scrapling Usage
158
+
159
+ The isolated executable can be used directly from the shell:
160
+
161
+ ```bash
162
+ scrapling --version
163
+ scrapling extract get https://example.com example.txt --css-selector h1
164
+ scrapling extract stealthy-fetch https://example.com example-browser.txt --css-selector h1 --headless
165
+ ```
166
+
167
+ From Python inside the installed environment:
168
+
169
+ ```python
170
+ from scrapling.fetchers import Fetcher, StealthyFetcher
171
+
172
+ page = Fetcher.get("https://example.com")
173
+ print(page.css("h1::text").get())
174
+
175
+ browser_page = StealthyFetcher.fetch("https://example.com", headless=True)
176
+ print(browser_page.css("h1::text").get())
177
+ ```
178
+
179
+ Use `Fetcher` for ordinary HTTP pages and `StealthyFetcher` only when a real browser or stronger anti-bot behavior is needed; the browser path is heavier.
180
+
123
181
  ## Uninstall
124
182
 
125
183
  ```bash
@@ -127,6 +185,8 @@ cd ~/Documents/Codex/tools/yam
127
185
  yam uninstall
128
186
  ```
129
187
 
188
+ `yam uninstall` verifies the receipt, complete active inventory, and current file hashes before deleting anything. A missing receipt or locally modified active skill blocks the whole uninstall. Verified active skills and the receipt are removed transactionally; unproven legacy, retired, and Codex mirror entries remain untouched.
189
+
130
190
  No hooks, automations, or global config files are installed.
131
191
 
132
192
  ## Manage
@@ -140,6 +200,7 @@ yam tools doctor /path/to/project
140
200
  yam tools doctor /path/to/project --json
141
201
  yam context pressure /path/to/project --json
142
202
  yam cleanup scan /path/to/project --json
203
+ yam detect /path/to/project --json
143
204
  yam study-note check /path/to/project --text "Study Note: ..." --json
144
205
  yam proof /path/to/project
145
206
  yam proof write /path/to/project --route quick --truth verified --command "npm run verify:self: pass"
@@ -161,7 +222,6 @@ yam mission gate --expected-thread reviewer-1 --receipt .yam/mission/reviewer-1.
161
222
  yam loop report --route quick --intent "fix release readiness" --stage "inspect:passed:read release report" --evidence "typecheck passed" --evidence-level local --evidence-stamp "sha256:release-report" --touched-file src/bin/yam.ts --read-file README.md --verified-file scripts/cli-smoke.mjs --skipped-check "npm publish skipped by design" --stop-condition "stop after readiness evidence is recorded" --resume-hint "rerun release report after npm auth refresh" --readiness-state blocked --covered-requirement "release report is read-only" --uncovered-requirement "npm auth verified" --blocked-kind auth_blocked --failure-cause auth_token_invalid --safe-retry "retry after npm whoami succeeds" --recovery-hint "refresh npm auth, then rerun readiness checks" --fix-first-item "npm auth must be verified before publish" --remaining-task "rerun release report after auth refresh" --recommended-direction "fix npm auth first, then publish manually" --implementation-note "keep loop report read-only" --why-this-next "auth blocks public release claims" --blocked-by "npm whoami E401" --owner-route deep --owner-scope "release readiness only" --scope-owner deep --side-effect "no publish attempted" --avoidance-note "do not retry publish before npm auth is proven" --issue-code "src/bin/yam.ts release report" --issue-role "summarizes release readiness without publishing" --issue-symptom "npm auth failure needs clearer next action" --changed-code "yam loop report" --changed-role "records loop evidence and learning note" --change-summary "added a read-only loop artifact" --why-important "it helps users learn what changed without overclaiming verification" --learning-note "fix blockers before claiming done" --json
162
223
  yam release report --json
163
224
  yam safety "supabase db reset"
164
- yam detect /path/to/project
165
225
  yam pack /path/to/project
166
226
  yam hook status --global
167
227
  yam hook enable lite --global
@@ -246,7 +306,8 @@ These shapes keep reports machine-readable without turning normal work into a he
246
306
  - Publish blocker evidence: release reports classify common npm auth, permission, OTP, immutable-version, cache, registry, and tarball failures into safe next actions.
247
307
  - Publish readiness evidence: release reports run read-only registry/auth/version probes, redact account/token details, keep npm publish outside the report, and include a `yam.release-readiness-receipt.v1` basis for the readiness judgment.
248
308
  - Context pressure: `yam context pressure` explains when project context is getting stale, broad, or confusing enough to summarize, refresh, narrow scope, or deepen route.
249
- - Cleanup scan: `yam cleanup scan` is read-only and advisory; it reports confusing hooks, local skill folders, stale traces, or old proof artifacts without deleting anything.
309
+ - Changed-file verification detector: `yam detect [dir] --json` reads dirty, staged, and untracked Git paths and returns advisory `matched_rule`, `confidence`, `reason`, `fallback`, source files, and only commands that exist in the project. Its deduplicated command plan retains the contributing rules and files, but never runs the commands. If Git status is unavailable, it reports a low-confidence fallback instead of claiming the project is clean.
310
+ - Cleanup scan: `yam cleanup scan` is read-only and advisory; it reports confusing hooks, local skill folders, stale traces, or old proof artifacts without deleting anything. Its bounded AGENTS/SKILL duplication budget scans at most 24 files and 128 KB per file, reports exact normalized cross-surface directive matches with redacted previews and provenance, and never becomes a hard gate.
250
311
  - Benchmark optimization loop lite: use `yam measure <route>` and `yam template tuning` to record baseline, one route wording change, rerun result, keep/revert decision, and stop condition.
251
312
  - Structured diagnostic next action: every doctor/release diagnostic should say what was observed, what evidence supports it, what to do next, owner route, severity, and truth status.
252
313
  - Ueye review continuity/comparison report: `$ueye` run reports can link a previous review, current evidence, comparison delta, design quality result, and next action.
package/ROADMAP.md CHANGED
@@ -51,8 +51,8 @@ Tasks:
51
51
 
52
52
  - Read `package.json` scripts.
53
53
  - Detect common commands: typecheck, lint, test, build. Done.
54
- - Map changed files to likely checks. Partial: route-level suggestions added.
55
- - Keep this advisory, not mandatory.
54
+ - Map changed files to likely checks. Done: dirty, staged, and untracked paths now map to focused rules with confidence, reason, fallback, and available commands.
55
+ - Keep this advisory, not mandatory. Done.
56
56
 
57
57
  ### 4. Token Budget Reporter
58
58
 
@@ -97,6 +97,7 @@ Tasks:
97
97
  - Add symlink-friendly local install.
98
98
  - Add version command. Done.
99
99
  - Add staged transactional install, rollback, receipt, and drift-aware status. Done.
100
+ - Add checked component updates for yam, Scrapling, and Insane Search with explicit authorization, receipts, and rollback guidance. Done.
100
101
  - Consider npm packaging only after route behavior stabilizes.
101
102
 
102
103
  ### 8. Scout / Research Workflow