@poppykit/server 0.1.0 → 0.1.1

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/CHANGELOG.md CHANGED
@@ -1,22 +1,18 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.0 — initial development release candidate (unpublished)
3
+ ## 0.1.1
4
4
 
5
- Request authentication, existing-issuer integration, optional Direct/Device/Mediated
6
- reference issuer, atomic targeted SQLite adapters, JSON/SSE conversation lifecycle,
7
- API/browser/feedback hooks and independent-peer/crash regressions.
5
+ Documentation refresh: registry installation, runnable quickstarts, focused guides
6
+ and the tagged GitHub/OIDC release runbook. No runtime API, storage format or
7
+ third-party dependency change.
8
8
 
9
- - Select MIT licensing and ship the complete LICENSE.
10
- - Prepare public package metadata and the initial 0.1.0 version.
11
- - Preserve J8 strict TypeScript tests, real subprocess/security regressions and
12
- immutable installed-package verification on Linux, macOS and Windows.
9
+ ## 0.1.0
13
10
 
14
- No npm publication has occurred. Version 0.x APIs/storage may still change; record
15
- compatibility and migration/reset implications with future changes. This release
16
- does not promise stable 1.0 compatibility or certify external host integrations.
11
+ Initial MIT development release, published manually. Discovery, safe HTTPS, all
12
+ three sign-in methods, targeted durable storage and recovery, conversations and
13
+ API/browser/feedback hooks. The CLI uses the client SDK with trusted secure-backend
14
+ adapters. J8 established strict typed tests and exact installed-artifact checks.
17
15
 
18
- ## 0.0.0 — historical private development candidates
19
-
20
- J1–J8 established protocol capabilities, targeted storage, durable recovery,
21
- documentation, strict tests and fail-closed release verification. Their prior
22
- commits/artifact results remain historical evidence for those exact candidates.
16
+ Version 0.x may still change APIs/storage; future changes must explain compatibility,
17
+ migration/reset and security implications. No stable 1.0 or external-host certification
18
+ is promised. Older private 0.0.0 candidates retain their own historical evidence.
package/CONTRIBUTING.md CHANGED
@@ -1,50 +1,38 @@
1
1
  # Contributing
2
2
 
