Skip to content

refactor(path): branded POSIX paths + absolute non-root store paths (5/5 of #66) - #78

Closed
ofriw wants to merge 5 commits into
pr/66-jsonlog-workerfrom
pr/66-path-branding
Closed

ofriw wants to merge 5 commits into
pr/66-jsonlog-workerfrom
pr/66-path-branding

Conversation

@ofriw

@ofriw ofriw commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Part 5 of the #66 split: branded POSIX paths, plus the store-path guard that the branding requires.

Base is pr/66-stack-base, a scratch integration branch holding #74 + #75 + #76 + #77. Retarget this PR to main once those four land. The base branch exists only so this PR can be reviewed and tested as one unit; it is not meant to be merged.

What changed

Paths are branded. path.parsePath() returns a PosixPath; the brand is carried through FileImpl, the json-log worker protocol, the runtime adapters, the CLI and db/db.ts. Normalization happens once, at ingress, instead of at every call site.

Containment is structural. path.isWithin(parent, child) replaces startsWith checks. startsWith matched sibling prefixes (/data/foo vs /data/foobar) and mixed separators.

Store path must be absolute and non-root. '' normalizes to '.' and '/'/'C:/' pass isAbsolute, but logout() recursively removes _basePath. Both are rejected at DBInstanceConfig construction (and by Server), with the normalized contract carried in the type.

CLI tests are contract tests. Registry-flow tests were replaced by checkout and path-guard tests: the CLI runs as a user would run it, and assertions target generated files and resolved modules instead of internal registry calls. cli-path-normalization, path-boundaries, path-property and no-registry-dependency cover the new contracts; deno task test:paths runs the path suites.

Compile-path fixes. The compile test resolves the vendor root without Deno.realPath, and the CLI project root is derived from the deno info graph roots.

Verification

Notes

  • docs, README.md, AGENTS.md and the example READMEs from the original branch are intentionally not included.
  • The 009c48de store-path guard ("F" in the original plan) is folded in here: the branded _basePath is what makes this branch type-check.

Stack position

Top layer of GitHub stack #80 (main ← #74 ← #75 ← #76 ← #77 ← #78).

ofriw added 5 commits October 27, 2026 14:51
Store roots are now branded POSIX paths at ingress. An empty or root path
normalizes to '.' or a root, both of which logout() would delete recursively,
so reject them at construction and carry the normalized contract in the type.

Required by the path-branding work: before this, db.ts kept unbranded strings
and the branded FileImpl contract did not type-check.
@ofriw
ofriw force-pushed the pr/66-jsonlog-worker branch from cbb6d13 to 42cd69f Compare October 27, 2026 12:53
@ofriw
ofriw force-pushed the pr/66-path-branding branch from 56e3841 to 23d6c6d Compare October 27, 2026 12:53
@ofriw

ofriw commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by the reviewed, fully verified replacement stack: https://github.com/goatplatform/goatdb/stack/92

Each complete replacement tip passed full Deno + Node + browser suites on current Deno2.9.1 and actual floor2.3.3, with Node24.14.1 and Playwright1.64.1. Exact tip hashes, scope, dependencies, gates and breaking/data notices are in the new PR bodies. Final tip9e9a759f has 0 failures on all six full runs; the 49-source-commit content audit and independent review passed. Remote Actions status is separate from these measured local gates.

Review bottom-up. This replaces the old split, not just its last diff. No PR was merged, no issue was edited, and original remote branches are retained.

@ofriw ofriw closed this Oct 29, 2026
@ofriw
ofriw removed this pull request from stack #80 October 29, 2026 15:14
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