Skip to content

feat(cli): add pi-hook-ingest/inject with shared spool - #4

Open
ZeR020 wants to merge 1 commit into
stack/4-pi-observer-authfrom
stack/5-cli-ingest-inject
Open

feat(cli): add pi-hook-ingest/inject with shared spool#4
ZeR020 wants to merge 1 commit into
stack/4-pi-observer-authfrom
stack/5-cli-ingest-inject

Conversation

@ZeR020

@ZeR020 ZeR020 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Fifth stacked PR for pi support (kunickiaj#1430). Depends on layer 4 (stack/4-pi-observer-auth, #3).

Opened on the fork because GitHub cannot use kunickiaj:stack/4-pi-observer-auth as a base.

Why

Maintainer blocker: HTTP-success used to flush extraction before draining the spool, so compaction/shutdown could miss queued events.

What

  • codemem pi-hook-ingest / pi-hook-inject registered in command-tree.ts.
  • Thin spool wrapper over shared hook-ingest-spool.ts (not a third lock/spool copy).
  • Direct ingest: buildRawEventEnvelopeFromPiEvent + ingestRawEvents. No recordRawEvent / stripPrivateObj.
  • HTTP-success + non-empty spool + boundary event: drain first, then flush.
  • Inject fail-open (empty stdout on error).

Setup stays on layer 8. Boundary CLI timeout stays on layer 6.

Test plan

  • vitest run packages/cli/src/commands/pi-hook-ingest.test.ts packages/cli/src/commands/pi-hook-inject.test.ts packages/cli/src/command-tree.test.ts — 41/41

Stacked on: #3 / #2 / #1 / kunickiaj#1473
Related: kunickiaj#1430, kunickiaj#1429

Copilot AI lite review requested due to automatic review settings August 17, 2026 14:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

HTTP-first pi ingest on /api/pi-hooks, direct path via
buildRawEventEnvelopeFromPiEvent + ingestRawEvents. Drain the
shared spool before a boundary flush. Inject stays fail-open.
@ZeR020
ZeR020 force-pushed the stack/4-pi-observer-auth branch from a844294 to 0a79cf4 Compare August 23, 2026 15:33
@ZeR020
ZeR020 force-pushed the stack/5-cli-ingest-inject branch from ed06c83 to 19bd665 Compare August 23, 2026 15:33
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.

2 participants