3
- This package targets Personal Agent Protocol draft 0.2. Check the current
4
- [specification](https://personalagentprotocol.org/docs/0.2/spec) and
5
- [guides](https://personalagentprotocol.org/docs/0.2/guides); retained snapshots and
6
- tests are supporting evidence. Distinguish MUST requirements, SHOULD recommendations
7
- and product choices. Individual extensions and demo/business workflows are excluded.
3
+ Follow the live draft 0.2 [specification](https://personalagentprotocol.org/docs/0.2/spec)
4
+ and [guides](https://personalagentprotocol.org/docs/0.2/guides). Tests/snapshots are
5
+ supporting evidence. Demo/business workflows and individual extensions are excluded.
6
+ Code is [MIT](LICENSE); confirm rights for third-party contributions.
8
7
 
9
8
  Use Node 24.12.0, TypeScript 5.9.3 and @types/node 24.10.0.
10
- Install with the pinned pnpm version in package.json and `pnpm install --frozen-lockfile`.
11
- Run `npm run typecheck`, `npm run build`, `npm test` and `npm run check:docs`.
12
- CI partitions tests without omitting any test file; full `npm test` remains useful
13
- locally. Read [RELEASING.md](RELEASING.md) before changing workflow/release behavior.
9
+ Install the packageManager-pinned pnpm and run pnpm install --frozen-lockfile.
14
10
 
15
- Keep changes small and complete: include callers, declarations, regression checks
16
- and documentation. Do not log credentials, weaken destination validation or silently
17
- reset persisted data. Pull requests must explain checks actually run and limitations.
18
- Use the repository's Issues for non-sensitive defects and feature discussions.
19
- Code is licensed under [MIT](LICENSE). No separate contribution agreement is
20
- configured; confirm permission for third-party contributions and obtain owner
21
- authorization before publishing.
11
+ ```sh
12
+ npm run typecheck
13
+ npm run build
14
+ npm run typecheck:tests
15
+ npm test
16
+ npm run check:docs
17
+ ```
22
18
 
23
- ## TypeScript test harness and coverage
19
+ First-party tests/workers/verification helpers are canonical `.mts`. The existing
20
+ compiler checks the whole strict program before emitting ignored adjacent `.mjs`.
21
+ Failed builds remove stale outputs; no loader/type stripping substitutes for checking.
22
+ Run `npm run build:tests` before `node scripts/run-checks.mjs GROUP` (unit, contracts,
23
+ integration, validation). Groups are exhaustive/disjoint. LF source bytes are enforced
24
+ by Git attributes. Generated test code is outside the npm allowlist; production tests
25
+ import built/installed JavaScript. Release/build tools and examples may remain JS.
24
26
 
25
- First-party tests, executable fixtures, process workers and packaged verification
26
- scripts are canonical `.mts` files. Run `npm run typecheck:tests` for the complete
27
- strict program and `npm run build:tests` before individual
28
- `node scripts/run-checks.mjs GROUP` commands (unit, contracts, integration or
29
- validation). `npm test` performs that checked harness build and runs all groups.
30
- Build production first with `npm run build`; tests import compiled `dist/*.js`,
31
- not TypeScript source. No loader or native type stripping replaces the compiler.
27
+ `npm run coverage` builds production and checked tests, then writes native Node
28
+ line/branch/function reports under `coverage/` (summary.txt, lcov.info, report.json,
29
+ raw/). Metrics cover loaded first-party dist JS: no production source maps or TS
30
+ remapping; node_modules excluded, unloaded modules listed. Raw subprocess reports
31
+ are retained, but arbitrary children may not merge and killed workers may not flush.
32
+ Installed/OS/host checks are separate evidence; no percentage proves conformance.
32
33
 
33
- The existing TypeScript compiler emits ignored adjacent `.mjs` files only after
34
- all strict diagnostics pass. Failed builds remove stale canonical outputs.
35
- `scripts/build-tests.mjs` is compiler/bootstrap tooling, not an unchecked test
36
- runner. Canonical test sources use LF, enforced by `.gitattributes`, so Linux and
37
- Windows validate the same exact source bytes. Test output stays outside the npm
38
- package allowlist. Retained JavaScript release/build tools and packaged examples
39
- are genuine production tooling/examples; retained protocol captures are references.
40
-
41
- Run `npm run coverage` for a production build, checked harness and native Node
42
- 24.12.0 line/branch/function report. `coverage/summary.txt`, `coverage/lcov.info`,
43
- `coverage/report.json` and `coverage/raw/` are generated local reports. Metrics
44
- refer to first-party compiled `dist` JavaScript; production emits no source maps
45
- and no TypeScript remapping is claimed. Third-party `node_modules` is excluded;
46
- unloaded modules are listed explicitly. Raw child-process reports are retained,
47
- but arbitrary subprocess execution is not guaranteed to be merged into the native
48
- runner summary, and killed/crashed workers may not flush counters. Actual installed
49
- package/OS checks remain separate evidence. No percentage threshold substitutes
50
- for protocol, negative/security, process and platform assertions.
34
+ Include callers, meaningful regression evidence and docs with behavior changes.
35
+ Preserve credential/destination validation, private errors and persisted data.
36
+ Report checks actually run and limits. Use Issues for non-sensitive defects and
37
+ [SECURITY.md](SECURITY.md) for vulnerabilities. Follow [RELEASING.md](RELEASING.md)
38
+ before tagging/publishing; obtain explicit owner authorization.
package/DELIVERY.md CHANGED
@@ -3,48 +3,12 @@
3
3
  The SDK targets Personal Agent Protocol draft 0.2. Company content, messages,
4
4
  unknown events and partial text remain untrusted data for the host application.
5
5
 
6
- ## Client
6
+ ## Client interoperability
7
7
 
8
- Bind `createConversationClient` to the existing auth lifecycle:
9
-
10
- ```ts
11
- const target = await auth.target(connectionId);
12
- const conversations = createConversationClient({
13
- ...target, connectionId, store, clock: { now: Date.now },
14
- authorizedRequest: request => auth.authorizedFetch(connectionId, request, target),
15
- authorization: (id, scopes) => auth.authorization(id, scopes),
16
- });
17
- for await (const item of conversations.watch(conversationId, { consumer: 'ui', signal })) {
18
- await processEvent(item.event);
19
- await item.ack();
20
- }
21
- ```
22
-
23
- `authorization(eventOrError)` returns the single auth lifecycle's verified
24
- required/granted/missing scopes and eligible methods. The UI requests consent and
25
- chooses an advertised method; Device or Mediated does not require Direct support.
26
-
27
- `read` returns one page; `drain` follows `has_more` immediately. Named consumers
28
- advance only on explicit acknowledgement. `watch` accepts SSE or JSON fallback,
29
- skips unknown event types, deduplicates up to 10,000 event IDs per invocation, and
30
- never rewinds its cursor on a duplicate. JSON pagination has its separate
31
- `maxPages` bound (default 1000), without consuming reconnect attempts. Reconnects
32
- are bounded (default 4); exhaustion is explicit `reconnect_exhausted`.
33
-
34
- `lastEventId` takes precedence over the starting cursor. On reconnect the watcher
35
- sends `Last-Event-ID`. `onPartial` is display-only: a null value clears unfinished
36
- text on completion/disconnect; never execute or reason from an incomplete delta.
37
- Messages are actionable only after a complete `message` event. SSE frames and
38
- JSON fallback are limited to 1 MiB, streams to 16 MiB, and partial text per stream
39
- to 1 MiB. UTF-8 fragmentation and CR/LF/CRLF are supported.
40
-
41
- `cursor_expired` is an explicit history gap. Inform the user, then reset a named
42
- consumer and reread retained history, or supply `onHistoryGap` returning true.
43
- Automatic recovery is limited to one reset per watch; it does not recover missing
44
- events. Checkpoints and pending sends survive process restart with durable stores.
45
- Send retries keep their original connection, issuer, endpoint, ID, body and read
46
- parameters. Abort signals are invocation-local and are never persisted. Canceling
47
- delivery does not cancel an accepted company action or prove a lost send failed.
8
+ Clients keep immutable retry targets/message IDs, explicitly acknowledge named
9
+ consumers and treat cursor_expired as a history gap, not recovered history. A
10
+ disconnected client cannot undo accepted work. The [client delivery guide](https://github.com/LMol-4/poppykit-client/blob/main/DELIVERY.md)
11
+ specifies watch/reconnect bounds, partial text, pagination and checkpoint handling.
48
12
 
49
13
  ## Node transport
50
14
 
@@ -67,7 +31,7 @@ the durable cursor and fresh authorization.
67
31
  Metadata caching remains bounded and honors freshness, Age, validators, no-cache
68
32
  and no-store, with a 300-second upper bound. Expired entries revalidate; 304s retain
69
33
  prior caching directives. `resolver.invalidate(target?)` fences old pending cache
70
- writes without bypassing fetch concurrency/rate limits. J2 rejects changed saved
34
+ writes without bypassing fetch concurrency/rate limits. The auth lifecycle rejects changed saved
71
35
  issuer/endpoint/resource bindings rather than rerouting persisted work.
72
36
 
73
37
  ## Company service and retention
package/README.md CHANGED
@@ -1,117 +1,68 @@
1
1
  # PoppyKit server
2
2
 
3
- TypeScript SDK for companies exposing services through [Personal Agent Protocol
4
- draft 0.2](https://personalagentprotocol.org/docs/0.2/spec). Verify requests, serve
5
- JSON/SSE conversations, enforce current permissions, support browser-session joining
6
- and accept feedback. Your company owns accounts, consent UI, agent and business tools.
3
+ TypeScript SDK for companies implementing [Personal Agent Protocol draft 0.2](https://personalagentprotocol.org/docs/0.2/spec).
4
+ Verify requests, serve conversations and enforce current authority. Your company
5
+ supplies accounts, consent UI, agent, business tools and HTTPS routing. [MIT](LICENSE).
7
6
 
8
- ## Installation
7
+ ## Install
9
8
 
10
- Requires Node **24.12.0 or later** and ESM. CI certifies Node 24.12.0; later majors
11
- have no separate certification. Optional SQLite uses experimental `node:sqlite`
12
- and requires local filesystem locking.
13
-
14
- Version **0.1.0** is an initial development release candidate under the [MIT license](LICENSE).
15
- It has not been published. Install a verified tarball:
9
+ Requires Node **24.12.0+** and ESM. CI tests Node 24.12.0 on Linux, macOS and Windows;
10
+ later majors are not separately certified. SQLite is optional/experimental and
11
+ requires local filesystem locking.
16
12
 
17
13
  ```sh
18
- npm install ./poppykit-server-0.1.0.tgz
14
+ npm install @poppykit/server@0.1.1
19
15
  ```
20
16
 
21
- The only production dependency is `jose@6.2.12`. Neither client SDK nor CLI is required.
22
- First-publication preparation is in [RELEASING.md](RELEASING.md).
23
-
24
- ## Quickstart
25
-
26
- The complete [quickstart](examples/quickstart.mjs) creates an optional reference
27
- issuer, verified request authenticator and conversation service, then checks that
28
- an unauthenticated request is rejected. It starts no network listener:
29
-
30
- ```sh
31
- node examples/quickstart.mjs
32
- ```
17
+ ## Configure a service
33
18
 
34
- Its essential service configuration is:
19
+ This runnable example starts no listener and rejects an unauthenticated request.
20
+ `:memory:` is non-durable; use a private file and configured company sign-in hooks
21
+ in production. The reference issuer is optional; [existing issuers](AUTH.md) use
22
+ an ExternalAuthorityAdapter instead.
35
23
 
36
24
  ```js
37
25
  import { createRequestAuthenticator, createConversationService } from '@poppykit/server';
38
- const conversations = createConversationService({
39
- endpoint, store: database.conversations(issuer), policy: auth.authority.policy,
40
- authenticator: createRequestAuthenticator({ authority: auth.authority,
41
- endpoints: [{ origin: 'https://company.example', pathPrefix: '/conversations', resource: endpoint }],
42
- now: Date.now }), clock: { now: Date.now },
43
- });
26
+ import { createMetadataResolver, createNodeTransport, createReferenceIssuer } from '@poppykit/server/reference-auth';
27
+ import { SqliteCompanyDatabase } from '@poppykit/server/sqlite';
28
+
29
+ const database = new SqliteCompanyDatabase(':memory:');
30
+ const transport = createNodeTransport();
31
+ try {
32
+ const issuer = 'https://company.example/issuer';
33
+ const endpoint = 'https://company.example/conversations';
34
+ const auth = createReferenceIssuer({
35
+ issuer, tokenEndpoint: issuer + '/token', revocationEndpoint: issuer + '/revoke',
36
+ poppyDomains: ['company.example'], directScopes: [], resources: [endpoint],
37
+ metadata: createMetadataResolver(transport), store: database.issuer(issuer),
38
+ coordinator: database, now: Date.now,
39
+ });
40
+ const service = createConversationService({
41
+ endpoint, store: database.conversations(issuer), policy: auth.authority.policy,
42
+ authenticator: createRequestAuthenticator({ authority: auth.authority,
43
+ endpoints: [{ origin: 'https://company.example', pathPrefix: '/conversations', resource: endpoint }],
44
+ now: Date.now }), clock: { now: Date.now },
45
+ });
46
+ console.log((await service.handle(new Request(endpoint, { method: 'POST',
47
+ headers: { 'content-type': 'application/json' }, body: '{}' }))).status); // 401
48
+ } finally {
49
+ transport.close?.();
50
+ database.close();
51
+ }
44
52
  ```
45
53
 
46
- `database`, `auth`, `issuer` and `endpoint` are created in the runnable example.
47
- Use a private database file for persistence and your HTTPS framework to route
48
- trusted public Requests to `conversations.handle(request)`. Configure company
49
- account/consent hooks before advertising sign-in methods.
50
-
51
- ## Configuration and authentication
52
-
53
- Existing issuers integrate through `ExternalAuthorityAdapter`: provide token
54
- introspection, an explicit revocation-visibility guarantee and `AuthorityPolicy`
55
- that orders checks with protected writes. `createRequestAuthenticator` verifies
56
- the actual public method/URL and DPoP/resource binding. Resolve public URLs at
57
- your trusted proxy boundary; do not trust arbitrary forwarded headers. Core
58
- imports do not load or run the optional reference issuer.
59
-
60
- The separate `/reference-auth` implements Direct, Device and Mediated flows.
61
- Configure endpoints/trusted hooks, publish discovery/authorization metadata and
62
- route token/revocation and method handlers. Your company authenticates humans,
63
- protects consent with browser sessions/CSRF, delivers/verifies codes and chooses
64
- scopes. Opening a consent link never approves it. See [AUTH.md](AUTH.md).
65
-
66
- ## Examples and common operations
67
-
68
- Route protocol requests to `conversations.handle(request)`. Workers use `claim`,
69
- `reply`, `finish` and lifecycle methods rather than writing rows directly. Use
70
- `requireAccount(work, scopes)` or protected-operation hooks before accessing
71
- account data. Model text cannot grant permission. Your application owns tool
72
- execution, validation and effect idempotency; receipt/publication deduplication
73
- does not make external writes exactly-once.
74
-
75
- `createBrowserSessions` integrates your cookie store with current session authority.
76
- `createFeedbackHandler` accepts validated reports, including signed-out sessions.
77
- `mcpResourceMetadata` and `mcpAuthorizationError` integrate an existing MCP server
78
- and issuer. See [INTEGRATIONS.md](INTEGRATIONS.md), [DELIVERY.md](DELIVERY.md) and
79
- the independent generic request fixtures in `tests/independent-peer.test.mjs`.
80
-
81
- ## Errors, cancellation, retries and limits
82
-
83
- `AuthorityError` contains a safe code, HTTP status and authentication headers.
84
- Conversation handlers return protocol responses for known errors; your framework
85
- must handle unexpected host failures without exposing private diagnostics. Bound
86
- ingress bodies/rates before authentication. Propagate cancellation; a disconnected
87
- client cannot undo accepted application work.
88
-
89
- JSON pages and SSE events obey UTF-8 budgets. Notifications are hints; durable
90
- targeted reads reconcile lost notifications. [DELIVERY.md](DELIVERY.md) documents
91
- cursor/history gaps, waiting and record-specific retention. Choose
92
- `stop-account-work` or `allow-accepted-work-to-finish` deliberately; new requests
93
- always need current access. Immediate reference-issuer revocation visibility is
94
- an implementation policy, not a universal protocol requirement.
95
-
96
- ## Storage and production responsibilities
97
-
98
- Use one `SqliteCompanyDatabase` for reference issuer, conversations and coordinator
99
- so authorization, revocation and protected writes share a transaction. SQLite
100
- serializes writers and requires local filesystem locking. Supply your own
101
- `ConversationStore`, `IssuerStore` and `AuthorityCoordinator` for other databases;
102
- adapters enforce cross-process atomicity. [STORAGE.md](STORAGE.md) specifies
103
- contracts, retention and explicit reset.
104
-
105
- Company credentials and signing infrastructure remain your responsibility. The
106
- personal-agent identity provider is a distinct trust role in the client package.
107
- No model, database service, deployment vendor or demo is required.
108
-
109
- ## Reference and support
110
-
111
- [API.md](API.md) maps public entry points and declarations to deeper guides.
112
- This independent draft implementation has generic integration and packaged tests;
113
- deployed issuer, proxy, database and browser policies need operator validation.
114
- Individual extensions and business workflows are excluded. See
115
- [CONTRIBUTING.md](CONTRIBUTING.md), [SECURITY.md](SECURITY.md),
116
- [CHANGELOG.md](CHANGELOG.md) and [RELEASING.md](RELEASING.md). No public license
117
- grant has been selected; licensing remains an owner decision before publication.
54
+ ## Guides
55
+
56
+ - [Authentication](AUTH.md): external/reference issuers, consent and revocation.
57
+ - [Storage](STORAGE.md): shared authority coordinator, cross-process transactions and reset.
58
+ - [Delivery](DELIVERY.md): workers, streaming, cursors, retention and effect idempotency.
59
+ - [Integrations](INTEGRATIONS.md): MCP, browser cookies and feedback.
60
+ - [API exports](API.md), [contributing](CONTRIBUTING.md), [security](SECURITY.md),
61
+ [changelog](CHANGELOG.md) and [releasing](RELEASING.md).
62
+
63
+ Your ingress must bound bodies/rates before authentication, supply the trusted
64
+ public URL and propagate cancellation. Never trust arbitrary forwarding headers.
65
+ Use current policy before protected work; model text cannot grant permission.
66
+ Receipt/publication deduplication does not make external effects exactly-once.
67
+ Validate deployed database, issuer and browser policies; no model/service vendor
68
+ or demo application is required.
package/RELEASING.md CHANGED
@@ -1,193 +1,91 @@
1
- # Release preparation and owner runbook
2
-
3
- The owner selected the **MIT** license and initial development version **0.1.0**.
4
- `private: false`, `publishConfig.access: public` and the shipped [LICENSE](LICENSE)
5
- prepare these candidates for a public release; they do not publish anything.
6
- No package has been published. Tags, npm publication and external settings remain
7
- separate owner-authorized actions. This is an initial 0.x release, not a stable 1.0
8
- compatibility promise.
9
-
10
- ## Verification graph
11
-
12
- Every push, pull request and manual CI run calls the same repository-local
13
- `.github/workflows/verify.yml`. Documentation-only changes run the graph too;
14
- there are no path filters. A clean GitHub-hosted Linux job builds and packs once.
15
- The release manifest binds full source SHAs, package/version, filenames, byte
16
- counts, SHA256 and npm SHA512 integrity to those unchanged tarballs.
17
-
18
- | Job | Responsibility |
19
- | --- | --- |
20
- | candidate | Typecheck/build from exact source, pack once, record/upload identity |
21
- | fast | Documentation links/fences and small unit checks |
22
- | contracts | Storage, authentication, network and conversation contracts |
23
- | integration | API/browser/feedback and independent peers; CLI installs all pinned candidates |
24
- | packaged-linux/windows/macos | Install unchanged tarballs; startup, exports, SQLite and representative platform behavior |
25
- | validation | Release failure simulations, registry/toolchain guards and actual workflow wiring assertions |
26
- | gate | Always report; require each allowlisted job result to equal success and recheck artifact identity |
27
-
28
- The candidate job strictly typechecks and compiles the complete TypeScript test
29
- harness once before packing. It uploads a separate same-run `test-harness`
30
- artifact, never inside an npm candidate. Each unprivileged test/OS job checks the
31
- full source commit, complete canonical source inventory, exact LF source hashes
32
- and exact emitted-output hashes before using that harness. Runtime/packaged checks
33
- still import the unchanged candidate's installed JavaScript and execute real npm
34
- shims. The publisher consumes only tested npm tarballs and never the harness.
35
-
36
- All deterministic source tests run once on Linux, partitioned by
37
- `.github/test-groups.json`. Its runner rejects unassigned/duplicate test files.
38
- The CLI does not rerun complete SDK suites. It checks out the exact full client
39
- and server SHAs in its candidate JSON files, builds/installs their tarballs, and
40
- tests the combined package boundary. The SDKs have no dependency on one another;
41
- the server candidate is a CLI integration peer, not a production CLI dependency.
42
- Private cross-repository checkouts require owner-provided read access; no local
43
- untracked sibling directory is assumed.
44
-
45
- Node 24.12.0 is the supported CI baseline on GitHub-hosted ubuntu-latest,
46
- windows-latest and macos-latest. Later Node majors are not separately certified.
47
- The CLI checks unsupported Node 22.17.1 once on Linux. Most JavaScript/type checks
48
- do not need an OS-by-runtime matrix. Packaged OS checks exercise installed shims,
49
- paths/SQLite and the CLI's generic encrypted-backend/lifecycle fixture. They do
50
- not certify a production OS keyring, physical terminal, browser engine or KMS.
51
-
52
- SDK ordinary CI may restore a pnpm cache keyed by its frozen lockfile; installed
53
- dependencies are never shared across OSes. Release-context verification restores
54
- no dependency cache. The unpublished CLI dependency is supplied explicitly as a
55
- tarball; SDK lockfiles and full commit/version pins govern inputs, with exact
56
- TypeScript 5.9.3/@types-node 24.10.0/undici-types 7.16.0 tooling. No privileged
57
- release consumes a pull-request cache, artifact or check-name lookup. Artifacts
58
- are downloaded from this run only, and their manifest digest comes from the
59
- candidate job output. Failure logs retain seven days; candidates retain fourteen.
60
- Expired/missing artifacts require a new complete verification run.
61
-
62
- ## Release workflow and fail-closed gate
63
-
64
- `release.yml` is manual dispatch only. Dispatch an existing owner-approved
65
- `vVERSION` tag, supply the full tagged commit, matching version/tag, and
66
- leave `publish=false` for verification only. A branch dispatch, wrong SHA,
67
- version/tag mismatch, moved tag or missing/changed artifact is rejected. Do not
68
- push a tag merely to test workflow syntax. All actions are pinned to immutable
69
- commits; reusable verification is the same commit as its caller.
70
-
71
- The allowlist is candidate, fast, contracts, integration, packaged-linux,
72
- packaged-windows, packaged-macos and validation. Missing, empty, failed, canceled
73
- and skipped results all fail. The always-running gate has no permission to
74
- publish. The publisher needs the reusable verification workflow to succeed AND
75
- its ready output to be exactly true AND explicit publish selection. It then
76
- rechecks source/commit/ref/version, manifest digest, every tarball, unchanged
77
- packed metadata, private/license policy, npm/toolchain and registry state.
78
-
79
- Only the publishing job requests `id-token: write`. It runs on GitHub-hosted
80
- Linux in protected environment `npm`. There is no publish credential in PR CI,
81
- no workflow_run artifact promotion, no checkout of PR code in a privileged job,
82
- no build/install/pack in the publisher, and no automatic publication on push/tag.
83
- Publication uses `npm publish TESTED_TARBALL --access public --provenance --ignore-scripts`.
84
- It publishes the unchanged bytes downloaded and checked in that job. Publication
85
- is serialized per repository and is never canceled by a newer release run.
86
-
87
- Safe local tests execute the gate with failed/canceled/missing/skipped checks,
88
- wrong commit/version/tag/ref, missing artifact, tampered tarball/manifest and an
89
- absent trusted digest. Registry tests reject an existing version, unauthorized or
90
- uncertain registry responses, unsupported tools and mismatched dependency bytes.
91
- These simulations and actionlint validate code/wiring. They do not prove GitHub
92
- environment settings, npm ownership or OIDC exchange work.
93
-
94
- Any documentation/package-metadata/source change after J6 creates a new candidate.
95
- J6 evidence applies only to J6's recorded commits/digests. Re-run this complete
96
- graph on final commits/tarballs and retain the new manifests/platform results.
97
- Never label changed bytes publishable using old evidence. A passing Windows
98
- local run does not substitute for actual hosted Linux/macOS jobs.
99
-
100
- ## Owner configuration — external, not performed by this repository
101
-
102
- Rechecked against [npm trusted publishers](https://docs.npmjs.com/trusted-publishers/),
103
- [GitHub secure use](https://docs.github.com/en/actions/reference/security/secure-use),
104
- [OIDC](https://docs.github.com/en/actions/concepts/security/openid-connect), and
105
- [deployment environments](https://docs.github.com/en/actions/how-tos/deploy/configure-and-manage-deployments/manage-environments)
106
- on **2026-10-23**. Recheck those live requirements before first publication:
107
-
108
- 1. The owner confirmed the `@poppykit` scope and selected MIT/version 0.1.0.
109
- Confirm the actual publishing account has package-name/maintainer rights and
110
- the chosen version is unused. The complete LICENSE is in the package allowlist
111
- and release notes describe this initial development candidate.
112
- Confirm repository.url exactly matches the actual GitHub repository.
113
- 2. Protect main, release tags, Actions files/scripts and candidate pins with
114
- repository rules and review/CODEOWNERS appropriate to the actual team. Require
115
- the complete verification result for the exact commit. Prevent unreviewed
116
- workflow changes or tag replacement. Read-only PR permissions and trusted
117
- publishing cannot enforce these owner settings themselves.
118
- 3. Create environment `npm` in each package repository with required reviewers,
119
- self-approval restrictions, protected release-tag rules and no admin bypass
120
- where the repository plan supports them. Confirm feature availability; an
121
- unprotected environment name alone provides no approval barrier. Add environment
122
- variable `NPM_PUBLISH_ENABLED=true` only after setup/authorization. Missing
123
- or false configuration fails the publisher's check.
124
- 4. Configure each npm package's trusted publisher for GitHub owner `LMol-4`,
125
- the corresponding `poppykit-client`, `poppykit-server` or `poppykit-cli`
126
- repository, workflow filename **release.yml**, and environment **npm**.
127
- Match spelling/case and the initiating workflow identity. verify.yml is a
128
- reusable verifier, not the publishing workflow. Reassess identity if introducing
129
- a reusable publisher or changing callers; workflow_call/dispatch identity has
130
- documented caller nuances. This setup authorizes a workflow identity, not its
131
- test results. The gate supplies the independent verification condition.
132
- 5. npm currently requires npm >=11.5.1 and Node >=22.14.0 for trusted publishing;
133
- this workflow uses Node24.12.0 and checks npm's version without upgrading it.
134
- GitHub-hosted runners are supported; self-hosted runners are not supported for
135
- this npm path. GitHub permissions must permit OIDC. No NODE_AUTH_TOKEN is set.
136
- Do not silently fall back to a long-lived publish token when OIDC fails.
137
- 6. Verify provenance requirements, repository visibility and package visibility
138
- in the current npm documentation. Trusted publishing generates provenance
139
- automatically for supported public packages/public repositories; explicit
140
- --provenance must not be treated as proof without checking the registry record.
141
- A private-source repository may need an owner-approved alternative or visibility
142
- decision; do not claim provenance supported where it is not.
143
- 7. Current npm publisher configurations require first successful use within two
144
- days or expire; configure near the authorized release. npm supports up to ten
145
- configurations, with separate direct-publish/staging/dist-tag permissions.
146
- Grant only this workflow's required direct publication capability, review other
147
- publishers/tokens and restrict alternative access according to owner policy.
148
- Keep recovery access separate from the normal workflow.
149
-
150
- ## First publication and bootstrap
151
-
152
- A new package may need first publication using authorized npm-owner authentication
153
- before package settings/trusted publishing are available. npm name availability
154
- has not been established by creating a GitHub repository. The owner must confirm
155
- the current bootstrap flow and explicitly authorize it. Do not place bootstrap
156
- tokens in PR workflows or temporarily make publication unconditional.
157
-
158
- Prepare a license/version-ready candidate, run the exact full verification graph,
159
- retain/download the unchanged manifest/tarball and verify its digest. If the first
160
- publication must be manual, an authorized owner uses their own current npm login/
161
- 2FA or narrowly scoped supported bootstrap credential to publish those exact bytes,
162
- then removes temporary credentials and configures the trusted publisher. Record
163
- the resulting version/integrity/provenance. A dry run is not proof of bootstrap
164
- permissions or production OIDC authentication. Current 0.1.0 candidates have public-ready metadata, but publication still
165
- requires all exact-byte checks, owner settings and separate authorization.
166
-
167
- ## Package order, existing versions and partial recovery
168
-
169
- Release by actual production dependencies: client and server are independent;
170
- either SDK can publish first. Publish the client before a CLI version requiring
171
- that exact client version. The CLI registry guard requires the published client's
172
- dist.integrity to match its tested candidate tarball. If it differs, stop and
173
- reconcile/retest the actual dependency; do not silently replace tested bytes.
174
-
175
- Before publishing, npm view must confirm that this package version is absent.
176
- Only a structured E404 is considered absent; auth/network/registry failures stop.
177
- An existing version stops publication even after an uncertain earlier response.
178
- Inspect npm's published version, integrity, provenance and intended dist-tag using
179
- read-only registry commands. Never overwrite or blindly republish. If the exact
180
- bytes already published, record that success and resume the remaining package's
181
- separate verified release. Multi-repository releases are not atomic. Do not unpublish
182
- a successful dependency as rollback. If correction is required, choose a new
183
- version, update dependent pins/lockfiles/release notes and verify a new candidate.
184
-
185
- This runbook does not authorize publication, tag pushes, package ownership changes,
186
- external settings, deployment or demo implementation.
187
-
188
- Candidate metadata is inspected with the archive basename and its directory as
189
- `cwd`. This avoids GNU tar interpreting a Windows drive colon as a remote archive;
190
- stderr is preserved in failure diagnostics. Negative checks exercise GNU tar on
191
- Windows with space/Unicode candidate paths and retain wrong/missing/changed bytes
192
- and fail-closed gate cases. Local success does not certify a future hosted run or
193
- any newly packed bytes.
1
+ # Releasing
2
+
3
+ Use the tagged GitHub Actions workflow, not a local rebuild. Packages are MIT;
4
+ 0.1.0 was manually bootstrapped. Version 0.1.1 refreshes documentation without
5
+ changing runtime APIs. Each new version needs its own source/artifact evidence.
6
+
7
+ ## Before tagging
8
+
9
+ - Confirm npm ownership, unused versions, supported Node 24.12.0 and npm>=11.5.1.
10
+ Keep the pinned compiler/dependencies; do not upgrade tooling during a release.
11
+ - Update version, changelog and shipped docs. CLI's client dependency and both
12
+ candidate JSON files must match exact final SDK versions/full source SHAs.
13
+ - Review the full diff and run typecheck, build, tests and documentation checks.
14
+ Preserve the existing API/storage/security contracts and historical evidence.
15
+ - Protect source, workflow files, pins and release tags with repository review/rules.
16
+ All actions are commit-pinned; release verification never restores a PR cache.
17
+ - Verify GitHub environment **npm**: variable **NPM_PUBLISH_ENABLED=true**,
18
+ intended required reviewer, no admin bypass, and allowed deployment tags **v***.
19
+ Reviewers approve the real pending deployment; automation must not approve for them.
20
+ - Configure the npm package's GitHub trusted publisher: owner **LMol-4**, this
21
+ package repository, workflow **release.yml**, environment **npm**. Match case.
22
+ Enable **direct npm publish** permission; this workflow does not stage a publish.
23
+ Configure near the release: unused configurations expire after two days. Public
24
+ source/package visibility and supported GitHub-hosted runners are required for
25
+ this provenance path. Do not supply NODE_AUTH_TOKEN or fall back to a long-lived
26
+ token if OIDC fails. Confirm current [npm requirements](https://docs.npmjs.com/trusted-publishers/).
27
+
28
+ ## Publish exact tagged source
29
+
30
+ Client and server are independent. Publish client before CLI: the CLI registry
31
+ guard requires its tested client tarball integrity to equal the published one.
32
+
33
+ 1. Merge reviewed source to main. Record the full SHA and create/push an approved
34
+ immutable **vVERSION** tag at that exact commit. Never move or replace a tag.
35
+
36
+ ```sh
37
+ git tag vVERSION FULL_SHA
38
+ git push origin refs/tags/vVERSION
39
+ ```
40
+ 2. Dispatch **Release** from that tag, with matching version, tag and full commit.
41
+ Optional `publish=false` rehearses verification only. A later publishing dispatch
42
+ is a new run with newly identified artifacts; it does not reuse a rehearsal's bytes.
43
+ 3. Dispatch with `publish=true` when authorized. Example (replace all placeholders):
44
+
45
+ ```sh
46
+ gh workflow run release.yml --repo LMol-4/PACKAGE --ref vVERSION -f version=VERSION -f tag=vVERSION -f commit=FULL_SHA -f publish=true
47
+ ```
48
+
49
+ 4. Wait for candidate, fast, contracts, integration, packaged-linux/windows/macos,
50
+ validation and gate to succeed. Missing, failed, canceled or skipped prerequisites
51
+ fail closed. Then follow the Actions environment-approval link. Do not bypass it.
52
+ 5. The publisher rechecks source/tag/ref/version, trusted manifest digest, unchanged
53
+ tarball metadata/bytes, owner enablement, registry absence and dependency integrity.
54
+ It publishes the same-run tested tarball with `--access public --provenance
55
+ --ignore-scripts`; it never installs, builds or packs again.
56
+ 6. Save run URL, full source SHAs, manifest SHA256, filenames, versions, byte counts,
57
+ tarball SHA256/npm SHA512 and registry integrity/provenance. Download before the
58
+ 14-day candidate retention expires. Verify registry bytes, a clean exact-version
59
+ registry install, exported modules and the real npm CLI shim.
60
+
61
+ Ordinary main/tag CI is useful evidence but is not a tagged Release/OIDC publishing
62
+ run. A dry run or green tests alone do not prove npm authentication or provenance.
63
+ The separate checked test-harness artifact is source/output-hash bound, used only
64
+ by unprivileged verification jobs, and never published in an npm package.
65
+
66
+ ## Failure and partial release
67
+
68
+ Stop on tag/source/version/digest mismatch, unknown registry responses or changed
69
+ client integrity. Do not weaken gates, repack approved bytes, change pins silently,
70
+ force an overwrite or use a token fallback. Inspect the failed job and preserve logs.
71
+ For OIDC/auth failure check publisher spelling/case, workflow/environment identity,
72
+ expiry, reviewer approval, permissions and npm/toolchain support before a new run.
73
+
74
+ If a version already exists, compare its registry integrity and provenance with the
75
+ saved receipt. Matching successful publication is recorded, never republished.
76
+ For partial publication, finish only absent packages; verify the published client's
77
+ exact bytes before CLI. If bytes differ or a fix is needed, use a reviewed new
78
+ version and complete verification. A source checkout rollback cannot undo an npm
79
+ publication or external side effect. Deprecation, dist-tag changes, unpublish and
80
+ replacement versions need separate owner authorization; never delete evidence.
81
+
82
+ ## Verification limits
83
+
84
+ Deterministic source suites run once per verification graph on Linux; exhaustive
85
+ file groups reject omissions/duplicates. Packaged jobs test actual installed JS,
86
+ exports/declarations/content/SQLite and representative platform behavior; CLI also
87
+ tests real shims, auth/retry processes and API/browser/feedback wiring. They do not
88
+ certify a production keyring, physical terminal, browser engine, KMS or TLS deployment.
89
+ Windows GNU tar is given archive basename plus directory cwd to avoid drive-colon
90
+ remote parsing. Failure logs retain seven days. Expired/missing artifacts require a
91
+ new full run, not relabeling old results. See [CONTRIBUTING.md](CONTRIBUTING.md).
package/SECURITY.md CHANGED
@@ -4,10 +4,10 @@ Do not put credentials, tokens, private keys, personal records or exploit detail
4
4
  in a public issue. Use this repository's GitHub **Security → Report a vulnerability**
5
5
  when private reporting is enabled. If it is unavailable, request a private contact
6
6
  from the repository owner without disclosing the vulnerability publicly. The owner
7
- must enable/confirm that route before public release; no response SLA is promised.
7
+ must enable/confirm that route; no response SLA is promised.
8
8
 
9
9
  Include affected commit/version, a minimal reproduction using synthetic data,
10
- impact and the trust boundary involved. These unpublished draft packages have no
11
- released-version support window yet. Custom vaults, issuers, browser controllers,
10
+ impact and the trust boundary involved. These draft packages have no promised
11
+ support window or response SLA. Custom vaults, issuers, browser controllers,
12
12
  proxy routing and deployment policy remain operator responsibilities. Redaction
13
13
  and scoped authority do not isolate an unrestricted same-user program.
package/STORAGE.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Company persistence and authorization
2
2
 
3
- J1 replaces whole-state storage on request paths with domain selections. This is a
4
- breaking adapter change in an unpublished package. Node 24.12.0 or later is required.
3
+ Request paths use targeted domain selections, not whole-state rewrites. Node 24.12.0 or later is required.
5
4
  The optional `@poppykit/server/sqlite` entry point exports `SqliteCompanyDatabase`.
6
5
  The core and reference issuer entry points do not import SQLite. Consumers can
7
6
  implement `ConversationStore`, `IssuerStore` and `AuthorityCoordinator` themselves.
@@ -46,10 +45,8 @@ still apply inside the SDK; a namespace name alone is not authentication.
46
45
  Conversation selections resolve an ID, message receipt, work ID, or next eligible
47
46
  claim. Reads include the related parent/Direct Conversation binding group, not
48
47
  unrelated conversations. A worker query selects the oldest eligible message for a
49
- conversation; publication rechecks lease and fence. Event delivery currently reads
50
- the selected conversation group's retained events. J3 owns bounded page queries,
51
- notification-backed waits, streaming and retention; this does not claim those jobs
52
- are complete. `ConversationNotifications` defines subscribe/unsubscribe/publish:
48
+ conversation; publication rechecks lease and fence. Cursor-relative event selectors bound delivery reads without loading work/history
49
+ aggregates. `ConversationNotifications` defines subscribe/unsubscribe/publish:
53
50
  subscribe before reading, treat wakes as hints, and always reconcile durable state
54
51
  after a wake or bounded timeout. Publishing after commit is best-effort, not an outbox.
55
52
 
@@ -75,8 +72,8 @@ an uncertain result for reconciliation. Never claim universal exactly-once execu
75
72
 
76
73
  `cleanup(namespace, now, limit)` bounds deletion to at most 1000 expired short-lived
77
74
  codes, authorizations, access tokens or replay entries. It does not delete grants,
78
- work intent, message receipts or conversation events. J3 must preserve receipt
79
- identity through retention for the conversation lifetime. Finished work pruning is
75
+ work intent, message receipts or conversation events. Receipt identity remains
76
+ through retention for the conversation lifetime. Finished work pruning is
80
77
  per selected conversation binding group; unrelated conversation growth cannot
81
78
  force another conversation's receipts out of storage.
82
79
 
@@ -92,12 +89,8 @@ development reset, stop all processes, resolve uncertain external effects, and
92
89
  explicitly move aside the database and WAL/SHM files. Reopen a fresh database to
93
90
  obtain new generations. Never reset a live database behind active processes.
94
91
 
95
- `tests/storage.test.mts` exercises real child-process contention and termination
96
- before commit, after acceptance, and after a synthetic external side effect. It
97
- also checks publication fencing/deduplication, detached values, rollback, account
98
- token rotation versus revocation, namespace isolation, and unchanged read counts
99
- after adding unrelated conversations. These are local Windows/Node results;
100
- other OS runner evidence belongs to J5/J6.
92
+ Contract tests cover real process contention/death, publication fences, rotation/
93
+ revocation, rollback, isolation and targeted read counts; see [contributing](CONTRIBUTING.md).
101
94
 
102
95
  ## Bounded conversation delivery and retention
103
96
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poppykit/server",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
5
  "description": "Personal Agent Protocol company SDK",
6
6
  "repository": {