@sabaiway/agent-workflow-kit 18.0.0 → 19.0.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/CHANGELOG.md +28 -0
- package/SKILL.md +1 -1
- package/capability.json +1 -1
- package/package.json +1 -1
- package/references/advisor-writers.md +1 -1
- package/references/contracts.md +4 -1
- package/references/modes/jev.md +1 -1
- package/references/modes/recommendations.md +2 -2
- package/tools/apply-danger-check.mjs +8 -4
- package/tools/jev-facts.mjs +4 -1
- package/tools/jev-skill.mjs +7 -5
- package/tools/recommendations.mjs +26 -16
- package/tools/write-lanes.mjs +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,34 @@ Semantically versioned ([semver](https://semver.org)), newest first. The `versio
|
|
|
4
4
|
is the current release. `upgrade` mode reads a project's `docs/ai/.workflow-version` and applies
|
|
5
5
|
every `migrations/<version>-<slug>.md` newer than it, in semver order.
|
|
6
6
|
|
|
7
|
+
## 19.0.0 — the Jev copy is written current with no question beside a copy at a kit pin; `jev-skill.earlier` retires (AD-210)
|
|
8
|
+
|
|
9
|
+
**MAJOR: the advisor's `jev-skill.earlier` item is gone, and `apply-danger-check --variant jev-skill.earlier` is a
|
|
10
|
+
usage refusal, exit 2.** Before, the vendor's Jev skill copy in the agent skill roots was never updated silently: a copy
|
|
11
|
+
at an earlier pin was replaced only on your yes to `jev-skill.earlier`, and an absent root was filled only on your yes
|
|
12
|
+
to the `jev-skill` offer, both shown only once `TYPESAFE_API_KEY` was set. Now a copy whose two files match a pin the
|
|
13
|
+
kit shipped is the kit's, and beside one such copy in any of the three roots (`~/.agents/skills`, the Claude Code skills
|
|
14
|
+
dir, `~/.gemini/config/skills`) every root absent or behind the kit's pin is written with no question. A copy matching
|
|
15
|
+
no pin, a link or any other node there is yours: left untouched and named.
|
|
16
|
+
|
|
17
|
+
- **A new kit item, `jev-skill.not-current`.** Beside a copy at a kit pin the advisor renders this `lane: kit` item,
|
|
18
|
+
which the agent applies with no question by the kit route, whatever the key and whatever decline you recorded. Its
|
|
19
|
+
text reads `Jev's vendor skill is absent or behind the kit's pin in {n} agent skill root(s) beside a copy at a kit
|
|
20
|
+
pin — written with no question`, and its `recipe:` line names every root its apply writes and each foreign copy it
|
|
21
|
+
leaves.
|
|
22
|
+
- **The offer is for a first install only.** Where no root holds a copy at a kit pin, the `jev-skill` offer is
|
|
23
|
+
unchanged — the key gate, the decline, your yes — and its text now reads `a skill root the kit fills is absent`.
|
|
24
|
+
- **The danger check** for the kit item admits the skill roots only while it judges the component accepted itself;
|
|
25
|
+
over a home with no copy at a kit pin it admits nothing, so each planned write prints `refused:`, exit 1, and the
|
|
26
|
+
no-question apply installs nothing there. A copy at a kit pin removed between the check and the writer's own read is
|
|
27
|
+
not seen: the writer still fills every root it plans. A copy the vendor's `skills` CLI wrote with the same bytes
|
|
28
|
+
counts as a copy at a kit pin.
|
|
29
|
+
- **The skill command's line.** `jev-skill.mjs --apply` prints `leftover: <path> — <cause>` where it printed
|
|
30
|
+
`kept aside:`; its plan, argv and exit codes are unchanged. A script that read `kept aside:` reads `leftover:`.
|
|
31
|
+
- **The texts say the same.** The skill command's header, which now names the four routes that apply it; the jev and
|
|
32
|
+
recommendations modes; `references/advisor-writers.md`; the guide's *Reserved names and channels*, which names the
|
|
33
|
+
vendor skill copy at a kit pin as the kit's.
|
|
34
|
+
|
|
7
35
|
## 18.0.0 — the kit's two hook files are written current within a hook you wired; `gate-hook --reseed` and three advisor items retire (AD-209)
|
|
8
36
|
|
|
9
37
|
**MAJOR: `gate-hook.mjs --reseed` is removed, and the advisor's `gate-hook.marker-stale`, `read-lane.stale` and
|
package/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: agent-workflow-kit
|
|
|
3
3
|
description: Deploy or upgrade a portable AI-agent memory-and-workflow system in any project. Use when the user wants to bootstrap `docs/ai/` + an entry-point `AGENTS.md` (+ `CLAUDE.md` alias) + cap/archive/index enforcement in a new or existing repo, set up the Memory Map and session protocols, install the docs-rotation pre-commit hook, or run `/agent-workflow-kit` / `/agent-workflow-kit upgrade`. Triggers on phrases like "set up the memory system", "deploy the AI workflow here", "bootstrap docs/ai", "upgrade the workflow". New to the epic, story and task tier? Run `/agent-workflow-kit tier`. A typed decision with a confidence from Jev? Run `/agent-workflow-kit jev`.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
metadata:
|
|
6
|
-
version: '
|
|
6
|
+
version: '19.0.0'
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# agent-workflow-kit
|
package/capability.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sabaiway/agent-workflow-kit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0",
|
|
4
4
|
"description": "Portable, cross-agent memory & workflow for AI coding agents — Claude Code, Codex, Cursor, Devin Desktop. One command deploys an AGENTS.md entry point + docs/ai context with cap/archive/index enforcement into any repo.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
| profile-gap | chat | rules-insert.mjs, tier-preview.mjs, checker-gates.mjs |
|
|
49
49
|
| jev-connect | user | user step |
|
|
50
50
|
| jev-skill | harness | jev-skill.mjs |
|
|
51
|
-
| jev-skill.
|
|
51
|
+
| jev-skill.not-current | kit | jev-skill.mjs |
|
|
52
52
|
| spec-adoption.adopting | chat | ack-write.mjs |
|
package/references/contracts.md
CHANGED
|
@@ -101,7 +101,10 @@ files (the five the kit bundles for `.claude/agents/` — `changelog-skeleton.md
|
|
|
101
101
|
`gate-triage.md`, `mechanical-sweep.md`, `review-lens.md` — and each configured
|
|
102
102
|
`review-lens-<model>-<effort>.md`) and, within a hook you wired, the kit hook files
|
|
103
103
|
`.claude/hooks/agent-workflow-gates.mjs` and `.claude/hooks/state-block-guard.mjs` are written over
|
|
104
|
-
by the next upgrade with no question and no copy kept.
|
|
104
|
+
by the next upgrade with no question and no copy kept.
|
|
105
|
+
Also the kit's: the vendor skill copy the kit installs into the three agent skill roots
|
|
106
|
+
when it matches a pin the kit shipped, written with no question beside a copy at a kit pin;
|
|
107
|
+
a copy matching none is the user's, left and named. A declaration seeded once from a template and never
|
|
105
108
|
replaced by the upgrade's ensures (a migration rewrites one only on the user's explicit yes) is the
|
|
106
109
|
user's own file. A customization goes into one of seven channels instead:
|
|
107
110
|
|
package/references/modes/jev.md
CHANGED
|
@@ -9,7 +9,7 @@ Run `node ${CLAUDE_SKILL_DIR}/tools/jev-guide.mjs --dir <project> --json`.
|
|
|
9
9
|
|
|
10
10
|
Render the returned envelope compactly in the user's conversational language. Never paste the JSON. Keep every path and every command verbatim, each command on its own line so it runs as printed; translate only the prose around them. Keep the one vendor-quoted text verbatim and in quotes, never translated or reflowed: the not-a-replacement sentence. The `Run it in <place>:` line, when the guide printed one, stays directly before the connect line and is never folded into it; the restart step is relayed whole.
|
|
11
11
|
|
|
12
|
-
The connect line is the user's own step — hand it over as printed; it asks for the key in their terminal, so the key never reaches the agent or the chat; the connect command refuses without a terminal, and a terminal is not consent. The agent applies the skill only through the advisor's `jev-skill`
|
|
12
|
+
The connect line is the user's own step — hand it over as printed; it asks for the key in their terminal, so the key never reaches the agent or the chat; the connect command refuses without a terminal, and a terminal is not consent. The agent applies the skill only through the advisor's `jev-skill` items: the offer's check line, and on the user's yes on that result its apply line, or, beside a copy at a kit pin, the kit item `jev-skill.not-current` by the kit route with no question (spec kit/install/init-project); where the advisor shows no `jev-skill` item, STEP 2's line is the user's own step. The guide's line is the user's command for a terminal of their own. The vendor's install lines are the user's own step too. Only when the user asks to see the plan, run the skill command without `--apply` yourself: a read-only dry run that writes nothing.
|
|
13
13
|
|
|
14
14
|
Keep this order: the fixed text (WHAT, WHY HERE, NOT, SOURCES); then the two steps — the key with its connect line and its mark, the vendor skill with its install lines, its mark and its first prompt; then the three prompts where it pays.
|
|
15
15
|
|
|
@@ -22,7 +22,7 @@ Run `node ${CLAUDE_SKILL_DIR}/tools/recommendations.mjs --cwd <project-root> [--
|
|
|
22
22
|
|
|
23
23
|
The **consent route** for a harness item: run its `check:` line in the sandbox and show its result. On the check's `masked:` line, say so and run that same check line once more outside the sandbox, so it re-judges in the apply's own environment; the yes is taken on the outside result. Take the user's yes on that result and run its `apply:` line with that result's digest once, outside the sandbox at once, so the harness asks at the point of action (with the apply ask rule seeded, its own dialog); never another line, never unseen. When velocity-core, kit-tools-tier or bridge-tier is among the user's picks (velocity-core preferred), check, confirm and apply it, or leave it pending, before any other pick's check runs, so its apply seeds the ask rule before the other harness applies. When the harness's auto mode refuses the check or the apply, say so and give the one plain step: leave auto mode for this one action (Shift+Tab in the terminal, the mode indicator in an editor) and say yes, or run `npx @sabaiway/agent-workflow-kit@latest init` in a terminal of your own. On the user's word, run the same line once more when they left auto mode, never another, never unseen; when they ran `init` instead, run the advisor again and offer only what is still pending, each through this route from its check (after a restart `init` asked for, the next session's upgrade does it). When that refusal hits the velocity-core, kit-tools-tier or bridge-tier pick taken first, run no other pick's check until the user answers the plain step. A check that refuses (exit 1) leaves the item unapplied and pending, its result shown; a changed digest (exit 5) applies nothing, shows the new result and asks a new yes. A no, a harness refusal and any other failure of a harness apply leave the item pending with its output shown, and the agent continues. `init`, run in a console from the project's folder, is the route the user may take instead.
|
|
24
24
|
|
|
25
|
-
**The kit route** for a `lane: kit` item, which writes a kit file of a component the project already has: ask no question and wait for no pick. Before offering the other items, run each kit item's `check:` line in the sandbox and show its result, then at once run its `apply:` line with that result's digest once, outside the sandbox; the harness's own dialog there is its consent, which the kit cannot remove. A changed digest (exit 5) re-runs the check once and applies with its new digest, still with no question; every other outcome leaves the item pending with its output shown, and the agent goes on; an auto-mode refusal gets the one plain step above. `init` checks and applies it on its one y, as a harness item.
|
|
25
|
+
**The kit route** for a `lane: kit` item, which writes a kit file of a component the project already has or the host already accepted: ask no question and wait for no pick. Before offering the other items, run each kit item's `check:` line in the sandbox and show its result, then at once run its `apply:` line with that result's digest once, outside the sandbox; the harness's own dialog there is its consent, which the kit cannot remove. A changed digest (exit 5) re-runs the check once and applies with its new digest, still with no question; every other outcome leaves the item pending with its output shown, and the agent goes on; an auto-mode refusal gets the one plain step above. `init` checks and applies it on its one y, as a harness item.
|
|
26
26
|
|
|
27
27
|
**The `executor-vehicle` item (the carrier the project already CONFIGURED — beside the `agents` offer, never the same item).** It fires on ONE pair of facts: a slot in `docs/ai/orchestration.json` names `subagent` while the executor vehicle (`.claude/agents/executor.md`) is `missing` or `unusable` — so every such slot silently degrades to solo. That is a configured declaration that is broken, hence **`attention`**, not an offer; its text names the state, its reason and how many configured slots are affected across the six activities (`plan-authoring`, `plan-execution`, `routine`, `feedback-triage`, `epic`, `task`), covering the subagent-capable slots `plan-authoring.author`, `plan-authoring.fold`, `plan-execution.execute`, `routine.carrier`, `epic.author`, `task.author` and `task.execute`. **`placed` renders NOTHING** (a working vehicle is not a recommendation); it yields to `agents.not-current`, the kit item the agent applies with no question, which writes a regular executor whose bytes differ, the check failing or not, in a placed component; a config naming no `subagent` slot renders no base item, and a config the validated reader refuses is a stated **skip**, never an item computed over a shape nothing accepted. It is deliberately DISTINCT from the `agents` offer and the review-recipe probe, neither of which can observe this state. The agent applies it on the chat yes after the check; `init` previews the agents writer's own `cheap-agents.mjs` and applies it with `--apply` on the terminal yes as a route the user may take instead. Its `recipe:` line carries each precondition the advisor observes beside the apply slot, followed by the hidden-mode reconcile follow-up (`hide-footprint --reconcile`), for a hidden deployment only. Honest limit on convergence: the apply places an ABSENT vehicle, so it clears `missing`; it STOPs on a symlink, so on `unusable` the `recipe:` line names each refusal as a precondition; an executor whose frontmatter is invalid is written by the apply itself. Risk profile: writes under `.claude/agents/` only — every kit agent file written current with no question, the executor's and the review lens's bodies derived from `docs/ai/vehicles.json` — never `settings.json`, never a commit.
|
|
28
28
|
|
|
@@ -48,7 +48,7 @@ A variant's posture note, where its key has one, is printed by `init` from this
|
|
|
48
48
|
- `spec-adoption` — the feature-spec layer's ADOPTION STATE, judged from `docs/ai/specs/` alone through the same census `spec-check --all` runs, so a store the checker would refuse to observe is never counted here either. Both arms are OFFERS (`optional`) — the layer is opt-in, and `attention` stays reserved for a configured declaration that is broken. **`not-adopted`** (no store): every plan then cites zero governing specs by default and nothing says adoption never started; its apply is the spec-layer ensure one-liner (`ensure-configs --reconcile --only specs`, the same seed `upgrade` runs — it seeds the reader/checker pairs and the store root, and skips with a stated reason where no Node evidence exists), and its `recipe:` line carries the decline alternative — the DECLINE preview (`ack-write --lane spec-adoption`, a dry-run that prints the exact `--apply`), which records `specAdoptionAck` in the family-owned `docs/ai/acks.json`. **The two are exclusive, and the order is part of the contract:** ask which the user wants, apart, BEFORE the confirmation; on "seed" run the apply; on "decline" the agent records it — the preview line, then on that same answer its printed `--apply`; never run the seed after a decline, nor the decline after the seed. **`adopting`** (a store with no live contract): an optional item naming the draft count; its apply is that same decline preview (a dry-run; after the SAME confirmation you run the `--apply` it prints), and the honest remedy is authoring a contract from the skill's `SPEC_TEMPLATE.md`. A recorded decline silences BOTH arms and shows on `status` as ` — declined`; one live contract makes the decline moot. An unreadable store is a stated skip, never `flow optimal`. Risk profile: the seed writes create-only files under `scripts/` and `docs/ai/specs/` and refreshes a script body a release shipped; it writes an edited spec-layer file with the bundled body with no question, its line naming where an edit meant to last goes; the decline writes one key into the ack store; nothing here authors a spec or blocks a plan.
|
|
49
49
|
- `profile-gap` — each item's apply is a PREVIEW that writes nothing, and consent takes two steps: the confirmed pick runs the preview and you relay every line it prints (the environment-resolved slot values, each checker `entry:` line with its trust-chain disclosure, a Communication region the insert plans in the same run); the same line with ` --apply` appended runs only on a SECOND yes over those lines, never carried by the first. Items whose apply lines are byte-equal are one writer and take one answer: the tier preview's `--apply` writes the absent slots, the store seed and the queue seed together; the checker verb writes only its own entries; the insert writes every region it plans, all or nothing, so a `communication-absent` skip beside a declined `story-sessions-section` gets its own ask after the insert's full preview. A no records nothing and the item stays on the screen. A DECLINE is asked apart from later, before anything runs, and runs `node ${CLAUDE_SKILL_DIR}/tools/tier-preview.mjs --decline --cwd <project-root>` only when the user refuses EVERY item the tier preview then reports offered: it records each of them at the shipped lineage, and a declined item leaves the screen until a lineage step changes the profile. An undecidable entry is a stated skip naming its reason, the remedy by reason: a prior → the upgrade's `lens` reconcile; an absent region → the insert; a customized region → a hand edit only (the lens preserves it), so that skip stands and withholds `flow optimal`. Risk profile: the tier preview's `--apply` rewrites `docs/ai/orchestration.json` in canonical form with the `_README` note and creates `docs/ai/epics/.gitkeep` and `docs/plans/queue.md` create-only; the insert adds regions to `docs/ai/agent_rules.md`; the checker verb adds entries to the PRIVILEGED `docs/ai/gates.json`; the decline writes `docs/ai/profile-declines.json`; nothing here commits.
|
|
50
50
|
- `jev-connect` — the lane is user and env-dependent: the connect command is the user's own step in a terminal of their own, where it asks for the key; the key never reaches the agent or the chat (the command refuses without a terminal, and a terminal is not consent). When the recipe line opens with `run the apply in <place>`, that place is the terminal to run it in; `init`, run there, offers the command on its own consent line. The command reads the key with no echo, makes one network call to api.typesafe.ai with the vendor's sample text only on the user's own run, and writes the key in plain text — as managed export lines in the shell's startup files (bash: ~/.bashrc and the login file, created as ~/.bash_profile when none exists; zsh: ~/.zshrc), as the kit's own file ~/.config/fish/conf.d/typesafe-api-key.fish for fish, or on Windows as the user environment variable TYPESAFE_API_KEY, stored in the Windows user environment; a process already running at the save can keep its old environment and hand it to what it starts — the guide's key mark confirms the agent sees it (a file is readable by any process running as that user, and by other local accounts when one is world-readable in a traversable home); the vendor keeps data under its processing agreement and offers zero retention only to enterprise accounts. The item reads the environment the agent's commands run in: a host setting that filters it shows the item while the key is set in the user's shell. The decline alternative rides the recipe line, asked apart BEFORE the confirmation (the `spec-adoption` order): on "connect" hand over the apply line; on "decline" the agent records it — the recipe line's preview, then its printed `--apply` — per project as `jevConnectAck` in `docs/ai/acks.json`. Risk profile: a plain-text key in the user's startup files or the Windows user environment, written by a command the user runs; one network call from that run.
|
|
51
|
-
- `jev-skill` —
|
|
51
|
+
- `jev-skill` — two arms, both env-dependent. The offer `jev-skill`, lane harness, shows once `TYPESAFE_API_KEY` is set and no decline is recorded, while no skill root holds a copy at a kit pin and a root the kit fills is absent: the agent applies it on the chat yes after the check, showing the files it would write; it changes no harness setting. `init` applies it on the batch terminal yes as the route the user may take instead. When the recipe line opens with `run the apply in <place>`, that place is where a user who prefers their own terminal runs it. The kit item `jev-skill.not-current`, lane kit, shows beside a copy at a kit pin in any root: the kit route applies it with no question, writing every root absent or behind the kit's pin. The skill is third-party text — the vendor's, MIT — that the kit ships pinned and installs as a verified copy into three agent skill roots: `~/.agents/skills`, the Claude Code skills dir (`CLAUDE_CONFIG_DIR` or `~/.claude`) and `~/.gemini/config/skills`. The copy is written current with no question beside a copy at a kit pin; a foreign copy is left untouched and named on the recipe line. A copy the vendor's `skills` CLI wrote with the same bytes reads current, accepts the component and is written at a later pin like a kit copy; a vendor plugin install is invisible to the file check, so the Claude Code root may read absent while the plugin serves it. Only when the user asks to see the plan does the agent run the command without `--apply` (a read-only dry run). The decline alternative rides the offer's recipe line, asked apart BEFORE the confirmation: on "install" run the check line and, on the yes given on its result, the apply line by the consent route; on "decline" the agent records it — the recipe line's preview, then its printed `--apply` — per project as `jevSkillAck` in `docs/ai/acks.json`. Risk profile: third-party text written into the user's agent skill roots by the kit's skill command; no network.
|
|
52
52
|
|
|
53
53
|
**Sandbox lanes (what to DO with the bridge surfaces, per host class):**
|
|
54
54
|
|
|
@@ -21,7 +21,7 @@ import { writeMcp } from './mcp.mjs';
|
|
|
21
21
|
import { ENABLED_KEY, MCP_JSON_REL, SERVERS_KEY, SERVER_NAME, allowRulesFor, buildServerEntry } from './mcp-registration.mjs';
|
|
22
22
|
import { AGENTS_DIR, agentsAccepted, kitAgentNames, writeCheapAgents } from './cheap-agents.mjs';
|
|
23
23
|
import { planFor } from './jev-skill.mjs';
|
|
24
|
-
import { SKILL_FILES, claudeDirOf, skillTargets } from './jev-facts.mjs';
|
|
24
|
+
import { SKILL_FILES, claudeDirOf, skillAccepted, skillState, skillTargets } from './jev-facts.mjs';
|
|
25
25
|
import { findOnPath } from './detect-backends.mjs';
|
|
26
26
|
import { consoleArgv } from './write-lanes.mjs';
|
|
27
27
|
import { BUNDLED_SCRIPT_NAMES, INSTALLER_REL, SCRIPTS_REL, formatPlan, planGitHooks } from './git-hooks.mjs';
|
|
@@ -31,7 +31,8 @@ import { isDirectRun } from './direct-run.mjs';
|
|
|
31
31
|
import { dirCovers as covers } from './declared-paths.mjs';
|
|
32
32
|
|
|
33
33
|
const TOOLS = dirname(fileURLToPath(import.meta.url));
|
|
34
|
-
const
|
|
34
|
+
const SKILL_KIT = 'jev-skill.not-current';
|
|
35
|
+
const SKILL_VARIANTS = ['jev-skill', SKILL_KIT];
|
|
35
36
|
const VELOCITY_VARIANTS = ['velocity-core', 'kit-tools-tier', 'bridge-tier'];
|
|
36
37
|
const [GATE_KIT, STOP, STOP_KIT] = ['gate-hook.not-current', 'state-block', 'state-block.not-current'];
|
|
37
38
|
const [HOOK_VARIANTS, STOP_VARIANTS, KIT_HOOKS] = [['gate-hook', GATE_KIT], [STOP, STOP_KIT], [GATE_KIT, STOP_KIT]];
|
|
@@ -171,6 +172,7 @@ const unmaskedLstat = (facts) => (path, ...args) => {
|
|
|
171
172
|
return stat;
|
|
172
173
|
};
|
|
173
174
|
const kitHookWired = (variant, facts) => SETTINGS_FILES.some((rel) => (variant === GATE_KIT ? isHookWired : isStopHookWired)(readSettingsFile(join(facts.root, rel), { lstat: unmaskedLstat(facts), cwd: facts.root }).data));
|
|
175
|
+
const skillIo = (deps) => ({ lstat: deps.lstat ?? lstatSync, readdir: deps.readdir ?? readdirSync, readFile: deps.readFile ?? readFileSync, pins: deps.pins });
|
|
174
176
|
|
|
175
177
|
export const scopeOf = (variant, facts, deps = {}) => {
|
|
176
178
|
const allowed = {};
|
|
@@ -210,8 +212,10 @@ export const scopeOf = (variant, facts, deps = {}) => {
|
|
|
210
212
|
set(ENABLED_KEY, [SERVER_NAME]);
|
|
211
213
|
set('permissions.allow', allowRulesFor());
|
|
212
214
|
}
|
|
213
|
-
const
|
|
215
|
+
const judged = SKILL_VARIANTS.includes(variant) ? skillTargets({ home: facts.home,
|
|
214
216
|
claudeDir: facts.claudeDir ?? claudeDirOf(facts.env, facts.home, facts.platform).dir }) : [];
|
|
217
|
+
// The kit skill variant's scope holds only while the check's own judgement accepts the component, never read from the plan.
|
|
218
|
+
const targets = variant !== SKILL_KIT || skillAccepted(judged.map((target) => ({ ...target, ...skillState(target, skillIo(deps)) }))) ? judged : [];
|
|
215
219
|
const accepted = !KIT_HOOKS.includes(variant) || kitHookWired(variant, facts);
|
|
216
220
|
const filePaths = !accepted ? [] : HOOK_VARIANTS.includes(variant) ? [join(facts.root, HOOK_FILE_REL)] : STOP_VARIANTS.includes(variant) ? [join(facts.root, STATE_BLOCK_HOOK_FILE_REL)] : [];
|
|
217
221
|
const directories = !accepted || SKILL_VARIANTS.includes(variant) || variant === FOOTPRINT ? [] : [join(facts.root, CLAUDE_DIR)];
|
|
@@ -313,7 +317,7 @@ export const plannedChange = (variant, facts, deps = {}) => {
|
|
|
313
317
|
writes.push({ path: item.abs, bytes: item.content });
|
|
314
318
|
}
|
|
315
319
|
} else if (SKILL_VARIANTS.includes(variant)) {
|
|
316
|
-
const plan = planFor({ ...writerDeps, lstat: lstatSync, readdir: readdirSync, readFile: readFileSync });
|
|
320
|
+
const plan = (deps.planFor ?? planFor)({ ...writerDeps, lstat: lstatSync, readdir: readdirSync, readFile: readFileSync });
|
|
317
321
|
for (const target of plan.targets.filter(({ action }) => ['install', 'replace'].includes(action))) {
|
|
318
322
|
const stem = basename(target.path);
|
|
319
323
|
const bytes = Object.keys(SKILL_FILES).sort().map((name) => [name,
|
package/tools/jev-facts.mjs
CHANGED
|
@@ -61,7 +61,7 @@ export const JEV_ERROR_MEANINGS = Object.freeze({
|
|
|
61
61
|
|
|
62
62
|
// ── the vendor skill (part jev-skill) ─────────────────────────────────────────────────────────────
|
|
63
63
|
// Each target file name -> the name the kit ships it under. The shipped SKILL.md is renamed so no agent
|
|
64
|
-
// walking the kit's own tree (a skill folder itself) loads the vendor's text before
|
|
64
|
+
// walking the kit's own tree (a skill folder itself) loads the vendor's text before an --apply places it.
|
|
65
65
|
export const SKILL_FILES = Object.freeze({ 'SKILL.md': 'SKILL.md.pinned', LICENSE: 'LICENSE' });
|
|
66
66
|
// Newest first; a release that moves the pin puts the new entry first and removes none.
|
|
67
67
|
export const SKILL_PINS = Object.freeze([Object.freeze({
|
|
@@ -144,6 +144,9 @@ export const skillState = (target, io) => {
|
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
+
// The component is accepted exactly when a judged target reads current or earlier: a copy at a kit pin.
|
|
148
|
+
export const skillAccepted = (judged) => judged.some(({ state }) => state === 'current' || state === 'earlier');
|
|
149
|
+
|
|
147
150
|
// The skill command's apply line, always with the Claude Code dir its caller resolved; '' when a path holds a control byte.
|
|
148
151
|
export const skillLine = (toolsDir, platform, claudeDir) => {
|
|
149
152
|
if ([...`${toolsDir}${claudeDir}`].some(isControl)) return '';
|
package/tools/jev-skill.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// spec:jev-guide — docs/ai/specs/kit/jev-guide/jev-skill.md
|
|
3
3
|
// The one command that installs the vendor's Jev skill, pinned and digest-checked, as a verified COPY into
|
|
4
|
-
// the three agent skill roots.
|
|
5
|
-
//
|
|
6
|
-
//
|
|
4
|
+
// the three agent skill roots. Its --apply comes by four routes: the advisor's kit item, with no question
|
|
5
|
+
// beside a copy at a kit pin; the offer, on the chat yes after the danger check; init, on its terminal y;
|
|
6
|
+
// and the user's own terminal. Without --apply it is a read-only dry run. It reads no secret, needs no
|
|
7
|
+
// terminal, opens no connection, never writes through a link below a base, and never removes a leftover it
|
|
8
|
+
// did not mint this run.
|
|
7
9
|
import { createHash } from 'node:crypto';
|
|
8
10
|
import { lstatSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
|
|
9
11
|
import { homedir } from 'node:os';
|
|
@@ -125,7 +127,7 @@ export const applyTarget = (entry, io) => {
|
|
|
125
127
|
io.rm(aside, { recursive: true, force: true });
|
|
126
128
|
} catch (error) { kept = codeOf(error); }
|
|
127
129
|
}
|
|
128
|
-
if (kept !== null) lines.push(`
|
|
130
|
+
if (kept !== null) lines.push(`leftover: ${printable(join(aside, 'typesafe-ai'))} — ${kept}`);
|
|
129
131
|
}
|
|
130
132
|
return { lines, outcome: 'refused' };
|
|
131
133
|
};
|
|
@@ -168,7 +170,7 @@ export const applyTarget = (entry, io) => {
|
|
|
168
170
|
const old = { base: aside, path: join(aside, 'typesafe-ai') };
|
|
169
171
|
const verified = skillState(old, io);
|
|
170
172
|
if (verified.state === 'earlier') io.rm(aside, { recursive: true, force: true });
|
|
171
|
-
else lines.push(`
|
|
173
|
+
else lines.push(`leftover: ${printable(old.path)} — it reads ${verified.state}`);
|
|
172
174
|
lines.unshift(`replaced: ${path} (${entry.tag} → ${io.pins[0].tag})`);
|
|
173
175
|
return { lines, outcome: 'replaced' };
|
|
174
176
|
} catch (error) {
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
import { ADOPTION, STORE_DIR_REL as SPEC_STORE_DIR_REL, SPEC_ADOPTION_LANE, declineFingerprint, readDeclineAck, surveySpecAdoption } from './spec-adoption.mjs';
|
|
106
106
|
import { ENSURE_OPS } from './ensure-vocabulary.mjs';
|
|
107
107
|
import { composeProfileGapScreen } from './profile-gap-screen.mjs';
|
|
108
|
-
import { NO_APPLY_LINE, SKILL_PINS, claudeDirOf, keySet, placeOf, printable, skillLine, skillState, skillTargets } from './jev-facts.mjs';
|
|
108
|
+
import { NO_APPLY_LINE, SKILL_PINS, claudeDirOf, keySet, placeOf, printable, skillAccepted, skillLine, skillState, skillTargets } from './jev-facts.mjs';
|
|
109
109
|
|
|
110
110
|
// The upgrade ensure that seeds the spec store — the not-adopted item's apply; pinned to the vocabulary.
|
|
111
111
|
const SPEC_LAYER_ENSURE = ENSURE_OPS.includes('specs') ? 'specs' : null;
|
|
@@ -226,7 +226,7 @@ export const SEVERITIES = Object.freeze({
|
|
|
226
226
|
'profile-gap': SEVERITY_OPTIONAL,
|
|
227
227
|
'jev-connect': SEVERITY_OPTIONAL,
|
|
228
228
|
'jev-skill': SEVERITY_OPTIONAL,
|
|
229
|
-
'jev-skill.
|
|
229
|
+
'jev-skill.not-current': SEVERITY_OPTIONAL,
|
|
230
230
|
'spec-adoption.adopting': SEVERITY_OPTIONAL,
|
|
231
231
|
});
|
|
232
232
|
// The per-item render tags (frozen presentation data, same language contract as the templates).
|
|
@@ -311,8 +311,8 @@ export const WHATS = Object.freeze({
|
|
|
311
311
|
'spec-adoption': 'feature-spec store absent (docs/ai/specs) — no feature contract can govern a plan here yet; seed the store, or record the decline',
|
|
312
312
|
'profile-gap': '{what}',
|
|
313
313
|
'jev-connect': 'Jev (TypeSafe) is not connected: TYPESAFE_API_KEY is not in the environment the agent\'s commands run in',
|
|
314
|
-
'jev-skill': 'Jev\'s vendor skill is not installed for every agent here: a skill root the kit fills is absent
|
|
315
|
-
'jev-skill.
|
|
314
|
+
'jev-skill': 'Jev\'s vendor skill is not installed for every agent here: a skill root the kit fills is absent',
|
|
315
|
+
'jev-skill.not-current': 'Jev\'s vendor skill is absent or behind the kit\'s pin in {n} agent skill root(s) beside a copy at a kit pin — written with no question',
|
|
316
316
|
'spec-adoption.adopting': 'feature-spec store: {n} draft spec(s), no live contract — nothing governs a plan through it yet; land a live contract, or record the decline',
|
|
317
317
|
});
|
|
318
318
|
|
|
@@ -384,6 +384,7 @@ export const VARIANT_BENEFITS = Object.freeze({
|
|
|
384
384
|
'agents.not-current': 'currency — each kit agent file carries the body the kit writes for it today, model and effort where docs/ai/vehicles.json names them',
|
|
385
385
|
'gate-hook.not-current': HOOK_CURRENCY_BENEFIT,
|
|
386
386
|
'state-block.not-current': HOOK_CURRENCY_BENEFIT,
|
|
387
|
+
'jev-skill.not-current': "currency — every agent skill root the kit fills holds the vendor skill at the kit's pin once a copy is placed",
|
|
387
388
|
'source-size.layout': 'layout — piles past the layout limits become recorded, reasoned debt, so the commit hook can judge new ones once its layout line is armed',
|
|
388
389
|
});
|
|
389
390
|
|
|
@@ -1472,34 +1473,43 @@ export const probeJevConnect = ({ root, deps, add, skip }) => {
|
|
|
1472
1473
|
}
|
|
1473
1474
|
};
|
|
1474
1475
|
|
|
1475
|
-
// The Jev skill
|
|
1476
|
-
//
|
|
1476
|
+
// The Jev skill (contract: kit/jev-guide, parts jev-offer and jev-copy). The targets are judged whatever the key; a
|
|
1477
|
+
// component a copy at a kit pin accepts renders the kit item, written with no question, and reads no key and no ack;
|
|
1478
|
+
// otherwise the offer, only once the key is set, so the offer and jev-connect never show together. The apply is the lane leaf's checked slot.
|
|
1477
1479
|
export const probeJevSkill = ({ root, deps, add, skip }) => {
|
|
1478
1480
|
try {
|
|
1479
1481
|
const env = deps.getenv ?? {};
|
|
1480
|
-
if (deps.keySet !== true && !keySet(env)) return;
|
|
1481
1482
|
const host = deps.jevHost ?? {};
|
|
1482
1483
|
if (typeof host.home !== 'string' || host.home === '') return;
|
|
1483
1484
|
const pins = deps.jevPins ?? SKILL_PINS;
|
|
1484
1485
|
const { dir, note } = claudeDirOf(env, host.home, host.platform);
|
|
1485
1486
|
const io = { lstat: deps.lstat ?? lstatSync, readdir: deps.readdir ?? readdirSync, readFile: deps.readFile ?? readFileSync, pins };
|
|
1486
1487
|
const judged = skillTargets({ home: host.home, claudeDir: dir }).map((target) => ({ ...target, ...skillState(target, io) }));
|
|
1487
|
-
|
|
1488
|
-
const
|
|
1489
|
-
if (
|
|
1488
|
+
const accepted = skillAccepted(judged);
|
|
1489
|
+
const planned = judged.filter(({ state }) => state === 'absent' || state === 'earlier');
|
|
1490
|
+
if (planned.length === 0) return;
|
|
1491
|
+
let decline = null;
|
|
1492
|
+
if (!accepted) {
|
|
1493
|
+
if (deps.keySet !== true && !keySet(env)) return;
|
|
1494
|
+
decline = factFingerprint(`${JEV_SKILL_DECLINED}${pins[0].tag}`);
|
|
1495
|
+
if (readAckValue(root, deps, ACKS_JEV_SKILL_KEY) === decline) return;
|
|
1496
|
+
}
|
|
1490
1497
|
const line = skillLine(HERE, host.platform, dir);
|
|
1491
1498
|
if (line === '') {
|
|
1492
1499
|
skip('jev-skill', new Error(NO_APPLY_LINE));
|
|
1493
1500
|
return;
|
|
1494
1501
|
}
|
|
1502
|
+
const foreign = judged.filter(({ state }) => state === 'foreign');
|
|
1503
|
+
if (accepted) {
|
|
1504
|
+
const recipe = [`writes: ${planned.map(({ path }) => printable(path)).join(', ')}`,
|
|
1505
|
+
...foreign.map(({ path, reason }) => `left untouched: ${printable(path)} — ${printable(reason)}`), ...(note ? [note] : [])];
|
|
1506
|
+
add('jev-skill', fillTemplate(WHATS['jev-skill.not-current'], { n: planned.length }), line, 'jev-skill.not-current', recipe.join('; '));
|
|
1507
|
+
return;
|
|
1508
|
+
}
|
|
1495
1509
|
const place = placeOf({ env, platform: host.platform, hostname: host.hostname, container: host.container });
|
|
1496
|
-
const
|
|
1497
|
-
const what = behind.length ? fillTemplate(WHATS['jev-skill.earlier'], { old: pins[Math.max(...behind)].tag, new: pins[0].tag })
|
|
1498
|
-
: WHATS['jev-skill'];
|
|
1499
|
-
const untouched = judged.filter(({ state }) => state === 'foreign')
|
|
1500
|
-
.map(({ path, reason }) => `left untouched: ${printable(path)} — ${printable(reason)}; `).join('');
|
|
1510
|
+
const untouched = foreign.map(({ path, reason }) => `left untouched: ${printable(path)} — ${printable(reason)}; `).join('');
|
|
1501
1511
|
const record = `node ${q(toolPath('ack-write.mjs'))} --lane jev-skill --fingerprint ${decline} --cwd ${q(root)}`;
|
|
1502
|
-
add('jev-skill',
|
|
1512
|
+
add('jev-skill', WHATS['jev-skill'], line, 'jev-skill',
|
|
1503
1513
|
`${place ? `run the apply in ${place}; ` : ''}${untouched}${note ? `${note}; ` : ''}${DECLINE_ALTERNATIVE}${record}`);
|
|
1504
1514
|
} catch (err) {
|
|
1505
1515
|
skip('jev-skill', err);
|
package/tools/write-lanes.mjs
CHANGED
|
@@ -58,7 +58,7 @@ export const VARIANT_LANES = Object.freeze({
|
|
|
58
58
|
'profile-gap': LANE_CHAT,
|
|
59
59
|
'jev-connect': LANE_USER,
|
|
60
60
|
'jev-skill': LANE_HARNESS,
|
|
61
|
-
'jev-skill.
|
|
61
|
+
'jev-skill.not-current': LANE_KIT,
|
|
62
62
|
'spec-adoption.adopting': LANE_CHAT,
|
|
63
63
|
});
|
|
64
64
|
|
|
@@ -168,7 +168,7 @@ const FORMS = Object.freeze({
|
|
|
168
168
|
(facts, argv) => 'your own step (a sudo install; the doctor prints the --apply line to run next) — '
|
|
169
169
|
+ `${TERMINAL_STEP}cd ${quoteArg(facts.root)} && ${formatCommand(argv.preview)}`),
|
|
170
170
|
'jev-skill': SKILL_FORM,
|
|
171
|
-
'jev-skill.
|
|
171
|
+
'jev-skill.not-current': SKILL_FORM,
|
|
172
172
|
'jev-connect': createForm('jev-connect.mjs', null, [], getStartupPaths, true,
|
|
173
173
|
(facts, argv) => `${OWN_STEP}it asks for the key in your terminal and the key never goes into the chat — `
|
|
174
174
|
+ `${TERMINAL_STEP}${formatCommand(argv.apply)}`),
|