Skip to content

feat: Tier-1 leftovers — tables, fence-aware chunking, token diagnostics, click claim, catch-all ack, stale-drop metric - #18

Merged
0xCVH merged 2 commits into
mainfrom
feat/tier1-leftovers
Sep 23, 2026
Merged

0xCVH merged 2 commits into
mainfrom
feat/tier1-leftovers

Conversation

@0xCVH

@0xCVH 0xCVH commented Sep 21, 2026

Copy link
Copy Markdown
Owner

The remaining small items from the Hermes-comparison backlog, approved as batch 2–7.

Commits

  1. GFM pipe tables + fence-aware chunking — tables render as fenced, space-aligned monospace instead of pipe noise (after code stashing, emitted through the stash so cell content is untouched); splitIntoChunks is now line-boundary based and fence-aware with _(i/n)_ part indicators, so long replies with code blocks no longer corrupt every chunk after a mid-fence cut. Single-chunk output byte-identical to before.
  2. Token diagnostics, double-click claim, catch-all ack, stale-drop metric — connect-time warnings for user-shaped tokens and missing manifest scopes (with REQUIRED_BOT_SCOPES pinned to the checked-in manifest by a drift test), first-clicker-wins claim on approval buttons, a regex catch-all event ack against Slack's silent Event-Subscriptions disable, and slack.events.stale_dropped observability for redeliveries outside the staleness window.

Testing

  • 21 new tests (RED-first), 3 existing tests updated for the new chunking contract (indicator-stripped rejoin)
  • Full suite: 549/549 across 20 files; both tsconfigs clean

🤖 Generated with Claude Code

0xCVH and others added 2 commits September 21, 2026 09:44
…hunk splitting

Tables: mrkdwn has no table syntax, so agent replies with pipe tables
rendered as literal pipe noise. Each table is now rewritten as a fenced
monospace block with space-aligned columns — after code stashing (a
table inside a fence stays literal) and emitted through the stash so
cell content is never touched by the emphasis passes. Alignment pads by
UTF-16 length; CJK glyphs mis-align slightly, the accepted trade.

Chunking: the fixed slicer cut long replies mid-fence, corrupting the
rendering of every chunk after the cut. splitIntoChunks is now
line-boundary based and fence-aware — a boundary inside an open fence
closes it and reopens in the next chunk — and multi-chunk output
carries trailing _(i/n)_ part indicators. Single-chunk output is
byte-identical to before. Two tests updated for the new contract
(indicator-stripped rejoin instead of exact slicing).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tch-all ack, stale-drop metric

Four small hardening items from the Hermes-comparison backlog:

- BoltGateway.start() now reads what auth.test already returns: a
  missing bot_id means the configured token is likely a user token, and
  the x-oauth-scopes header (folded into response_metadata.scopes by the
  WebClient) is compared against REQUIRED_BOT_SCOPES — a new constant
  pinned to slack-app-manifest.json by a drift test. Both failure shapes
  previously surfaced only as features silently doing nothing; now they
  warn at connect and are exposed via gateway.diagnostics(). Absent
  scope metadata counts as unknown, not missing.
- Approval clicks take an in-process claim per approval id: the first
  clicker wins and a second click during the decision call is dropped
  silently instead of firing a duplicate REST call whose failure posted
  a ":x: Failed … may already be decided." ephemeral for a click that
  did what the person asked. The claim releases in a finally, so a
  genuinely failed decision stays retryable.
- A regex catch-all event listener (registered last) acks any event no
  specific handler matched — un-acked events count toward Slack's
  failure threshold, past which Event Subscriptions get silently
  disabled for the whole app.
- The event deduper reports stale drops through a new onStaleDrop hook,
  wired to slack.events.stale_dropped and an info log: a redelivery
  arriving outside the 5-minute staleness window was previously lost
  invisibly. Observability first; widening the window stays a separate
  decision to make on this data.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@0xCVH
0xCVH merged commit d19bc28 into main Sep 23, 2026
3 of 7 checks passed
@0xCVH
0xCVH deleted the feat/tier1-leftovers branch September 23, 2026 13:10
@0xCVH 0xCVH mentioned this pull request Sep 23, 2026
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