Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Commits — Wave 2b Data Adapters

Append every implementation commit immediately after it is created.

- 5774c18: feat(kv): align data adapter package quality
- 8cab1d7: feat(database): align data adapter package quality
- 9ceb9c7: feat(prisma-adapter-mysql): align package quality gates
- f9d0958: fix(database): annotate jsonUtils for isolated declarations; record wave2b IMPL-EVAL PASS (IMPL-EVAL in-scope fix)
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Context Pack — Wave 2b Data Adapters

Run ID: `feat-package-quality-wave2-adapters-2b--data` Branch:
`feat/package-quality-wave2-adapters-2b` Role: GENERATOR only. Do not treat this file as an
IMPL-EVAL.

## Scope

Implemented locked Wave 2b data-adapter slices for:

- `packages/kv`
- `packages/database`
- `packages/prisma-adapter-mysql`

Out of scope and not intentionally changed:

- Wave 2a units: logger, telemetry, aspire
- Wave 2c units: queue, cron
- S2/S3 CI, versioning, publishing, OIDC, and umbrella merge-readiness

## Implementation Commits

- `5774c18`: `feat(kv): align data adapter package quality`
- `8cab1d7`: `feat(database): align data adapter package quality`
- `9ceb9c7`: `feat(prisma-adapter-mysql): align package quality gates`

## Key Decisions

- `@netscript/kv`: consolidated bridge-role files under `adapters/`, renamed shared orchestration to
`application/`, added `./testing`, docs, README, and package gates while preserving existing
public runtime subpaths.
- `@netscript/database`: renamed `interfaces/` to `ports/` with no compatibility alias, added
`./testing`, package metadata, docs, README, adapter-contract tests, and explicit public types to
remove slow-type output.
- `@netscript/database`: removed the root `PrismaPg` re-export because `deno doc --lint` followed
upstream private/undocumented types and internal package/plugin consumer search found no consumers
of that re-export.
- `@netscript/prisma-adapter-mysql`: removed `skipLibCheck`, added package-root `mod.ts`, docs,
README, tests, publish excludes for examples/tests, and narrowed the root public surface to
package-owned adapter/factory/capability types.
- Runtime `console.*` was removed from touched package source surfaces; example scripts may still
use console and are excluded from publish where relevant.

## Gate Evidence

- KV: package check PASS, all export doc-lint PASS, docs fixture test PASS, publish dry-run PASS
with 0 slow types, scoped fmt/lint PASS.
- Database: package check PASS, all export doc-lint PASS with upstream npm type-resolution warnings
only, adapter/docs tests PASS, publish dry-run PASS with 0 slow types, scoped fmt/lint PASS.
- Prisma MySQL: package check PASS, root doc-lint PASS, tests PASS, publish dry-run PASS with 0 slow
types, scoped fmt/lint PASS.
- Consumer gate: CLI, sagas, streams, triggers, and workers package/plugin checks PASS.
- Scoped doctrine checks: `packages/kv`, `packages/database`, and `packages/prisma-adapter-mysql`
all exit 0 with FAIL=0.

## Residuals For Evaluator

- Repo-wide `rtk proxy deno task arch:check` failed with 57 FAIL / 89 WARN / 1 INFO on out-of-scope
existing doctrine debt. See `drift.md`.
- Scoped doctrine still reports WARN-only residuals in target packages: large files, existing `any`
in Kvdex exported declarations, database script `Deno.exit`, database default export, and Prisma
MySQL adapter file size.
- No generator-side IMPL-EVAL was run. A separate evaluator session must decide PASS/FAIL for Wave
2b.

## IMPL-EVAL Outcome (separate evaluator session, 2026-06-07)

- Verdict: **PASS** — see `evaluate.md`.
- One in-scope fix applied (`f9d0958`): `@netscript/database` `jsonUtils` slow-type/doc-lint
annotation in `extensions/sql-json.extension.ts`. All target-package gates re-verified green.
- Out-of-scope caveat: `packages/cli` and `plugins/streams` `check` fail on pre-existing
isolated-declarations debt (untouched by 2b, identical on base `e5d54e2`); recorded in `drift.md`.
14 changes: 14 additions & 0 deletions .llm/tmp/run/feat-package-quality-wave2-adapters-2b--data/drift.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Drift — Wave 2b Data Adapters

Append any divergence from `.llm/tmp/run/feat-package-quality-wave2-adapters--adapters/plan.md`, the
nested per-unit authority, or doctrine.

