Skip to content

feat(skills): drop browser, web-search, and notify on trading-org and repoint the org call sites - #110

Merged
hishboy merged 7 commits into
trading-orgfrom
chore/drop-dup-skills-trading-org
Aug 19, 2026
Merged

hishboy merged 7 commits into
trading-orgfrom
chore/drop-dup-skills-trading-org

Conversation

@hishboy

@hishboy hishboy commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Brings trading-org in line with main on the shared-skills catalog and finishes the rewrite for the org/desk surface that only exists on this branch.

Why a merge of main rather than a fresh deletion

main already carries the removal (#109) and, critically, the sync mechanism it depends on (#107). This branch's scripts/skills-upgrade.mjs still fetched a codeload tarball of tribes-protocol/ai-harness-setup — retired, frozen at 7 skills, no zipbox-notify — so no sync run on trading-org could ever have produced it. #107 replaced that channel with the content-addressed, digest-verified R2 release at skills.zipbox.ai.

skills/.synced.json moves from ai-harness-setup 696490a (7 skills) to terminal 0ab39f0 / contentSha256 1e741e4 (12 skills). The catalog vendors as one atomic release — upstreamSlugs() takes every zipbox-* directory in the tarball — so zipbox-api-keys, zipbox-desktop, zipbox-geo, and zipbox-image arrive alongside zipbox-notify. That set cannot be narrowed without defeating the manifest.

What this PR rewrites on top

Applying #109's rule unchanged: a skill pointer becomes the zipbox slug; a tribes-cli command mention stays verbatim, because src/cli/WebSearch.ts and src/cli/Notify.ts are still composed into the binary and are the only path outside a sandbox.

  • notify → zipbox-notify across 11 skills and 4 .agents/ role files plus docs/org/ORGANIZATION.md. No caveat clause — zipbox-notify routes trading boxes straight back to tribes-cli notify.
  • eng-provider-dd and intel-social-sentiment: pointers repointed and the runnable examples rewritten to the zipbox-websearch curl form, each carrying the non-sandbox tribes-cli web-search equivalent.
  • .claude/workflows/token-dd.js cited skills/web-search/SKILL.md — a path this change deletes. Repointed.
  • docs/org/ORGANIZATION.md: catalog list, both backing-command tables, and the snapshot gap row.

Snapshot / --out parity — checked, not assumed

tribes-cli web-search has no --out and writes JSON to stdout. zipbox-websearch is a plain curl that also writes JSON to stdout. The redirect into .tribes/org/snapshots/ is unchanged on both transports. ORGANIZATION.md:526 now says that instead of naming a deleted skill, and intel-social-sentiment's free-path step keeps its redirect verbatim in the new curl form.

zipbox-browser carries the same pwcli wrapper doctrine and command surface as the deleted browser, plus generate-locator, network mocking, and CDP attach. Its one behavioural difference — the runtime is baked, "do not install a replacement" — is already covered by the non-sandbox caveat main added to AGENTS.md.

Pre-existing failure fixed

.pi/extensions/tribes/AuthBootstrap.ts was already failing prettier --check on trading-org (verified against the pristine eb15c8a blob, exit 1). CI runs format:check over every file, so the branch could not go green without it. Whitespace only, produced by bun run format.

Verification

format:check 0 · lint 0 · typecheck 0 · vitest 39 files / 669 tests passed · test:skills-release PASS. All 56 tracked symlinks resolve; no manifest enumerates skill names by hand (scripts/install-shared-skills.sh derives the catalog from .synced.json).

🤖 Generated with Claude Code

hishboy and others added 7 commits August 2, 2026 07:37
…st (#107)

* feat(skills): vendor the shared catalog from R2, verifying every digest

The catalog moved into tribes-protocol/terminal, which is private, so the
public codeload tarball this fetched no longer reaches it and no cross-repo
token should exist. terminal now republishes it content-addressed to a
public-read R2 bucket; pull from there.

Public-read means anyone holding the write token can serve arbitrary bytes
under a key this repo fetches, and those bytes become SKILL.md files an agent
reads as instructions. So nothing downloaded is trusted: the run verifies the
.tar.gz sha256 against the release manifest, the archive's uncompressed hash
against the content address it ASKED FOR, and every extracted file against the
manifest — all in a temp dir, before a byte lands in skills/. Checking the
tarball against the manifest alone would pass a swap where both were replaced;
the address the caller typed is the third leg that does not.

--pin <contentSha256> replaces --ref: it anchors the whole chain in an argument
rather than in the mutable latest.json pointer. --source still previews from a
local checkout, and now deliberately does NOT write .synced.json — a preview has
no release to attribute its bytes to.

.synced.json keeps upstreamSha first and 40-hex and keeps its files map one key
per line: SyncedSkills.test.ts pins the shape and install-shared-skills.sh
scrapes the keys with sed.

* fix(skills): vendor the live R2 release, not the retired repo's content

The consumer was authored while skills.zipbox.ai still returned 404, so its
vendored payload came from ai-harness-setup@696490a3 -- the mechanism was
correct but had never once been run against the bucket it reads from.

Running it now pulls terminal@41865eeb (tree ea52bb24) and moves
zipbox-browser off the npm-install-Playwright instructions onto the baked
playwright-cli + /usr/bin/chromium contract. A second run is a no-op, so the
vendored tree and the published release now agree.

Also repoints the injected provenance marker at tribes-protocol/terminal.
It stamps "edit there, not here" into every vendored skill, and it was
naming a repo that is about to be deleted.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FUkbU8mM2JRQa1Ze2GGjRS

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(news): send the API bearer on POST /news

POST /news on the control plane became a userAuth route on 2026-07-22
(terminal 69823b1ab, "fix(api): authenticate paid analysis routes"). This
client has never sent an Authorization header, because the route was open
before that. Every news fetch has 401d since.

Measured on a live prod ata box (sparkling-mantis) today:

  Failed to fetch news: 401 Unauthorized {"error":"Unauthorized: Missing Privy token"}

7 occurrences in one session. The string is byte-identical to
PRIVY_AUTH_ERROR_MISSING_TOKEN, returned by userAuth when neither a Privy
bearer nor a cookie is present.

API_BEARER_TOKEN is already present in the box env (verified populated at
boot) and is already sent this way by the other paid routes — see
WalletService.ts:52. No plumbing change needed; the constant is module-level.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(news): plumb the bearer through params, not a module-level Env import

Importing API_BEARER_TOKEN from @/common/Env inside src/helpers/News.ts pulled
that module and its PRIVY_APP_ID validation into the test import graph
(NewsService.test -> NewsService -> helpers/News -> common/Env), which threw:

  Error: PRIVY_APP_ID is not set.

The test defines its own local API_BASE_URL and never imported Env, so this was
introduced by the previous commit, not pre-existing (main is green at e40d99f).

Thread apiBearerToken through FetchNewsStateParams and NewsServiceParams and
read the constant in src/cli/News.ts, which already imports from Env. Same shape
Macros and WebSearch use. Keeps the helper pure and testable.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two operator-facing additions, both taken from the `terminal` harness so the
two boxes read the same.

`skills/i-have-adhd/` rather than a `zipbox-*` slug, because those two halves
of this directory are governed differently. `scripts/install-shared-skills.sh`
derives the vendored catalog from `skills/.synced.json` and then deletes and
relinks EVERY `zipbox-*` entry — its own header states the other half of that
rule outright: "Trading-only skills stay in the repository and are never
copied, removed, or chmodded by this script." So a repo-local skill is safe
here and only here; a skill added under a `zipbox-` name would be deleted by
the next `bun run skills:upgrade` for not appearing in the manifest.

The status line is `terminal`'s file and `terminal`'s wiring verbatim
(`$CLAUDE_PROJECT_DIR/.claude/statusline.sh`), not a second copy edited to
taste — a status line that differs between harnesses is a status line nobody
can read at a glance.
…r of the zipbox catalog (#109)

* fix(skills): restore CI on main — give i-have-adhd its allowed-tools and a routing row

159d89b installed skills/i-have-adhd/ by hand and left main red (CI run
31895271040). Three inherited failures, none related to the skill removal this
branch carries, but all of them block this PR:

- SkillsContract frontmatter assertion: the doc has no `allowed-tools` key, and
  the contract requires exactly `bash read` on every skill.
- SkillsContract "routes only to skills that exist": every slug except
  `tribes-login` must appear in the AGENTS.md routing map; this one did not.
- `format:check` exited 1 on the same file.

Fixed at the cause: add the frontmatter key, add one routing-table row, and let
prettier rewrap the doc. No test was touched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* docs(plans): plan the removal of the browser, web-search, and notify skills in favor of the zipbox catalog

Investigation-backed plan: capability comparison per candidate, a redundancy
sweep of all 68 skills, the full cross-reference rewrite map, the sync-channel
repoint (archived ai-harness-setup -> terminal harnesses/setup), contract-test
fail-first expectations, and blast radius.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* chore(skills): sync the vendored zipbox catalog to terminal 0ab39f0 — 12 skills

The pin was terminal 41865ee with 7 skills. `bun run skills:upgrade` resolves
the current published release (contentSha256 1e741e4, terminal commit 0ab39f0f)
and vendors 12: the 7 refreshed plus zipbox-api-keys, zipbox-desktop,
zipbox-geo, zipbox-image, and zipbox-notify. zipbox-email's copy now documents
--body-html/--body-html-file, --cc, and --attach — that upstream fix rides along.

The sync is a hard dependency of the skill removal on this branch: SkillsContract
fails on any reference to a skill that is not on disk, so the escalation
references cannot move to zipbox-notify until zipbox-notify exists here. It is
also live in production — scripts/install-shared-skills.sh derives the sandbox
runtime catalog from skills/.synced.json, which was 7 stale skills and 5 missing.

Nothing here repoints the sync channel: #107 already replaced the archived
codeload fetch with the content-addressed, digest-verified R2 channel.

THE LINE CAP IS NOT RAISED. MAX_LINES is still 300. What changed is WHICH lines
are counted.

scripts/skills-upgrade.mjs stamps a provenance marker after each vendored H1 and
`bun run format` pads it with a blank line, so a vendored doc measures 2 lines
longer than the file upstream wrote. Upstream enforces the SAME 300-line cap
(harnesses/setup/test/skills-contract.test.sh:91) on the authored file — so the
two caps measure different artifacts, and any upstream doc that spends its full
budget was unsatisfiable here by construction. zipbox-image is 299 authored, 301
vendored, and went red on arrival. The count now excludes the two injected lines.

Raising the cap to 302 would have made the same doc pass while also letting a
genuinely 302-line doc through; excluding the marker does not. The new
`authored line count` cases pin that difference, and they pin the cross-repo
coupling with it: if upstream changes the marker text, or the vendor step starts
injecting a third line, they go red instead of the cap drifting silently.
Verified by mutation — removing the exclusion fails 3 of them, and replacing it
with MAX_LINES = 302 fails the same 3.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* feat(skills): drop the browser, web-search, and notify skill docs for the zipbox catalog

The product owner asked whether this harness ships browser, websearch, or other
skills the zipbox catalog already covers, and to remove what it does.

Removed, doc only:

- skills/browser — zipbox-browser is a strict superset: same @playwright/cli,
  same pwcli env wrapper, same headless-only and session rules, plus
  generate-locator, network mocking (route/unroute/network-state-set), and
  modal-state error guidance this copy lacked. The only thing it had that
  upstream does not is finance routing ("never scrape news here", "market data
  goes to the analyst skill"), which now lives in AGENTS.md's External-info
  precedence bullet where it governs every browser route, not just this one.
- skills/web-search — same backend on both sides: src/helpers/WebSearch.ts POSTs
  /agent/web/search and /agent/web/extract, which is exactly what
  zipbox-websearch calls. Same output, same limits.
- skills/notify — zipbox-notify itself routes trading boxes back here: "on a
  trading-harness / ATA box, tribes-cli notify is that harness's own CLI — use
  it and stop."

KEPT, deliberately: the `tribes-cli web-search` and `tribes-cli notify` command
groups (src/cli/WebSearch.ts, src/cli/Notify.ts, both still composed in
src/cli/Tribes.ts), the session_shutdown auto-notify Pi extension, and AGENTS.md's
"Notifying the user" section. Only the skill docs go. `news` and `tribes-login`
stay — no zipbox equivalent exists. A sweep of every remaining local skill found
no further overlap: wallet-analyst reads third-party wallets where zipbox-wallet
drives this box's own.

KNOWN PARTIAL REGRESSION, not papered over: zipbox-websearch authenticates with
tribes-agent-token, which is baked into zipbox sandboxes only. Outside a sandbox
(Claude Code, Cursor, a local shell — all supported per AGENTS.md's Installation
section) that wrapper has no credential. `tribes-cli web-search` keeps working
everywhere after `tribes-cli login`, so it is now documented as the non-sandbox
path in the AGENTS.md precedence bullet and in the Related-skills bullets of
news, research-analyst, and commodity-analyst. That documentation IS the
mitigation.

Every reference was repointed in the same commit — a dangling pointer to a
deleted skill misroutes the agent, which is worse than the redundancy removed.
The rule applied throughout: a skill POINTER becomes the zipbox slug, a
`tribes-cli` COMMAND mention stays verbatim. The two surviving bare `web-search`
mentions in research-analyst name subcommands, and the one that read ambiguously
is now spelled `tribes-cli web-search`.

Verified no code path referenced the three slugs: .pi/settings.json, bootstrap.sh,
package.json, knip.jsonc, src/, tests/, scripts/, .agents/ and .pi/ hit only
`new Command('notify')` and `new Command('web-search')`, the two CLI groups that
stay.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* docs(skills): document that the browser route has no non-sandbox fallback

The PR that dropped skills/browser documented only half of the regression it
created. `zipbox-websearch` losing its credential outside a Tribes sandbox was
called out, with `tribes-cli web-search` named as the mitigation. The browser
half was left undocumented, and unlike websearch it has no mitigation: there is
no `tribes-cli browser` command, so outside a sandbox the browser route is
simply gone.

That silence is worse than the missing capability. skills/zipbox-browser tells
the agent that a missing baked command means "the sandbox predates this runtime"
and to report a stale image. In a Claude Code / Cursor / local-shell run — which
AGENTS.md's Installation section explicitly supports — playwright-cli was never
baked in the first place, so an agent following the fallback chains in news,
commodity-analyst, or research-analyst would refuse to proceed AND report a false
stale-image diagnosis.

The caveat lands in the External-info precedence bullet, where the browser route
is stated, and is mirrored one clause deep into the three Related-skills bullets
whose fallback chains reach it. The vendored skills/zipbox-browser/SKILL.md is
untouched — it must stay byte-faithful to upstream or the sync contract breaks.

Also corrects a false claim in the docblock of the `authored line count` cases:
they build their fixtures from the test's own SYNC_MARKER, which shares no source
with H1_MARKER in scripts/skills-upgrade.mjs, so they stay green under marker
drift rather than going red. The real alarm is the per-skill cap check —
zipbox-image is 301 raw / 299 authored, so a marker mismatch makes the exclusion
miss and that skill reads 301 > 300. Comment only; the test logic is unchanged
and was already fail-loud.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
… repoint the org call sites

Merges origin/main (#107 R2 sync channel, #109 skill removal) into trading-org
and finishes the rewrite for the org/desk surface that only exists on this branch.

Why the merge rather than a fresh deletion: the three skills were already removed
on main, and the sync mechanism the removal depends on lives there too. This
branch's scripts/skills-upgrade.mjs still fetched a codeload tarball of
tribes-protocol/ai-harness-setup, which was retired frozen at 7 skills and has no
zipbox-notify — so no sync run on this branch could ever have produced it. #107
replaced that channel with the content-addressed, digest-verified R2 release at
skills.zipbox.ai. Re-implementing either commit here would have duplicated
reviewed work and diverged the two branches.

skills/.synced.json therefore moves from ai-harness-setup 696490a (7 skills) to
terminal 0ab39f0 / contentSha256 1e741e4 (12 skills). The catalog is vendored as
one atomic release — upstreamSlugs() takes every zipbox-* directory in the
tarball — so zipbox-api-keys, zipbox-desktop, zipbox-geo, and zipbox-image arrive
with zipbox-notify. That set cannot be narrowed without defeating the manifest.

Rewritten here, applying #109's rule unchanged — a skill POINTER becomes the
zipbox slug, a `tribes-cli` COMMAND mention stays verbatim, because the
web-search and notify command groups (src/cli/WebSearch.ts, src/cli/Notify.ts)
are still composed into the binary and are the only path outside a sandbox:

- `notify` -> `zipbox-notify` in eng-diagnose, eng-repair-integration,
  eng-triage, eng-verify-change, exec-onchain-swap, exec-order-lifecycle,
  exec-place-order, org-compliance, org-protocol, portfolio-reconcile,
  portfolio-triggers, and .agents/{eng-integration,eng-lead,pm-position-monitor,
  pm-triggers}.md, docs/org/ORGANIZATION.md. No caveat clause: zipbox-notify
  routes trading boxes straight back to `tribes-cli notify`, so nothing is lost.
- eng-provider-dd and intel-social-sentiment: pointers repointed AND the runnable
  examples rewritten to the zipbox-websearch curl form, each carrying the
  non-sandbox `tribes-cli web-search` equivalent.
- .claude/workflows/token-dd.js cited skills/web-search/SKILL.md, a path this
  change deletes — repointed to skills/zipbox-websearch/SKILL.md.
- docs/org/ORGANIZATION.md: catalog list, the two backing-command tables, and the
  snapshot gap row.

Snapshot parity, checked rather than assumed: `tribes-cli web-search` has no
--out and writes JSON to stdout; zipbox-websearch is a plain curl that also
writes JSON to stdout. The stdout redirect into .tribes/org/snapshots/ is
therefore unchanged on both transports, and ORGANIZATION.md now says so instead
of naming a deleted skill. intel-social-sentiment's free-path step keeps its
redirect verbatim in the new curl form.

Left alone deliberately: research-analyst's two bare `web-search` mentions name
CLI subcommands (#109 settled this); src/utils/{Osc,Tty}.ts comments describe the
notify CLI; plans/ are historical records.

Also formats .pi/extensions/tribes/AuthBootstrap.ts. That file was already
failing `prettier --check` on trading-org before this change — verified against
the pristine eb15c8a blob, exit 1 — and CI runs format:check on every file, so
the branch could not go green without it. Whitespace only, by `bun run format`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The wrapped inline code span put `search --query …` at column 0 inside a
numbered step, which renders as a new paragraph and detaches the caveat from
the step it qualifies. Reworded so the line fits; same content.
@hishboy
hishboy merged commit 00f5984 into trading-org Aug 19, 2026
1 check passed
@hishboy
hishboy deleted the chore/drop-dup-skills-trading-org branch August 19, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant