skills: trim two descriptions to a routing sentence, and assert their pointers
Lint / hadolint (push) Successful in 10s
Lint / skill-floor (push) Successful in 14s
Lint / doc-drift (push) Successful in 18s
Lint / actionlint (push) Successful in 32s
Lint / skill-frontmatter (push) Successful in 15s

Every skill's name and description sit in the system prompt of EVERY request --
that block is the routing index -- while bodies are fetched on demand through
the read tool. Measured on this device: 24 discoverable skills cost 10,609
description chars (~2,652 tokens) per request, against 474,656 chars of bodies
(~119k tokens) that cost nothing until used. Bodies are 45x the descriptions,
which is what the spec's 1024-char description limit is protecting.

credential-incident-response (1022, two characters under the limit) and
pi-devbox-environment (923) were each carrying a table of contents of what
their body covers. Trimmed to what a description is actually for -- answering
"should I load this?" -- reclaiming 1,087 chars (~271 tokens) of permanent
context. 4,154 -> 3,067 across the five baked skills.

WHY ONLY THESE TWO. Both are named BY PATH from the always-loaded managed
block, so neither depends on description-matching to be found. pi-extensions is
left alone deliberately: check-skill-floor.sh compares the vendored copy to the
package repo by DIRECTORY HASH, so trimming ours alone registers as drift and
turns that gate red; and it is the one skill that also ships in the skillset
repo, where it runs on hosts with no pi-devbox managed block and genuinely needs
its description. pi-devbox-firstboot stays fuller than needed because it is the
skill a device with nothing else has to find.

NOTHING WAS DELETED, ONLY RELOCATED -- and that was checked rather than assumed:
all 18 enumerated items were confirmed present in the bodies BEFORE cutting
(frontmatter stripped, so the description's own line could not score its own
claim), and `git diff --stat` confirms both bodies are byte-identical.

THE TRIM CREATES A DEPENDENCY, SO IT IS NOW ASSERTED. smoke-test.sh checks both
pointers by path, next to the firstboot one. The premise of the cut is "the
block names them", which holds only while those lines exist -- reword the block,
drop a pointer, and the skill silently stops being reachable for a device that
did not already know it was there. Verified discriminating: a reworded block
fails the grep.

An instrument failure caught on the way, and the reason the coverage check was
re-run: my first pass used `grep -E 'a\|b'`, where \| is a LITERAL pipe in ERE,
so 8 of 18 items read as 0 hits. Every zero was a pattern containing \| and
every non-zero lacked one -- that correlation, not the content, was the finding.
With real alternation all 18 are present.

Loader re-verified on both trimmed skills: rc=0, no skill diagnostics.
This commit is contained in:
pi@mbp-m1-2020
2026-10-24 11:26:26 +02:00
parent 206fd1ec35
commit 057827a84b
4 changed files with 39 additions and 15 deletions
+26
View File
@@ -73,6 +73,32 @@ Pre-v1.0.0 tags followed the pi npm version (`v{pi_version}[letter]`).
the vendored copies are deliberately in scope: the image ships those bytes,
so the violation is ours to carry whoever typed it.
- **Two baked skills' `description` fields trimmed to a routing sentence,
reclaiming ~1,087 characters of permanently-loaded context.** Every skill's
name and description sit in the system prompt of *every* request — that block
is the routing index — while bodies are fetched on demand through the read
tool. Measured here: 24 discoverable skills cost 10,609 description chars
(~2,652 tokens) on every request, against 474,656 chars of bodies (~119k
tokens) that cost nothing until used. `credential-incident-response` (1022,
i.e. two characters under the spec limit) and `pi-devbox-environment` (923)
were each carrying a table of contents of what their body covers.
Both are named **by path** from the always-loaded managed block, so neither
depends on description-matching to be found — which is what makes the cut
safe, and is why only these two were cut. `pi-extensions` was left alone for
two reasons: `check-skill-floor.sh` compares the vendored copy to the package
repo by directory hash, so trimming ours alone registers as drift; and it is
the one skill that also ships in the `skillset` repo, where it runs on hosts
with no pi-devbox managed block and so genuinely needs its description to be
found. All 18 enumerated items were verified present in the bodies first —
the cut relocates nothing, and both bodies are byte-identical.
`smoke-test.sh` now asserts both pointers by path, alongside the firstboot
one. The trim's premise is "the block names them", and that premise holds only
while those lines exist: reword the block, drop a pointer, and the skill
silently stops being reachable for a device that did not already know it was
there. Verified discriminating with a reworded negative control.
### Fixed
- **CI: a smoke job's image could be deleted mid-test by another job's disk