@sleepy_panda_srl/portulan 0.1.3 → 0.3.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/README.md +7 -6
- package/cli/README.md +145 -358
- package/cli/advisory.mjs +354 -0
- package/cli/comments.mjs +932 -0
- package/cli/compile.mjs +1719 -1699
- package/cli/context.mjs +883 -0
- package/cli/control-chars.mjs +12 -301
- package/cli/discover.mjs +17 -574
- package/cli/doctor.mjs +269 -1080
- package/cli/drills.mjs +92 -504
- package/cli/feedback.mjs +16 -237
- package/cli/finish.mjs +437 -0
- package/cli/form.mjs +644 -0
- package/cli/fuzz-shell.mjs +20 -305
- package/cli/gate.mjs +7 -199
- package/cli/goldens.mjs +26 -184
- package/cli/index.mjs +305 -655
- package/cli/init.mjs +243 -566
- package/cli/inside.mjs +3 -28
- package/cli/instructions.mjs +829 -0
- package/cli/ledger.mjs +882 -0
- package/cli/librarian.mjs +135 -599
- package/cli/manifest.mjs +2 -39
- package/cli/mutants.mjs +9 -170
- package/cli/new.mjs +12 -243
- package/cli/pack-identity.mjs +5 -74
- package/cli/pack-version.mjs +13 -255
- package/cli/plugin-lint.mjs +42 -658
- package/cli/portulan.mjs +6 -125
- package/cli/recipe-set.mjs +15 -245
- package/cli/release-eval.mjs +28 -348
- package/cli/review-meter.mjs +29 -265
- package/cli/rule-carriers.mjs +12 -175
- package/cli/sessions.mjs +82 -0
- package/cli/skill-goldens.mjs +10 -176
- package/cli/skills-set.mjs +12 -414
- package/cli/stop-gate.mjs +83 -514
- package/cli/symbols.mjs +1132 -0
- package/cli/telemetry.mjs +82 -505
- package/cli/upgrade.mjs +171 -314
- package/cli/vendor.mjs +146 -476
- package/cli/version-carriers.mjs +8 -86
- package/core/README.md +1 -1
- package/core/engine.md +3 -9
- package/core/operating/autonomy.md +1 -1
- package/core/operating/context.md +258 -0
- package/core/operating/evolution.md +3 -3
- package/core/operating/loop.md +13 -20
- package/core/operating/memory.md +12 -3
- package/core/operating/sessions.md +100 -0
- package/core/personas/README.md +33 -0
- package/core/personas/librarian.md +2 -2
- package/core/skills/clarify/SKILL.md +1 -1
- package/core/skills/consolidate/SKILL.md +5 -3
- package/core/templates/handoff.md +28 -15
- package/core/templates/memory-entry.md +1 -0
- package/evals/README.md +271 -845
- package/evals/releases/0.2.0.json +146 -0
- package/evals/releases/0.2.0.md +67 -0
- package/evals/releases/0.3.0.json +150 -0
- package/evals/releases/0.3.0.md +68 -0
- package/evals/releases/README.md +3 -3
- package/package.json +5 -2
- package/packs/.claude-plugin/plugin.json +2 -1
- package/packs/README.md +7 -4
- package/packs/rituals/checkpoints/README.md +1 -1
- package/packs/tools/README.md +8 -8
- package/packs/tools/github/verify/actions-pinned.sh +10 -55
- package/packs/tools/local-llm/README.md +136 -0
- package/packs/tools/local-llm/pack.json +32 -0
- package/packs/tools/local-llm/personas/local-worker.md +44 -0
- package/packs/tools/local-llm/runner/local-llm.mjs +1665 -0
- package/packs/tools/local-llm/skills/delegate-local/SKILL.md +64 -0
- package/packs/tools/local-llm/verify/README.md +18 -0
- package/spec/README.md +113 -6
- package/spec/migrations/0001-repository-declares-its-tree.mjs +1 -26
- package/spec/migrations/0002-bundle-fallback-path.mjs +13 -74
- package/spec/migrations/0003-handoff-index-not-kept.mjs +66 -0
- package/spec/migrations/0004-changelog-fragments.mjs +53 -0
- package/spec/migrations/0005-session-log-retired.mjs +69 -0
- package/spec/migrations/0006-boot-card.mjs +77 -0
- package/spec/migrations/0007-guidance-compiled.mjs +31 -0
- package/spec/migrations/0008-card-reading.mjs +55 -0
- package/spec/migrations/0009-instruction-sections-on-read.mjs +60 -0
- package/spec/migrations/0010-comment-rail.mjs +57 -0
- package/spec/migrations/README.md +45 -10
- package/spec/pack.schema.json +1 -1
- package/spec/slots.md +343 -27
- package/spec/workspace.schema.json +145 -4
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# `tools/local-llm` — Hybrid local-model execution under Portulan's rails
|
|
2
|
+
|
|
3
|
+
A tool pack for **Hybrid AI Orchestration**, argued in Proposal [`0039`](../../../.portulan/proposals/0039-a-local-model-runs-without-the-host-floor-and-under-a-thinking-cap.md). It lets a frontier orchestrator session offload bounded code transformations, verify-gated red→green retries and a screen of a curated slot for duplicate files to a local OpenAI-compatible runtime (such as **LM Studio** on `http://127.0.0.1:1234/v1` or **Ollama** on `http://127.0.0.1:11434/v1`) at **zero API token cost** and with a **zero-floor prompt prefix**.
|
|
4
|
+
|
|
5
|
+
Composed through a workspace's `packs` array as `tools/local-llm`.
|
|
6
|
+
|
|
7
|
+
| Contributes | What |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Skill | [`delegate-local`](skills/delegate-local/SKILL.md) — the pass a frontier session follows to hand a bounded edit or digest to the runner; its description names the precondition, a workspace composing this pack and a server answering on loopback |
|
|
10
|
+
| Persona | [`local-worker`](personas/local-worker.md) — a context-firewall worker operating with an omitted host floor (`omitClaudeMd`) and a hard input-byte ceiling |
|
|
11
|
+
| Verify | [`runner-rails`](verify/README.md) — offline verification of the runner's loopback-only guard, input-budget rail, rollback contract, and `dedup`'s refusals (zero network calls) |
|
|
12
|
+
| Gate | `local-llm-off-loopback` (`propose`) — marks leaving loopback (`127.0.0.1` / `localhost` / `[::1]`) as a decision requiring explicit approval |
|
|
13
|
+
|
|
14
|
+
The skill registers where a plugin manifest declares `skills/`, and this repository's manifests may
|
|
15
|
+
declare only the skills of packs its own workspace composes, as its `.portulan/workspace.json` composes
|
|
16
|
+
this one.
|
|
17
|
+
|
|
18
|
+
## Why this pack exists
|
|
19
|
+
|
|
20
|
+
Proposal [`0036`](../../../.portulan/proposals/0036-what-a-host-loads-into-every-context-is-budgeted.md) budgets what a host loads into every fresh context, and Proposal [`0038`](../../../.portulan/proposals/0038-what-a-change-spends-is-measured.md) prices what a change spends across turns (`m_r × (F·T + g·T²/2)`). Together they expose two structural facts about hybrid local+cloud development:
|
|
21
|
+
|
|
22
|
+
1. **Parent-context turns are quadratic; surgical local calls are flat and free.** Every tool call in a frontier session re-reads the entire session history. Offloading a 10-file comment cleanup, a test-fixture draft, or a file summary to a local 27B–31B model (`qwen/qwen3.8-27b`, `google/gemma-4-31b`) keeps intermediate turns and raw file reads out of the frontier context window completely.
|
|
23
|
+
2. **Local models choke on the host floor (`F`), not on the task.** A cloud subagent inherits a 44k–85k token prefix (`F`) subsidized by provider prompt caching. On local hardware, pre-filling 85k tokens into a 30B model's KV cache takes tens of seconds before the first token appears, whereas a **surgical prompt of a few hundred tokens** (built using [`cli/symbols.mjs`](../../../cli/symbols.mjs) spans) pre-filled in 0.85–1.9 seconds in proposal 0039's measurement.
|
|
24
|
+
|
|
25
|
+
## What the runner enforces in code
|
|
26
|
+
|
|
27
|
+
[`runner/local-llm.mjs`](runner/local-llm.mjs) has **zero npm dependencies** (Node.js `>=20` built-in `fetch` and `node:child_process`) and enforces five rails:
|
|
28
|
+
|
|
29
|
+
1. **Loopback-only by default.** Only `127.0.0.1`, `localhost`, and `[::1]` are permitted unless `--allow-remote` is explicitly passed, and a redirect is refused rather than followed off the machine. A proxy listening on loopback that forwards elsewhere is not visible to it, which is what the `local-llm-off-loopback` gate fragment records.
|
|
30
|
+
2. **Zero-floor input budget (`--max-input-bytes`, default `32768`).** Refuses oversized prompts, and for `dedup` any file over the ceiling, before hitting the local server, directing the caller to scope with [`cli/symbols.mjs`](../../../cli/symbols.mjs) and `--lines` first. A value that is not a whole number is refused rather than read as no limit.
|
|
31
|
+
3. **Explicit thinking cap (`--effort low`).** Passes `reasoning_effort: "low"` and `enable_thinking: false` by default so models whose chat templates default to `'xhigh'` thinking do not exhaust `max_tokens` inside `<think>` blocks.
|
|
32
|
+
4. **Verify-gated transforms (`transform --file <path> --verify <cmd>`, `--verify` required).** Applies the local model's edit, runs the verify command, retries with the end of its output on exit `1`, and **restores the original file byte-for-byte** unless the command reaches exit `0`. Any exit other than `0` or `1` — `2`, a missing command, a signal — is no verdict: the file is restored at once and the runner exits `2`. SIGINT, SIGTERM and SIGHUP, whether they arrive during the model call or while the verify command runs, stop the verify, restore the file and exit `2`. **The limits:** this is a rollback, not an atomic write — any other signal that ends the runner (SIGKILL and SIGQUIT among them) or a power loss between the edit and its verdict leaves the edit in place, and since the verify runs in a process group of its own, such a signal leaves the verify running too, even one sent to the runner's whole group. Signal handling is POSIX's: on Windows no SIGTERM arrives, and stopping the verify stops only its shell.
|
|
33
|
+
5. **Role screening (`eval`).** Grades an installed local model against Portulan's own [`cli/comments.mjs`](../../../cli/comments.mjs), [`cli/doctor.mjs`](../../../cli/doctor.mjs), and [`cli/skill-goldens.mjs`](../../../cli/skill-goldens.mjs) predicates across `code`, `codify`, and `handoff` tasks. It takes **one sample per task and has no baseline arm**, so it is a screen, not the A/B run `0038` requires before a role is routed: a model that fails it is not routed, and passing it earns nothing. It needs `cli/` beside `packs/`, as the repository and the npm package carry it, exiting `2` where only `packs/` was installed. The A/B run is [*The A/B record*](#the-ab-record) below.
|
|
34
|
+
|
|
35
|
+
A receipt prints a figure the server did not report as `?`, never as `0`, and `time=` is the model's request time, summed over a transform's attempts like `in=` and `out=`: the runner does not stream, so it cannot see a first token.
|
|
36
|
+
|
|
37
|
+
## Screening a slot for duplicates
|
|
38
|
+
|
|
39
|
+
`dedup --dir <slot-dir> [--threshold 0.80] [--model <id>] [--max-input-bytes <per file>]` embeds every file directly in the directory whose name ends in `.md`, in any letter case, sorted by name, in one `POST /v1/embeddings` request to the loopback endpoint, with `text-embedding-nomic-embed-text-v1.5` (`PORTULAN_LOCAL_EMBED_MODEL`) unless `--model` names another; `--role` picks a chat model and is refused here. It prints each pair whose cosine similarity is at or above the threshold, highest first and ties in file-name order, one line each, `0.829 0036-….md 0038-….md`, and two lines on stderr: `dedup files=8 pairs=1 threshold=0.8`, followed by the shared receipt `OK mode=dedup model=… attempts=1 in=…t out=? time=…ms rate=? spend=$0.00`. The ledger reads the receipt as embedding work at $0.00; output tokens and rate are unreported, never zero.
|
|
40
|
+
|
|
41
|
+
- **A slot's `README.md` is left out**, in any letter case: it describes the slot rather than being one of its entries, and would rank against every entry it summarizes. Subdirectories, symbolic links and other files are left out too.
|
|
42
|
+
- **The ceiling is per file**, since the model embeds each input on its own, and it measures the file's text: its size on disk before it is read, and its UTF-8 bytes after. A file over it refuses the run with exit `1`, naming every such file with its size, and nothing is truncated. The request as a whole is not capped: a slot of `n` files sends at most `n` times the ceiling of file text, which JSON escaping can enlarge in the request body, to about six times for control characters. Raise `--max-input-bytes` only as far as the embedding model's context holds.
|
|
43
|
+
- **The threshold is a plain decimal from `-1` to `1`**, the range of a cosine; `-1` lists every pair. Anything else is exit `2`, as every malformed argument to the runner is, and never read as the default.
|
|
44
|
+
- **Exit `0` is a run, with pairs or with none**, since a candidate pair is for a human to judge, not a red. Exit `1` is a refusal before any request: an endpoint off loopback, or a file over the ceiling. Exit `2` is no server, a redirect, an HTTP error, a response that is not one finite vector of one length per file, or a directory with fewer than two entries to compare. A zero vector scores `0` against everything rather than `NaN`.
|
|
45
|
+
|
|
46
|
+
A score is a candidate, not a verdict: the runner neither merges nor edits a file.
|
|
47
|
+
|
|
48
|
+
## Delegating to it
|
|
49
|
+
|
|
50
|
+
The pass is the [`delegate-local`](skills/delegate-local/SKILL.md) skill: check the server with
|
|
51
|
+
`status`, scope the input with [`cli/symbols.mjs`](../../../cli/symbols.mjs) and `--lines`, choose the
|
|
52
|
+
supported role by task shape, gate every edit with `--verify`, and read only the receipt back.
|
|
53
|
+
The acquired [record](../../../evals/ab/local-worker.md) supports `code` at low effort; shared `prose`
|
|
54
|
+
is disabled because codify failed all five local turns. `summarize` defaults to that disabled role and
|
|
55
|
+
refuses. An explicit `--model` without `--role` is an operator-selected candidate, not automatic routing.
|
|
56
|
+
|
|
57
|
+
## The A/B record
|
|
58
|
+
|
|
59
|
+
The acquired [capture](../../../evals/ab/local-worker.json) and its generated
|
|
60
|
+
[register](../../../evals/ab/local-worker.md) record five turns per task and arm on 2026-11-03:
|
|
61
|
+
code L5/H5, codify L0/H3, handoff L5/H5. The [acquisition note](../../../evals/ab/local-worker-acquisition.md)
|
|
62
|
+
keeps the failed authentication acquisition and the authorized host-only replacement auditable.
|
|
63
|
+
|
|
64
|
+
The rule fixed before outcomes requires all five local turns to pass and all five host turns to
|
|
65
|
+
complete, with local passes at least host passes. A positive 5/5 tie qualifies; a 0/5 tie does not.
|
|
66
|
+
Both tasks must qualify for the shared prose role. Thus **code is enabled and prose is disabled**.
|
|
67
|
+
Operational defaults and explicit `--role` calls require the measured model at low effort; a model
|
|
68
|
+
override or environment variable cannot silently substitute another. Explicit `--model` without
|
|
69
|
+
`--role`, `eval` and `eval --ab` remain candidate paths and never enable routing by themselves.
|
|
70
|
+
|
|
71
|
+
`EARNED_ROUTING` embeds the capture's SHA-256, measured model IDs and support bits, so packs-only
|
|
72
|
+
installs need no root `evals/` directory at runtime. The repository's
|
|
73
|
+
[`cli/local-routing.mjs`](../../../cli/local-routing.mjs) regrades the record, reproduces its register,
|
|
74
|
+
and independently derives those bits and models before comparing them with the shipped table.
|
|
75
|
+
It is repository workshop tooling, excluded from npm like the earlier A/B instruments.
|
|
76
|
+
|
|
77
|
+
- **`eval --ab --k 5 --seed <s> --host-cmd "<command>" --host-model <id> --write` captures it.** Arm L
|
|
78
|
+
is each task's model as routed (`code` to `--role code`; `codify` and `handoff` to `--role prose`)
|
|
79
|
+
at `--effort low`, on loopback, with a sampling seed per turn derived from `--seed`. Arm H is the host
|
|
80
|
+
agent, given the same prompt as one text, as the last argument of the command `--host-cmd` names, in
|
|
81
|
+
an empty directory it removes afterwards. Both arms are graded by `eval`'s predicates, `k = 5` per
|
|
82
|
+
(task, arm) cell, the k ruled for `evals/ab/baseline.md`. The record names both models, the host's
|
|
83
|
+
version, the commit, the machine and the seed, and the sha256 fingerprints of the loaded runner source, the predicates and the
|
|
84
|
+
prompts it was graded under, as the capture recorded them, since nothing can later verify the first; the register carries `baseline.md`'s limit: `k = 5` per cell supports a
|
|
85
|
+
recorded rate and nothing else. The machine is the CPU model, the memory, the platform and
|
|
86
|
+
architecture, and the Node version, and never the hostname.
|
|
87
|
+
- **Arm H consumes host-account usage and its prompts leave the machine**, fifteen host calls, so it crosses the loopback
|
|
88
|
+
rail the rest of the runner holds and that `local-llm-off-loopback` records. Usage may be charged
|
|
89
|
+
through an API account or covered by a subscription; this acquisition used Claude Max sign-in with
|
|
90
|
+
Sonnet 5.5 and a configured total ceiling of $2.25, not an independently measured invoice amount. It runs only where
|
|
91
|
+
`--host-cmd` names the host command; without it `--ab` refuses with exit `1`, the answer the runner
|
|
92
|
+
gives any refused endpoint, before anything is contacted. **It runs under the operator's full
|
|
93
|
+
environment and credentials**, which is how it reaches the host's account and also how anything the
|
|
94
|
+
operator's configuration loads reaches arm H. A command carrying `--dangerously-skip-permissions` or
|
|
95
|
+
`--permission-mode bypassPermissions` is refused with exit `2`, by the check `cli/ab-run.mjs` uses.
|
|
96
|
+
Arm L runs first, at `$0.00`, so a local failure stops the capture before any host call.
|
|
97
|
+
`--host-model` is recorded as declared: the runner does not observe the host's model.
|
|
98
|
+
- **The command is split on whitespace, with no shell**, so no argument of it can hold a space, and a
|
|
99
|
+
quoted one arrives in pieces. Its version is read by running the whole command with `--version`
|
|
100
|
+
appended, so a wrapper such as `env` reports the host it runs rather than itself; a host that read
|
|
101
|
+
`--version` as prompt text would answer it as a turn, and the record would show that answer as its
|
|
102
|
+
version.
|
|
103
|
+
- **Every turn is journalled before the next starts**, under the repository's git directory
|
|
104
|
+
(`git rev-parse --git-path portulan/local-worker-journal`), where no commit and no `git status` sees
|
|
105
|
+
it. SIGINT, SIGTERM or SIGHUP stops the running host turn, removes its directory, keeps the journal
|
|
106
|
+
and exits `2`; the same command run again resumes, re-running only turns the journal lacks, and
|
|
107
|
+
refuses with exit `2` a journal taken under other conditions (commit, tree, machine, seed, models,
|
|
108
|
+
endpoint, host command, version and model, or any fingerprint), since its arm-H turns were paid
|
|
109
|
+
for and removing it is the operator's act. A host that writes more than 16 MiB stops the capture with
|
|
110
|
+
exit `2` and the turn is re-run on resume. **The limit:** SIGKILL, or a power loss, leaves the running
|
|
111
|
+
host turn's directory behind and, since the host runs in a process group of its own, the host still
|
|
112
|
+
running and billing a turn the journal will not hold; the journal still resumes, and that turn runs again. The journal is removed once the
|
|
113
|
+
record is written, and a capture is refused where `evals/ab/local-worker.json` exists: a record is
|
|
114
|
+
captured once, and removing it is the operator's deliberate act. The final record is created
|
|
115
|
+
exclusively too: if another record appears during capture, it and its register are preserved,
|
|
116
|
+
exit `2` leaves the current journal for recovery. This prevents overwrites; it is not a lock on
|
|
117
|
+
concurrent journal writers or a crash-atomic publication. Different loaded runner bytes refuse
|
|
118
|
+
journal resume even at the same commit and with both trees dirty.
|
|
119
|
+
- **`eval --verify` checks it without running a model**: the record's shape, its matrix total over `k`,
|
|
120
|
+
every arm-L seed against `--seed`, every turn's model against the routing, **every completed turn
|
|
121
|
+
regraded** by the predicates as they ship, the prompts' fingerprint, the cells re-folded from the
|
|
122
|
+
turns, and the register byte-compared with a fresh render. A verdict that regrades differently is
|
|
123
|
+
exit `1`, and the finding says whether the predicates moved since capture or the record no longer
|
|
124
|
+
matches its own output: either way the figures would not hold under the screen that ships. A
|
|
125
|
+
predicate file that changed while every verdict regrades the same is no finding. A missing record is
|
|
126
|
+
exit `2`, and so is a payload with no `cli/` beside `packs/`, since nothing there can regrade. A
|
|
127
|
+
record carrying the synthetic fixture's `fixture` field is exit `1` from `--verify` and `--write`
|
|
128
|
+
alike: a synthetic fixture is not a capture.
|
|
129
|
+
`eval --write` re-renders the register from the record, refusing one `--verify` would red.
|
|
130
|
+
|
|
131
|
+
The `ab-run` recipe runs the earlier baseline verifier, exact no-model `eval --verify`, and the
|
|
132
|
+
shipped-routing verifier on every pull request. A red or could-not-run result survives later greens;
|
|
133
|
+
exit `2` takes precedence over exit `1`. No model is rerun in CI. `k = 5` supports these recorded rates,
|
|
134
|
+
not general reliability, arbitrary task quality or independently observed host model identity.
|
|
135
|
+
|
|
136
|
+
Not for multi-file architectural planning, ambiguous requirements (`clarify`), or pre-merge verdicts (`reviewer`).
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"portulan": {
|
|
3
|
+
"pack": "1.0",
|
|
4
|
+
"version": "0.2.0"
|
|
5
|
+
},
|
|
6
|
+
"name": "local-llm",
|
|
7
|
+
"category": "tools",
|
|
8
|
+
"summary": "Zero-dependency local LLM runner (LM Studio / Ollama) with a verify-gated red-to-green file transform loop, a zero-floor input budget rail, role evals, an embedding screen for duplicate files in a curated slot, and loopback-only enforcement.",
|
|
9
|
+
"doc": "README.md",
|
|
10
|
+
"contributes": {
|
|
11
|
+
"skills": ["skills/"],
|
|
12
|
+
"personas": ["personas/local-worker.md"],
|
|
13
|
+
"verify": [
|
|
14
|
+
{
|
|
15
|
+
"id": "runner-rails",
|
|
16
|
+
"run": "node ${PACK_ROOT}/runner/local-llm.mjs --verify-offline",
|
|
17
|
+
"requires": ["node"],
|
|
18
|
+
"doc": "verify/README.md"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"gates": [
|
|
22
|
+
{
|
|
23
|
+
"id": "local-llm-off-loopback",
|
|
24
|
+
"tier": "propose",
|
|
25
|
+
"action": {
|
|
26
|
+
"none": "No honest shell matcher. Whether a local-model invocation stays on the machine depends on the resolved endpoint (`--base-url`, `PORTULAN_LOCAL_LLM_URL`, or a proxy config), not on the binary name. `runner/local-llm.mjs` refuses non-loopback hosts in code unless `--allow-remote` is passed; this fragment records the policy boundary that a host permission rule cannot see."
|
|
27
|
+
},
|
|
28
|
+
"reason": "Routing a task to a local model is a spend and confidentiality boundary only while the endpoint resolves to loopback (`127.0.0.1`, `localhost`, `[::1]`). Pointing a local worker at a remote endpoint sends workspace context off-machine under a local tool's name; propose the remote endpoint explicitly before running."
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: local-worker
|
|
3
|
+
description: Executes bounded file transformations, test-fixture drafts, handoff compressions, and research digests on a local OpenAI-compatible model (LM Studio / Ollama) with an omitted host floor and a verify-gated rollback loop. Delegate surgical, single-file or read-parallel summarization work to it; never ask it to own multi-file architecture or merge decisions.
|
|
4
|
+
tools: [read, search, edit-code, run-verify]
|
|
5
|
+
effort: low
|
|
6
|
+
omitClaudeMd: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Persona — Local Worker
|
|
10
|
+
|
|
11
|
+
> A context-firewall worker whose whole value is **what it does not load and what it does not spend**.
|
|
12
|
+
> A frontier session re-reads its entire prefix (`F + g·T`) on every tool call; a cloud subagent inherits
|
|
13
|
+
> the host floor (`F ≈ 44k–85k` tokens). The local worker runs against a loopback model (`127.0.0.1`) with
|
|
14
|
+
> the host instruction floor omitted (`omitClaudeMd: true`), a hard input-byte ceiling, and a verify
|
|
15
|
+
> recipe that gates its output before anything returns to the parent loop.
|
|
16
|
+
|
|
17
|
+
## Charter
|
|
18
|
+
|
|
19
|
+
- **For:** executing one bounded, verify-gated code transformation (`transform --file <path> --verify <cmd>`),
|
|
20
|
+
drafting unit tests or fixtures against an explicit signature, compressing a session log into a
|
|
21
|
+
bounded handoff, or distilling a file span into a compact digest for the parent session.
|
|
22
|
+
- **Not for:** cross-cutting architectural design, multi-branch coordination, or final pre-merge verdicts
|
|
23
|
+
(`reviewer` / `supervisor`). It does not accept rules (`librarian`) and it does not take outward actions.
|
|
24
|
+
|
|
25
|
+
## Autonomy reach
|
|
26
|
+
|
|
27
|
+
Acts in **Auto** to read scoped inputs, run local loopback inference, apply edits in place, kept only on a
|
|
28
|
+
green verify and rolled back otherwise, and run the workspace's verify recipe. Its output into any curated
|
|
29
|
+
slot (memory, proposals, handoffs) is a draft into a **Propose** or **Gated** decision owned by the
|
|
30
|
+
parent session or human. **Prohibited is not a reach** and does not appear here as a permission: it is
|
|
31
|
+
the tier no role may act in.
|
|
32
|
+
|
|
33
|
+
## Read / write posture
|
|
34
|
+
|
|
35
|
+
Reads only the scoped files or symbol spans passed to it — never the full repository tree or the
|
|
36
|
+
always-loaded host floor. Writes are isolated to a single target file under a rollback guard: unless the
|
|
37
|
+
verify command exits `0` within the retry cap, the original bytes are restored before the worker exits,
|
|
38
|
+
short of the signals and power loss the pack's README names.
|
|
39
|
+
|
|
40
|
+
## Memory scope
|
|
41
|
+
|
|
42
|
+
Its own `local-worker` scope in the adopting workspace's memory layer: which task shapes, prompt budgets,
|
|
43
|
+
and local model identifiers pass the workspace's verify recipes on the first try versus which require
|
|
44
|
+
frontier escalation. Kept separate from `implementer` and `reviewer` memory.
|