Skip to content

fix: plain clone works fully + Deno container (Refs affinescript#122)#32

Closed
hyperpolymath wants to merge 3 commits into
mainfrom
fix/deno-clone-and-container
Closed

fix: plain clone works fully + Deno container (Refs affinescript#122)#32
hyperpolymath wants to merge 3 commits into
mainfrom
fix/deno-clone-and-container

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Make a plain clone work fully + Deno container (Refs affinescript#122, #126; ubicity#30)

Follow-up to #31. After the .ts elimination the repo did not run from
a clean clone. This makes it work end-to-end, including containerised.

Fixes

  1. src/storage.js regenerated with the fixed async-IIFE backend
    (affinescript#126). The version merged in Eliminate all src/*.ts (Closes #30; Refs affinescript#122) #31 was generated before
    that fix, so loadAllExperiences was a SyntaxError
    (await inside a non-async IIFE).
  2. deno.json: exports./src/index.js; added
    "nodeModulesDir": "auto" (npm:zod had no resolution); every task /
    glob .ts entrypoint (cli/capture/visualize/index) → .js
    (they were deleted in Eliminate all src/*.ts (Closes #30; Refs affinescript#122) #31).
  3. node: prefix on all bare node-builtin imports deno rejects:
    export/import (fs), capture (process, readline/promises),
    mapper/privacy (crypto), performance (perf_hooks).
  4. .tool-versions: pin deno 2.7.14 (matches CI setup-deno
    and flake.nix) so an asdf/mise clone provisions deno.
  5. Containerfile rewritten on denoland/deno:2.7.14 (was a stale
    Node image that cannot run this Deno project); .dockerignore
    keeps tests/ so the image can run the suite; docker-compose.yml
    names Containerfile explicitly so docker compose (not just
    podman) finds it.

Verification

  • Local: deno task test44 passed / 0 failed.
  • Containerised: docker build -f Containerfile -t ubicity . → builds
    clean; docker run --rm ubicity test --allow-read --allow-write tests/44 passed / 0 failed; default CMD (CLI help) works.
  • A plain git clone now works fully via: host deno (.tool-versions
    / flake.nix both provide 2.7.14) or the container.

flake.nix already provided deno (unchanged). storage.affine remains
the source of truth for storage.js (affinescript#122 showcase).

Refs hyperpolymath/affinescript#122 #126, ubicity#30.

🤖 Generated with Claude Code

hyperpolymath and others added 3 commits May 16, 2026 16:02
rsr-antipattern forbids `.ts` in src/ (src/ is not allowlisted). All
four src/*.ts removed:

- **storage.ts → storage.affine → storage.js** (the AffineScript
  showcase for affinescript#122's Deno-ESM backend). storage.affine is
  the source of truth; storage.js is generated, drop-in, dependency-free
  ESM — exact surface `export class ExperienceStorage` (constructor +
  9 async methods) consumed by index.js / mapper.js / privacy.js /
  visualize.js. Self-contained extern decls lowered by the backend
  (Deno.*Sync / JSON.* / object indexing); real AffineScript helpers
  (has_json_ext / drop_json_ext); try/catch; orDefault preserves the
  `new ExperienceStorage()` default; kbString for the KB display.
  Regenerate: `affinescript compile src/storage.affine -o src/storage.js
  --deno-esm`.
- **observability.ts / rescript-bridge.ts / wasm-bridge.ts → .js**:
  faithful plain-ESM type-strips. These are pure JS-runtime /
  ReScript-interop / WebAssembly-runtime glue (no algorithm; wasm-bridge
  has no importers in src|tests). AffineScript is the wrong tool for
  them and porting rescript-bridge would re-implement a ReScript bridge
  against the estate ReScript-hands-off rule; type-stripping keeps
  behaviour byte-identical and the boundary intact.

Consumers already import `./storage.js` etc. (no `.ts` specifiers) — no
call-site changes needed.

Verification: the AffineScript toolchain (affinescript#123 + the
follow-up polymorphic-len/show fix, affinescript#125) compiles
storage.affine cleanly to the exact expected class surface; affinescript
`dune runtest` + the Deno-ESM harness suite are green. `deno task test`
is left to ubicity CI (no usable local deno in the dev env).

Closes #30.
Refs hyperpolymath/affinescript#122, #123, #125.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
…t#122, ubicity#30)

Follow-up to #31. After the .ts elimination the repo did not run from a
clean clone: (1) src/storage.js was generated before the async-IIFE
codegen fix (affinescript#126) so it was a SyntaxError; (2) deno.json
declared npm:zod with no nodeModulesDir; (3) src/{export,import,capture,
mapper,privacy}.js used bare node-builtin specifiers deno rejects;
(4) deno.json tasks + exports still pointed at deleted .ts entrypoints;
(5) .tool-versions had no deno; (6) Containerfile was a stale Node
image that cannot run this Deno project.

- Regenerated src/storage.js with the fixed (async-IIFE) backend.
- deno.json: exports->index.js, nodeModulesDir auto, all task/glob
  .ts entrypoints -> .js.
- node: prefix on the 5 bare builtin imports.
- .tool-versions: pin deno 2.7.14 (matches CI / flake.nix).
- Containerfile + docker-compose rewritten on denoland/deno:2.7.14;
  .dockerignore keeps tests/ so the image can run the suite.

deno task test: 44 passed / 0 failed locally. Container build + in-
container suite verified (see PR thread).

Refs hyperpolymath/affinescript#122 #126, ubicity#30.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Caught by the in-container deno cache (whole graph from index.js,
stricter than deno test which only loads test-reached modules):
src/capture.js readline/promises and src/performance.js perf_hooks
still lacked the node: prefix. docker-compose build now names
Containerfile explicitly so docker (not just podman) finds it.

Verified: docker build -f Containerfile -> clean; in-container
deno test = 44 passed / 0 failed; default CMD (CLI help) works.
@hyperpolymath
Copy link
Copy Markdown
Owner Author

Superseded by a clean single-commit branch (stale branch history made #32 un-mergeable though the content applies cleanly to main).

@hyperpolymath hyperpolymath deleted the fix/deno-clone-and-container branch May 16, 2026 15:43
hyperpolymath added a commit that referenced this pull request May 19, 2026
…#51)

#3 isolated pass (pilot #32-shape). Scaffold-placeholder leak per
`standards/LICENCE-POLICY.adoc` **A5** — NOT relicensing. ->
`PMPL-1.0-or-later`. **3 file(s).** Isolated mode (if dirty) stages ONLY
placeholder lines; repo WIP untouched. Gates: per-file clean check,
diff-shape asserted, auto-revert on anomaly. 🤖 Generated with [Claude
Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant