@tryinget/pi-agent-vent 0.1.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/LICENSE +78 -0
- package/README.md +188 -0
- package/biome.jsonc +43 -0
- package/docs/adr/2026-05-22-agent-vent-retention-delete-policy.md +65 -0
- package/docs/engineering.local.md +57 -0
- package/docs/project/2026-05-21-agent-vent-design.md +182 -0
- package/docs/project/2026-05-21-agent-vent-implementation-plan.md +66 -0
- package/docs/project/extension-sop.md +52 -0
- package/docs/project/product-posture.md +191 -0
- package/docs/project/trusted-publishing.md +53 -0
- package/docs/project/vision.md +70 -0
- package/examples/.gitkeep +0 -0
- package/extensions/agent-vent.ts +1384 -0
- package/package.json +95 -0
- package/policy/engineering-lane.json +22 -0
- package/policy/security-policy.json +10 -0
- package/prompts/implementation-planning.md +20 -0
- package/prompts/security-review.md +20 -0
- package/scripts/docs-list.sh +50 -0
- package/scripts/quality-gate.sh +168 -0
- package/scripts/release-artifact-check.mjs +221 -0
- package/scripts/release-check.sh +196 -0
- package/scripts/release-smoke-check.mjs +367 -0
- package/scripts/release-smoke.sh +90 -0
- package/scripts/validate-structure.mjs +248 -0
- package/scripts/validate-structure.sh +145 -0
- package/src/vent-store.js +2839 -0
- package/tests/.gitkeep +0 -0
- package/tests/agent-vent-extension.test.js +762 -0
- package/tests/release-artifact-check.test.js +168 -0
- package/tests/release-smoke-check.test.js +235 -0
- package/tests/vent-store.test.js +1972 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Implementation plan for the first pi-agent-vent package slice."
|
|
3
|
+
read_when:
|
|
4
|
+
- "Continuing or reviewing the initial agent vent implementation."
|
|
5
|
+
system4d:
|
|
6
|
+
container: "Implementation slice for local agent vent capture."
|
|
7
|
+
compass: "Ship a minimal, tested, local-first tool without authority drift."
|
|
8
|
+
engine: "Scaffold -> domain/store core -> Pi extension surface -> docs -> validation."
|
|
9
|
+
fog: "Overbuilding escalation workflows before local records prove useful."
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Implementation plan — pi-agent-vent v0.1
|
|
13
|
+
|
|
14
|
+
## Scope
|
|
15
|
+
|
|
16
|
+
Create a new simple-package monorepo package from `pi-extensions-template` and replace scaffold placeholders with a real local agent vent tool.
|
|
17
|
+
|
|
18
|
+
## Acceptance criteria
|
|
19
|
+
|
|
20
|
+
- Package exists at `packages/pi-agent-vent` with tracked `.copier-answers.yml` and template-aligned metadata.
|
|
21
|
+
- `agent_vent` custom tool supports `record`, `summary`, `list`, and `path` actions.
|
|
22
|
+
- `/agent_vent` command supports human-readable `help`, `summary`, `list`, and `path` inspection, with `/agent-vent` retained as a compatibility alias.
|
|
23
|
+
- Durable data is append-only JSONL at `~/.pi/agent/agent-vent/vents.jsonl` or `PI_AGENT_VENT_DIR`.
|
|
24
|
+
- Records are minimized, schema-versioned, and redacted for common secret patterns.
|
|
25
|
+
- Recurrence grouping and candidate-incident heuristics are implemented in testable core code.
|
|
26
|
+
- Package README, engineering override, vision/foundation docs, and root package maps describe the real behavior.
|
|
27
|
+
- Root release-please component config is synchronized from package metadata.
|
|
28
|
+
- `pi-toolbox-discovery` catalog exposes an `agent_vent` diagnostic bundle without moving vent ownership into ASC/self.
|
|
29
|
+
- `npm run check` passes for `packages/pi-agent-vent`.
|
|
30
|
+
|
|
31
|
+
## Implementation steps
|
|
32
|
+
|
|
33
|
+
1. Generate package scaffold with `copier copy --trust --vcs-ref HEAD` from `~/ai-society/softwareco/owned/pi-extensions-template` in `simple-package` mode.
|
|
34
|
+
2. Add core module `src/vent-store.js`:
|
|
35
|
+
- category/severity vocabularies;
|
|
36
|
+
- redaction and recurrence-key normalization;
|
|
37
|
+
- append/read JSONL store helpers;
|
|
38
|
+
- grouping, candidate-incident, and formatting helpers.
|
|
39
|
+
3. Replace `extensions/agent-vent.ts` scaffold command:
|
|
40
|
+
- register `agent_vent` custom tool with clear prompt guidelines;
|
|
41
|
+
- register `/agent_vent` inspection command plus `/agent-vent` compatibility alias;
|
|
42
|
+
- keep all storage local; avoid network and owner-surface writes.
|
|
43
|
+
4. Add `tests/vent-store.test.js` for redaction, record creation, JSONL round-trip, and summary grouping.
|
|
44
|
+
5. Update package metadata and docs:
|
|
45
|
+
- `package.json` description/keywords/files;
|
|
46
|
+
- `README.md` quickstart and data/privacy contract;
|
|
47
|
+
- `docs/engineering.local.md` selected disciplines and package-specific deltas;
|
|
48
|
+
- `docs/project/vision.md`, `foundation.md`, and `extension-sop.md`;
|
|
49
|
+
- `next_session_prompt.md` if needed.
|
|
50
|
+
6. Update root and cross-package discovery docs:
|
|
51
|
+
- `README.md` package list and routing;
|
|
52
|
+
- `README.terse.md` package map;
|
|
53
|
+
- `pi-toolbox-discovery` catalog/docs/tests for the `agent_vent` bundle;
|
|
54
|
+
- ASC/self capability docs to point at `agent_vent` as a separate companion when relevant;
|
|
55
|
+
- root release-please config/manifest via `node ./scripts/release-components.mjs sync`.
|
|
56
|
+
7. Validate:
|
|
57
|
+
- `npm install` in the package;
|
|
58
|
+
- `npm run check` in the package;
|
|
59
|
+
- optionally `node ./scripts/release-components.mjs validate` at root.
|
|
60
|
+
|
|
61
|
+
## Deferred work
|
|
62
|
+
|
|
63
|
+
- Confirmation-gated delete/export commands.
|
|
64
|
+
- Rich TUI summary view.
|
|
65
|
+
- Optional AK/GitHub escalation helpers that create draft text only, never silent mutations.
|
|
66
|
+
- Team-shared sink after consent, retention, identity, and sync semantics are designed.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Lifecycle SOP for extension delivery and maintenance."
|
|
3
|
+
read_when:
|
|
4
|
+
- "Planning, implementing, verifying, releasing, or maintaining extension work."
|
|
5
|
+
system4d:
|
|
6
|
+
container: "End-to-end extension operating procedure."
|
|
7
|
+
compass: "Consistent quality from idea to maintenance."
|
|
8
|
+
engine: "plan -> implement -> verify -> release -> maintain."
|
|
9
|
+
fog: "Unknowns resolved through incremental validation loops."
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Extension SOP
|
|
13
|
+
|
|
14
|
+
## 1) Plan
|
|
15
|
+
|
|
16
|
+
- Define scope and acceptance criteria.
|
|
17
|
+
- Read [Agent vent design](2026-05-21-agent-vent-design.md) before changing tool behavior or storage.
|
|
18
|
+
- Run `npm run docs:list` and read docs matching your task domain.
|
|
19
|
+
- Capture dated RFCs, runbooks, and evidence/progress notes in `docs/project/`.
|
|
20
|
+
- Capture adopted architecture decisions in `docs/adr/`.
|
|
21
|
+
- Confirm privacy, authority-boundary, storage, and dependency risks.
|
|
22
|
+
|
|
23
|
+
## 2) Implement
|
|
24
|
+
|
|
25
|
+
- Build in small commits.
|
|
26
|
+
- Keep command/tool behavior explicit.
|
|
27
|
+
- Keep pure recurrence/redaction/store behavior in `src/vent-store.js` with `node:test` coverage.
|
|
28
|
+
- Do not add network calls, telemetry, AK mutations, GitHub mutations, or incident creation without a new design.
|
|
29
|
+
- Update docs as behavior changes.
|
|
30
|
+
|
|
31
|
+
## 3) Verify
|
|
32
|
+
|
|
33
|
+
- Run `npm run check`.
|
|
34
|
+
- Confirm tests cover changed redaction, recurrence, JSONL, and candidate-incident behavior.
|
|
35
|
+
- Validate prompt templates if changed.
|
|
36
|
+
- For live behavior, install the package into Pi, `/reload`, then verify `/agent_vent help` or a safe `agent_vent` call.
|
|
37
|
+
|
|
38
|
+
## 4) Release
|
|
39
|
+
|
|
40
|
+
- Run `npm run release:check` (or `npm run release:check:quick` for artifact-only CI mode).
|
|
41
|
+
- Confirm GitHub Actions settings allow marketplace actions and PR creation by workflows.
|
|
42
|
+
- Use release-please PR flow for versioning/changelog updates.
|
|
43
|
+
- For first-time npm packages, follow [trusted-publishing.md](./trusted-publishing.md); if npm requires bootstrap before trusted publishing can be bound, perform that one-time operator step outside CI before returning to OIDC-only publishing.
|
|
44
|
+
- Publish from GitHub release after publish workflow checks pass.
|
|
45
|
+
- Sync extension to live pi when needed.
|
|
46
|
+
|
|
47
|
+
## 5) Maintain
|
|
48
|
+
|
|
49
|
+
- Monitor regressions and user feedback.
|
|
50
|
+
- Review whether candidate-incident heuristics are noisy or too quiet.
|
|
51
|
+
- Re-run validation after dependency/script changes.
|
|
52
|
+
- Keep `README.md` and `next_session_prompt.md` current.
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Product posture for pi-agent-vent: promise, maturity, trust gates, boundaries, and next bets."
|
|
3
|
+
read_when:
|
|
4
|
+
- "Before choosing the next pi-agent-vent product or implementation slice."
|
|
5
|
+
- "When deciding whether vent review, escalation drafting, retention, or routing belongs in pi-agent-vent."
|
|
6
|
+
- "When aligning pi-agent-vent with ASC/self, toolbox, AK, GitHub, incidents, or evidence surfaces."
|
|
7
|
+
type: "reference"
|
|
8
|
+
system4d:
|
|
9
|
+
container: "Package-local product posture for agent frustration diagnostics and operator review."
|
|
10
|
+
compass: "Make recurring agent pain actionable without turning local diagnostics into authority."
|
|
11
|
+
engine:
|
|
12
|
+
invariants:
|
|
13
|
+
- "Capture minimized local vents before they disappear."
|
|
14
|
+
- "Group recurrence and route review without automatic escalation."
|
|
15
|
+
- "Keep tasks, issues, incidents, evidence, and publication with their owner surfaces."
|
|
16
|
+
fog:
|
|
17
|
+
risks:
|
|
18
|
+
- "A convenient vent log can become hidden incident/task/evidence authority."
|
|
19
|
+
- "Raw logs or private payloads can leak into diagnostic records."
|
|
20
|
+
- "Noisy one-off complaints can bury recurring maintenance signal."
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# Product posture — `@tryinget/pi-agent-vent`
|
|
24
|
+
|
|
25
|
+
## Vision relation
|
|
26
|
+
|
|
27
|
+
The package north star lives in [vision.md](./vision.md). This posture file is the current bridge from that vision into promise, maturity, trust gates, boundaries, strategic line, and next product bets.
|
|
28
|
+
|
|
29
|
+
## Product promise
|
|
30
|
+
|
|
31
|
+
`pi-agent-vent` turns repeated agent frustration into a local, reviewable maintenance inbox.
|
|
32
|
+
|
|
33
|
+
Short form:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
surface pain; review before authority
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Primary users
|
|
40
|
+
|
|
41
|
+
- Pi operators who want recurring agent friction surfaced instead of lost in chat history.
|
|
42
|
+
- Controller agents that need a safe place to record repeated tool/runtime/workflow pain.
|
|
43
|
+
- Package/runtime maintainers reviewing patterns before deciding whether to file issues or tasks.
|
|
44
|
+
- Future adapter authors that may generate human-approved owner-surface draft text.
|
|
45
|
+
|
|
46
|
+
## Job to be done
|
|
47
|
+
|
|
48
|
+
When an agent keeps hitting the same bug, missing affordance, brittle workflow, context-loss pattern, or tool failure, I want it captured locally, grouped with similar observations, and presented for operator review without silently creating incidents, tasks, issues, evidence, or telemetry.
|
|
49
|
+
|
|
50
|
+
## Current product maturity
|
|
51
|
+
|
|
52
|
+
- maturity: `local diagnostic alpha, review-and-retention safety hardened; privacy, review-command, outcome-follow-up, review-filter, review-compare, follow-up-scope, export-scope, export-follow-up, review-decision-legibility, destructive-selection, retention-history, public-contract parity, unpacked-artifact contract, installed-command smoke, installed shadow registered-tool smoke, and release-metadata alignment membranes verified`
|
|
53
|
+
- current capability baseline: local append-only vent capture with optional local tool/package facets, recurrence grouping, local facet summary, local operator review queue with fail-closed-before-store-read command syntax and read-only category/tag/tool/package facet filters, read-only per-state review outcome follow-up buckets, read-only cross-state review comparison without archive/restore tokens, explicit derived local decision-posture projections, curation-aware recurrence resolution for review-state commands and record feedback, filter-preserving supported follow-up commands including record/state-scoped facet export, export-local-follow-up guidance without archive/restore tokens, read-only reviewed-group retention candidate planning without archive tokens, read-only retention receipt history with rollback-candidate restore command reconstruction, advisory human-review hints, quoted state-aware local next-action guidance that round-trips legacy recurrence keys, bounded representative-sample detail, review-state events, append-only recurrence curation projections with remove/undo events, diagnostic-state load membrane with privacy metadata recomputation, facet-aware draft-only owner-surface text generation, lifecycle stats/export projections, lock/hash-guarded confirmation-gated retention archive/restore with duplicate-id-safe record selection, local backup receipts, and rollback safeguards, advisory candidate-incident heuristic, redaction/minimization, `/agent_vent` inspection command, toolbox discovery, ASC/self companion routing, self-contained public-artifact validation for advertised package scripts/docs, no-auth installed-artifact shadow registered-tool `agent_vent path` release smoke with isolated npm prefix/cache and vent storage, installed-tarball local-path package-discovery `/agent_vent path` release smoke with isolated Pi settings, npm prefix/cache, and vent store, explicit local `npm:<tarball>` install-source validation, and package-local release metadata alignment checks for `repository.directory`, `x-pi-template.workspacePath`, and `x-pi-template.releaseComponent`
|
|
54
|
+
- release posture: first publishable package release at `0.1.0`; npm package not yet published at time of first release checks; unpacked tarball contract has artifact-local `npm install && npm run check` proof, artifact-only quick release checks now install the packed tarball into an isolated npm prefix and execute the installed artifact's registered `agent_vent` tool `action=path` through a shadow import against isolated vent storage without Pi auth, full release checks additionally validate local `npm:<tarball>` as the install source and smoke the installed packed artifact through local-path Pi package discovery by running `/agent_vent path` with isolated Pi settings, isolated npm prefix/cache, and isolated vent storage, and package-local structure validation now fails closed on release metadata drift against `.copier-answers.yml`; the remaining release gap is real npm/GitHub provenance publication, not local artifact/package-loading confidence
|
|
55
|
+
- current strategic line: harden the local review workflow before adding owner-surface escalation adapters
|
|
56
|
+
|
|
57
|
+
## Product success criteria
|
|
58
|
+
|
|
59
|
+
The package is product-healthy when:
|
|
60
|
+
|
|
61
|
+
1. an agent can record a minimal vent without leaking secrets or raw user payloads;
|
|
62
|
+
2. an operator can see the top recurring pain points quickly;
|
|
63
|
+
3. recurrence groups separate repeated maintenance signal from one-off complaints;
|
|
64
|
+
4. candidate-incident language remains advisory and never implies an incident was declared;
|
|
65
|
+
5. review state, retention, export, and deletion behavior are explicit before data volume grows;
|
|
66
|
+
6. escalation surfaces generate drafts only and require human approval before owner-system mutation;
|
|
67
|
+
7. ASC/self, toolbox, AK, GitHub, incident, and evidence boundaries remain explicit.
|
|
68
|
+
|
|
69
|
+
## Current landed capability baseline
|
|
70
|
+
|
|
71
|
+
The package currently owns:
|
|
72
|
+
|
|
73
|
+
- `agent_vent` tool with `record`, `summary`, `list`, `path`, `facets`, `review`, `outcomes`, `compare`, `set_review`, `curate`, `draft`, `stats`, `export`, and `retention` actions, including read-only local facet filters for review queues, outcome follow-up, cross-state comparison, retention-candidate planning, and read-only retention receipt history;
|
|
74
|
+
- `/agent_vent` command for local inspection and recurrence review, with `/agent-vent` retained as a compatibility alias;
|
|
75
|
+
- schema-versioned local JSONL storage at `~/.pi/agent/agent-vent/vents.jsonl`, local review events at `~/.pi/agent/agent-vent/review-events.jsonl`, local curation events at `~/.pi/agent/agent-vent/curation-events.jsonl`, local retention receipts at `~/.pi/agent/agent-vent/retention-events.jsonl`, and retention backups under `~/.pi/agent/agent-vent/backups/`, overridable via `PI_AGENT_VENT_DIR`;
|
|
76
|
+
- conservative redaction for common secret/token/password shapes;
|
|
77
|
+
- recurrence key derivation and grouping;
|
|
78
|
+
- advisory candidate-incident heuristic based on repetition/severity;
|
|
79
|
+
- malformed JSONL line tolerance, oversized-line/file guards, read-time schema normalization/redaction with privacy metadata recomputation, and semantic curation quarantine during reads;
|
|
80
|
+
- package-local tests for redaction, privacy metadata recomputation, record creation, JSONL round trip, recurrence summaries, local facet summaries, review filtering/detail/hints/next-action guidance, review decision-posture projection, curation-aware recurrence resolution for review state and record feedback, outcome follow-up buckets, explicit per-state outcome/compare limits, read-only cross-state comparison without archive/restore tokens, filter-preserving compare follow-ups and record/state-scoped facet export, export follow-up command quoting without archive/restore tokens or owner-routing claims, read-only retention-candidate planning without archive tokens, read-only retention-history restore-candidate reconstruction without active-store reads, fail-closed review/outcome/compare/export/retention-candidate/history command syntax before store reads (including empty filters), quoted legacy recurrence-key command round trips, review/curation/draft/retention projections, hostile legacy JSONL redaction, curation-cycle quarantine, file/line-size guards, confirmation-gated archive/restore, duplicate-id retention selection, complete token-input requirements, stale token/restore failures, path-escape/symlink backup failures, receipt-failure rollback, stale lock cleanup, quoted rollback commands, and extension registration;
|
|
81
|
+
- `pi-toolbox-discovery` integration through the same-named `agent_vent` bundle;
|
|
82
|
+
- ASC/self capability-routing text that points frustration diagnostics to `agent_vent` instead of self/ASC state.
|
|
83
|
+
|
|
84
|
+
## Product non-goals
|
|
85
|
+
|
|
86
|
+
`pi-agent-vent` must not become:
|
|
87
|
+
|
|
88
|
+
- an automatic incident declaration system;
|
|
89
|
+
- a direct AK task/evidence writer;
|
|
90
|
+
- a GitHub issue creator without explicit human approval;
|
|
91
|
+
- a telemetry collector or team sync daemon by default;
|
|
92
|
+
- a replacement for ASC/self operational introspection;
|
|
93
|
+
- a canonical evidence, publication, KES, Prompt Vault, or ROCS owner;
|
|
94
|
+
- a dumping ground for ordinary progress updates or emotional noise with no maintenance signal.
|
|
95
|
+
|
|
96
|
+
## Trust gates
|
|
97
|
+
|
|
98
|
+
A vent-derived recommendation is trustworthy only when:
|
|
99
|
+
|
|
100
|
+
1. **Minimization** — summary/evidence are short and avoid raw logs or private payloads.
|
|
101
|
+
2. **Privacy** — known secret shapes are redacted and the operator still treats records as local diagnostic user data.
|
|
102
|
+
3. **Recurrence** — repeated groups are visible by stable recurrence key rather than just timestamp order.
|
|
103
|
+
4. **Review state** — operator review status is explicit before escalation.
|
|
104
|
+
5. **Owner seam** — draft escalation names the target owner surface but does not mutate it automatically.
|
|
105
|
+
6. **Boundary report** — output says what was not done: no task, issue, incident, evidence, telemetry, or ASC/self state mutation.
|
|
106
|
+
|
|
107
|
+
## Current strategic line
|
|
108
|
+
|
|
109
|
+
Prioritize review quality over escalation power.
|
|
110
|
+
|
|
111
|
+
The highest-leverage product line is:
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
local vent capture -> operator review queue -> draft-only owner routing -> human-approved escalation
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Do not add automatic GitHub/AK/incident writers. The local facet summary, fail-closed facet-filtered local review queue, per-state review outcome follow-up, read-only cross-state review comparison, explicit local decision posture, filter-preserving supported follow-up commands, record/state-scoped facet export, export-local-follow-up guidance, read-only retention-candidate planning, read-only retention-history receipt projection, advisory human-review hints, quoted state-aware next-action guidance, bounded review-detail samples, curation-aware recurrence resolution, facet-aware draft-only routing, retention archive/restore, and privacy membrane now have package validation; remaining product depth should refine operator comprehension only where it does not broaden authority. Hard-delete beyond backup-backed archive is decided out of v0.1: permanent removal remains operator-owned filesystem/data-lifecycle control unless a future decision accepts a narrower purge design.
|
|
118
|
+
|
|
119
|
+
Current proof: `npm run check` passes with 80 package tests plus release dry-run, packaged Markdown link checks, an unpacked-tarball `npm install && npm run check` contract smoke that runs the packaged fallback gate from inside the artifact, an artifact-only no-auth installed shadow registered-tool `agent_vent path` no-store-read smoke, and a full installed-tarball local-path package-discovery `/agent_vent path` smoke using isolated `PI_CODING_AGENT_DIR`, isolated npm prefix/cache, and `PI_AGENT_VENT_DIR`; docs strict check passes, `git diff --check` passes, and historical dogfood covered curation resolution, export posture, and live `pi install` reload behavior. Validation now covers quoted rollback commands, complete retention token inputs, stale-token/stale-restore failures, path-escape/symlink backup failures, receipt-failure rollback, retention-history restore-candidate reconstruction without active-store reads, export follow-up command quoting without archive/restore tokens or owner-routing claims, review decision-posture projection without resolution/assignment/evidence/incident claims, curation-aware recurrence resolution for review state and record feedback, stale lock cleanup, backup restore, duplicate-id-safe retention archive selection, retention-candidate planning without archive tokens, retention-candidate and compare tool-schema/command-contract parity, filter-preserving supported compare follow-ups, record/state-scoped facet export without owner-routing claims, mixed-group export non-broadening, empty export filters failing closed before store reads, tag/facet privacy metadata recomputation, hostile legacy JSONL privacy recomputation, fail-closed review/outcome/compare/export/retention-candidate/history syntax before store reads including empty filters, invalid review category/state handling, explicit per-state outcome/compare limits, quoted legacy recurrence-key command round trips, tool-only maintainer-note hints, reference-style packaged Markdown links, fail-closed `files[]` wildcard handling, public artifact script viability, release metadata alignment with `.copier-answers.yml`, local `npm:<tarball>` install-source validation, isolated installed-command smoke output, local-path package-discovery loading from the installed artifact, shadow registered-tool execution from the installed artifact, and registered-tool `path` no-store-read/no-store-write behavior with symlinked active stores.
|
|
120
|
+
|
|
121
|
+
## Next product bets
|
|
122
|
+
|
|
123
|
+
### Bet 1 — Operator review queue — landed baseline
|
|
124
|
+
|
|
125
|
+
The local review surface turns recurrence groups into an inbox:
|
|
126
|
+
|
|
127
|
+
```text
|
|
128
|
+
new -> acknowledged | dismissed | escalation_drafted
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The landed baseline lists groups by recurrence priority, supports fail-closed read-only category/tag/tool/package facet filters, shows advisory human-review hints, shows explicit local decision posture, shows quoted state-aware local next-action guidance that remains safe for legacy recurrence keys, shows representative summaries/sample ids through recurrence projections, offers bounded read-only representative-sample expansion for a single group, records append-only local review-state events without mutating owner systems, provides read-only outcome follow-up buckets for `new`, `acknowledged`, `dismissed`, and `escalation_drafted` groups, compares review-state buckets with filter-preserving supported follow-up commands, exports filtered local diagnostic projections with safe local follow-up guidance, and supports retention receipt history. Remaining product depth is contract-parity polish only unless fresh discovery shows a concrete gap; owner-system mutation stays human-approved and external.
|
|
132
|
+
|
|
133
|
+
### Bet 2 — Retention, export, and deletion controls — non-destructive baseline landed
|
|
134
|
+
|
|
135
|
+
Make local data lifecycle explicit before records accumulate:
|
|
136
|
+
|
|
137
|
+
- show store size/count — landed via `stats`;
|
|
138
|
+
- export JSON or markdown diagnostic projections — landed via `export`;
|
|
139
|
+
- list reviewed groups for archive planning — landed through read-only `retention candidates` with state/facet filters, exact preview commands, and no archive confirmation tokens;
|
|
140
|
+
- archive reviewed groups with confirmation — landed through `retention preview|archive` with exact store/review/curation-hash tokens, local lock coordination with vent appends, duplicate-id-safe selected-record removal, local backups, append-only receipts, and receipt-failure rollback;
|
|
141
|
+
- rediscover archive/restore receipts — landed through read-only `retention history`, which reconstructs rollback-candidate restore commands from archive receipts without reading active vents/backups and without implying rollback already happened;
|
|
142
|
+
- restore archived groups from package backups — landed through `retention restore` with derived exact tokens, real backup-directory containment, current-store hash checks, and quoted rollback command support;
|
|
143
|
+
- delete reviewed groups without backup — decided out of the v0.1 package surface by [ADR 2026-05-22](../adr/2026-05-22-agent-vent-retention-delete-policy.md); archive remains the destructive package lifecycle baseline;
|
|
144
|
+
- document backup/restore posture — covered by explicit paths, lifecycle stats, and retention command output;
|
|
145
|
+
- keep corruption behavior fail-soft and visible — landed for malformed lines, oversized lines, invalid entries, semantic curation quarantine, and fail-closed symlink/oversized-file checks.
|
|
146
|
+
|
|
147
|
+
### Bet 3 — Recurrence curation — merge/rename baseline landed
|
|
148
|
+
|
|
149
|
+
Improve signal quality without over-modeling:
|
|
150
|
+
|
|
151
|
+
- merge recurrence groups — landed as append-only local curation projection events;
|
|
152
|
+
- rename recurrence keys — landed as append-only local curation projection events;
|
|
153
|
+
- undo local curation aliases — landed as append-only `remove` curation events;
|
|
154
|
+
- dismiss noisy groups — already covered by local review state;
|
|
155
|
+
- show top categories/tags/tools/packages — landed as read-only local facet summaries; owner hints are intentionally local diagnostic/draft hints only, not package-owned routing truth;
|
|
156
|
+
- preserve append-only source records while treating curated summaries as local projections — landed; raw vents are not rewritten.
|
|
157
|
+
|
|
158
|
+
### Bet 4 — Draft-only owner escalation — landed baseline
|
|
159
|
+
|
|
160
|
+
Generate human-reviewable drafts for likely owner surfaces:
|
|
161
|
+
|
|
162
|
+
- GitHub issue draft — landed;
|
|
163
|
+
- AK task draft — landed;
|
|
164
|
+
- incident review draft — landed;
|
|
165
|
+
- package maintainer note — landed.
|
|
166
|
+
|
|
167
|
+
These drafts do not submit automatically. The package prepares local text, local diagnostic facet hints, and exact next-step guidance; the owner system performs any mutation only after explicit human/operator action. Producing a draft does not automatically mark review state; operators can set `escalation_drafted` explicitly when useful. This clarified the provenance seam: draft text is a local diagnostic projection, not evidence, task truth, issue truth, incident truth, or owner-routing truth.
|
|
168
|
+
|
|
169
|
+
## Next frontier guidance
|
|
170
|
+
|
|
171
|
+
The next highest-leverage slice should assume the facets/review/outcomes/compare/filter/hint/detail/draft/curation/retention-candidate/retention-history/retention-archive/export/export-follow-up/review-decision-posture and public-runtime-artifact smoke membranes are the baseline and should not broaden authority. Retention now has transaction-oriented safeguards (store/review/curation-hash tokens, append/archive locking, duplicate-id-safe selected-record removal, stale-lock cleanup, receipt-failure rollback, derived restore tokens, realpath backup containment, quoted rollback commands, retention-history receipt rediscovery, and stale-restore checks) plus read-only reviewed-candidate, receipt-history, export follow-up, decision-posture, and cross-state comparison surfaces that preserve supported follow-up scope without owner-surface mutation. Local facet labels, filters, curation aliases, outcome states, comparison buckets, hints, generated commands, export snapshots, history receipts, decision posture, and draft text are diagnostic projections only; filtered export is record/state-scoped and is not evidence, publication, owner routing, or owner assignment. The clarified source-owner seam is that export/history/review scope may focus local diagnostic data but cannot make that data canonical evidence or publication, and curation-aware recurrence keys are local projection identity rather than owner-system identity; local release smoke and release metadata checks may prove package-loading and repo-local metadata alignment but cannot prove npm publication/provenance; Prompt Vault, AK, GitHub, incident, evidence, ROCS, ASC/self, toolbox surfaces, and npm publication/provenance remain separate owners. The latest contract-parity frontier is maintaining source checkout versus public runtime artifact proof together: `npm pack` contents, README/package scripts, packaged docs, release checks, installed package settings, isolated npm installation state, no-auth installed shadow registered-tool smoke, installed command smoke, local tarball install-source validation, local-path Pi package-discovery smoke, and release metadata alignment must be validated as consumed, not only from the monorepo checkout. Discovery showed local `npm:<tarball>` is useful as a Pi install input but is not a documented runtime package-discovery source like `npm:@scope/pkg@1.2.3`; the package now fails closed against falsely claiming that proof. The remaining release frontier is the external publish/provenance workflow, not more unlabeled local package smoke. npm publish, AK/GitHub/incident/evidence creation, and hard-delete remain out of scope unless explicitly authorized. Preserve the contract-parity lesson from this iteration: command grammar, LLM tool schema, README examples, posture docs, package `files[]`, release checks, artifact-local scripts, smoke scripts, and tests must change together; unknown syntax must fail closed before store reads even when values are empty. Do not spend the next slice on hard-delete unless a new decision explicitly supersedes [ADR 2026-05-22](../adr/2026-05-22-agent-vent-retention-delete-policy.md).
|
|
172
|
+
|
|
173
|
+
## Ownership map
|
|
174
|
+
|
|
175
|
+
| Concern | Owner |
|
|
176
|
+
|---|---|
|
|
177
|
+
| Local vent records, recurrence grouping, review queue/outcome projections, local curation events, retention receipts/backups, draft text projections, diagnostic-state membrane | `packages/pi-agent-vent` |
|
|
178
|
+
| Tool discovery/activation | `packages/pi-toolbox-discovery` |
|
|
179
|
+
| Operational self mirror and subagent runtime | `packages/pi-autonomous-session-control` |
|
|
180
|
+
| Durable task/evidence/direction truth | AK / society authority surfaces |
|
|
181
|
+
| GitHub issues and repo issue policy | Target repo / GitHub owner workflow |
|
|
182
|
+
| Real incident declaration | Incident owner surface / human operator |
|
|
183
|
+
| Prompt/procedure reuse | Prompt Vault |
|
|
184
|
+
| Shared ontology/controlled semantics | ROCS / ontology owner repos |
|
|
185
|
+
|
|
186
|
+
## Read map
|
|
187
|
+
|
|
188
|
+
- Vision / north star: [vision.md](./vision.md)
|
|
189
|
+
- Design: [2026-05-21-agent-vent-design.md](./2026-05-21-agent-vent-design.md)
|
|
190
|
+
- Implementation plan: [2026-05-21-agent-vent-implementation-plan.md](./2026-05-21-agent-vent-implementation-plan.md)
|
|
191
|
+
- Extension SOP: [extension-sop.md](./extension-sop.md)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Trusted publishing notes for monorepo package components."
|
|
3
|
+
read_when:
|
|
4
|
+
- "Configuring npm OIDC trusted publishing for monorepo package releases."
|
|
5
|
+
- "Debugging release-please or publish workflow failures in monorepo CI."
|
|
6
|
+
system4d:
|
|
7
|
+
container: "Monorepo release automation reliability notes."
|
|
8
|
+
compass: "Use OIDC safely with component-aware release behavior."
|
|
9
|
+
engine: "Configure root workflows -> validate package metadata -> release -> verify."
|
|
10
|
+
fog: "Most failures come from root workflow policy mismatch or component map drift."
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Trusted publishing runbook (monorepo package mode)
|
|
14
|
+
|
|
15
|
+
## Baseline assumptions
|
|
16
|
+
|
|
17
|
+
- Release automation lives at monorepo root.
|
|
18
|
+
- Package release is component-scoped (release-please component mode or equivalent).
|
|
19
|
+
- Publish workflow uses npm OIDC trusted publishing (no long-lived npm token in CI).
|
|
20
|
+
- If npm registry policy requires first-package bootstrap before trusted publishing can be bound, perform that one-time operator step outside CI, then return CI to OIDC-only publishing.
|
|
21
|
+
|
|
22
|
+
## Package-level requirements
|
|
23
|
+
|
|
24
|
+
- `package.json.repository.url` must point to monorepo git URL.
|
|
25
|
+
- `package.json.repository.directory` must match package workspace path.
|
|
26
|
+
- `x-pi-template` metadata should align with root component mapping:
|
|
27
|
+
- `workspacePath`
|
|
28
|
+
- `releaseComponent`
|
|
29
|
+
- `releaseConfigMode` (default/root-managed baseline: `component`; `none` is an explicit opt-out only)
|
|
30
|
+
|
|
31
|
+
## Root workflow expectations
|
|
32
|
+
|
|
33
|
+
- Root `release-please` workflow must keep component map aligned with package metadata when `releaseConfigMode` is `component`.
|
|
34
|
+
- Publish workflow should run npm >= 11.5.1 for trusted publishing compatibility.
|
|
35
|
+
- Actions policy + permissions at repo level must allow release/publish workflows.
|
|
36
|
+
|
|
37
|
+
## Common failure modes
|
|
38
|
+
|
|
39
|
+
1. Component key drift between package metadata and root release config.
|
|
40
|
+
2. Wrong `repository.directory` causing provenance verification failures.
|
|
41
|
+
3. Workflow permissions set to read-only in monorepo settings.
|
|
42
|
+
4. Missing npm trusted publisher binding for monorepo repository/workflow.
|
|
43
|
+
|
|
44
|
+
## Verification checklist
|
|
45
|
+
|
|
46
|
+
- Package passes `npm run release:check:quick` in workspace.
|
|
47
|
+
- Quick checks are artifact-only and require no Pi auth: they verify `npm pack`, packaged Markdown links, artifact-local `npm install && npm run check`, isolated npm installation of the packed tarball, and installed shadow registered-tool `agent_vent path` execution against isolated vent storage.
|
|
48
|
+
- Package passes `npm run release:check` where live Pi smoke is available.
|
|
49
|
+
- Full checks additionally install the tarball through isolated Pi package settings, validate local `npm:<tarball>` as the install source, and smoke `/agent_vent path` through local-path package discovery of the installed artifact. Pi package docs define npm settings sources as package specs such as `npm:@scope/pkg@1.2.3`; local tarball paths are validated here as install inputs, not claimed as a runtime package-discovery source.
|
|
50
|
+
- Root release workflow can produce/update component release PR.
|
|
51
|
+
- Publish workflow completes with `npm publish --provenance --access public` for package.
|
|
52
|
+
|
|
53
|
+
Local release checks prove artifact/package-loading behavior only. npm trusted publisher binding, GitHub release execution, and provenance publication remain external owner-surface facts.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Product and technical vision for pi-agent-vent."
|
|
3
|
+
read_when:
|
|
4
|
+
- "Defining or revisiting project direction."
|
|
5
|
+
- "Deciding whether a venting/review/escalation feature belongs in pi-agent-vent."
|
|
6
|
+
system4d:
|
|
7
|
+
container: "Project north-star statement for local agent frustration capture and operator review."
|
|
8
|
+
compass: "Turn recurring agent pain into reviewable maintenance signal without authority drift."
|
|
9
|
+
engine: "Capture minimized vent -> group recurrence -> review in an operator inbox -> draft owner-surface escalation only after human choice."
|
|
10
|
+
fog: "The package fails if vents become noisy, privacy-risky, silently escalated, or mistaken for real incidents/tasks/evidence."
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Vision
|
|
14
|
+
|
|
15
|
+
`pi-agent-vent` turns repeated agent frustration into a small, local maintenance inbox.
|
|
16
|
+
|
|
17
|
+
Agents regularly encounter the same brittle workflows, missing affordances, tool/runtime failures, context-loss patterns, and long-lived bugs. Those observations usually disappear into chat history or final-answer omissions. This package gives them a safe local place to say “this keeps hurting,” then helps an operator review the pattern before deciding whether any owner surface should act.
|
|
18
|
+
|
|
19
|
+
The product promise is:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
capture local pain -> make recurrence visible -> let a human decide escalation
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Product principles
|
|
26
|
+
|
|
27
|
+
- **Local first:** records stay on the operator machine by default.
|
|
28
|
+
- **Minimal by default:** summarize friction; do not copy secrets, private user payloads, or long logs.
|
|
29
|
+
- **Review before escalation:** vent records become an operator-reviewable inbox, not automatic tasks or incidents.
|
|
30
|
+
- **Advisory, not authoritative:** candidate incidents are review prompts, not incident declarations.
|
|
31
|
+
- **Human-owned escalation:** AK tasks, GitHub issues, evidence, incidents, and publication belong to their owner surfaces.
|
|
32
|
+
- **Cheap to inspect:** `/agent_vent summary`, `/agent_vent list`, and `/agent_vent path` should explain the state quickly.
|
|
33
|
+
- **Coherent naming:** user-facing runtime surfaces should prefer `agent_vent`; package/release filesystem names may remain `pi-agent-vent` where ecosystem conventions require kebab-case.
|
|
34
|
+
|
|
35
|
+
## Product shape
|
|
36
|
+
|
|
37
|
+
A healthy workflow looks like:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
agent notices recurring friction
|
|
41
|
+
-> agent_vent records a minimized local vent
|
|
42
|
+
-> recurrence groups reveal repeated pain
|
|
43
|
+
-> operator reviews, acknowledges, dismisses, merges, or drafts escalation
|
|
44
|
+
-> owner system receives a human-approved draft only when appropriate
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Near-term product work should make the review step better rather than broadening authority. Useful next surfaces include:
|
|
48
|
+
|
|
49
|
+
- `/agent_vent review` for an operator-facing review queue;
|
|
50
|
+
- explicit local review states such as `new`, `acknowledged`, `dismissed`, and `escalation_drafted`;
|
|
51
|
+
- recurrence-group merge/dedupe flows;
|
|
52
|
+
- export/delete/retention controls;
|
|
53
|
+
- package/tool owner routing hints;
|
|
54
|
+
- draft-only GitHub/AK/incident text generation that never submits automatically.
|
|
55
|
+
|
|
56
|
+
## Technical principles
|
|
57
|
+
|
|
58
|
+
- Use the `engineering-core` `pi-ts` lane.
|
|
59
|
+
- Keep runtime dependencies minimal; prefer Node built-ins and Pi host APIs.
|
|
60
|
+
- Keep durable state schema-versioned, local-first, append-friendly, and privacy-reviewed.
|
|
61
|
+
- Put pure recurrence/redaction/store/review behavior in testable JS modules.
|
|
62
|
+
- Keep the extension entrypoint small and explicit.
|
|
63
|
+
- Preserve template-aligned package metadata and root release automation compatibility.
|
|
64
|
+
- Integrate with `pi-toolbox-discovery` for discovery/activation and with ASC/`self` only as a companion boundary, not by storing vent state in ASC.
|
|
65
|
+
|
|
66
|
+
## Enduring invariant
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
agent_vent surfaces pain; humans and owner systems decide authority.
|
|
70
|
+
```
|
|
File without changes
|