| Date | Severity | Item | Evidence | Action |
| ---------- | -------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| 2026-06-07 | note | `aspire` skill unavailable in this session | Available skill list and tool discovery did not expose an Aspire-specific skill. | Treat Aspire package work as already completed in 2a and out of scope for 2b. |
| 2026-06-07 | note | Removed root `PrismaPg` re-export from `@netscript/database` | `deno doc --lint` followed the upstream `@prisma/adapter-pg` class and failed on private/undocumented upstream types; internal consumer search found CLI templates import `@prisma/adapter-pg` directly and no package/plugin imports the database root re-export. | Keep package-owned structural driver adapter return types and do not expose upstream Prisma adapter classes from the root package. |
| 2026-06-07 | note | Narrowed `@netscript/prisma-adapter-mysql` root exports to package-owned adapter surface | `deno doc --lint` failed when root exports exposed conversion/error helpers and the connected implementation class because their signatures referenced private Prisma driver utility types. Internal consumer search found no package/plugin consumers of those helper exports. | Keep conversion/error helpers internal; root exports the factory, capability helper, and package-owned public adapter/config types. |
| 2026-06-07 | note | Repo-wide `arch:check` is not green at the 2b Gate | `rtk proxy deno task arch:check` reported 57 FAIL / 89 WARN / 1 INFO, dominated by out-of-scope CLI/plugin debt. Target-package scoped doctrine checks for `packages/kv`, `packages/database`, and `packages/prisma-adapter-mysql` exit 0 with FAIL=0. | Stop at the generator Gate per instruction; hand the branch to separate IMPL-EVAL with scoped evidence and the repo-wide caveat. |
| 2026-06-07 | significant | IMPL-EVAL found `@netscript/database` failing `check`/`publish:dry-run` (deno 2.8.2) | `extensions/sql-json.extension.ts:572` `export const jsonUtils = { ...shorthand }` raised 7 TS9016/TS9027 isolated-declaration (slow-type) errors; generator slice 11 only fixed the `:286` return type and missed this object. | IMPL-EVAL applied a single-file fix: explicit object type annotation on `jsonUtils` using inline function signatures (public types only) — passes both isolated-declarations and `private-type-ref` doc-lint. Re-verified: check/doc-lint/publish/test/fmt all PASS. |
| 2026-06-07 | note | Consumer checks `packages/cli` and `plugins/streams` FAIL at IMPL-EVAL | `cli` TS9016 on `src/maintainer/features/sync/plugin/copy-official-plugin.ts:205` `_internal`; `streams` TS9007 on `src/e2e/probes/probe-context.ts` `probePayloadSchema`. Both files are untouched by 2b and fail identically on base `e5d54e2`. | Pre-existing isolated-declarations debt, out of 2b scope. Not blocking the 2b verdict; same class as the repo-wide `arch:check` residual. |
| 2026-06-07 | note | Migration spike: `npm:ioredis@^5` → `jsr:@db/redis` (denodrivers/redis) assessed | Per-PR request. ioredis footprint spans `packages/kv` (RedisKvAdapter: get/set/psetex/del/exists/mget/scan/watch+unwatch/multi+exec/publish+EventEmitter pub-sub/tls), `packages/queue` (zadd/lpush/brpoplpush-blocking/zrangebyscore/zrem/lrem, dual command+blocking clients), `packages/plugin-sagas-core` (Streams: xadd/xgroup/xreadgroup/xack/xpending/xclaim + `.duplicate()`), plus a dynamic-import isolation in `packages/sdk` and `npm:ioredis@^5` scaffolding constants in `packages/cli/src/kernel/constants/windows.ts`. `@db/redis` v0.41.2 (2026-05, Deno-native, JSR-published, no-slow-types) covers every command we use incl. Streams consumer-groups, WATCH/MULTI/EXEC, blocking lists, sorted sets, EVAL. Net benefits beyond size: Deno-native (no `npm:`/node-compat in publish graph → aligns with Wave 2 JSR package-quality north star), first-class JSR types (no `@types/ioredis`, isolated-declaration friendly), and async-iterator pub/sub that matches our existing `AsyncIterable` `watch()` surface (drops the EventEmitter→iterator bridge). Coverage caveats: no `.duplicate()` (use 2nd `connect()`), no Sentinel (#428 — n/a if we stay single-instance Garnet/Redis), no `defineCommand` (unused), async-iterator pub/sub requires rewriting `.on('message')` handlers, `scan` cursor number-in/string-out (#391), blocking `xread`/`xreadgroup` returns `null` on timeout and must be guarded (#333, open), and single-connection command serialization (#412) — mitigated by our existing MGET batching + queue's separate blocking client, but hot paths may need `pipeline()`. | Recommend a **dedicated future migration track (NOT 2b/Wave 2)**, gated behind a spike: (1) port `kv` first (smallest, async-iterator-aligned) behind the `./testing` port-contract entrypoint; (2) validate xread null-timeout + concurrency against Garnet; (3) confirm no Sentinel dependency; (4) then `queue`, then `sagas-core` Streams; (5) update `cli` scaffolding import maps. Out of 2b scope — recorded as a forward-looking opportunity, not a 2b blocker. Full deep-dive posted as PR comment reply to #4642929057. |
Loading