Skip to content

TASK-0002 Sub-Store engine spike - #5

Draft
lr00rl wants to merge 5 commits into
integrationfrom
feat/hephaestus-task0002-substore-engine-spike
Draft

TASK-0002 Sub-Store engine spike#5
lr00rl wants to merge 5 commits into
integrationfrom
feat/hephaestus-task0002-substore-engine-spike

Conversation

@lr00rl

@lr00rl lr00rl commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Scope

TASK-0002 Phase 1 spike for embedding Sub-Store core in the Go backend:

  • Adds a reproducible harness under tools/substore-engine-spike/ for goja and QuickJS-on-wazero comparisons.
  • Merges origin/main into the task branch so the branch includes the published design-15 Sub-Store baseline that integration was missing.
  • Keeps the design-15 conformance probe side-effect free after no-arg endpoint methods were added upstream of integration.

Spike Result

  • goja: modern syntax probes pass, but loading the Sub-Store proxy-utils IIFE panics inside goja before parse/produce are available.
  • qjs/wazero: loads ProxyUtils.parse and ProxyUtils.produce with only a console shim; representative conversions pass.
  • Current concern: a 5000-node sing-box conversion emits about 1.2 MiB, exceeding the backend's current 1 MiB stdout cap.

Validation

  • system-go: go test -race -cover ./... -> PASS, 74.3% coverage.
  • tools/pluginpack: go test -race -cover ./... -> PASS, 71.2% package coverage.
  • tools/substore-engine-spike: go test -race -cover ./... -> PASS.
  • ui: npm ci && npm test && npm run typecheck && npm run build && npm run verify:build -> PASS.

Olympus

Full Phase 1 findings were sent by letter to Zeus:

  • lattice-olympus/messages/inbox/zeus/20260726-0757Z-hephaestus-task0002-engine-spike.md

Awaiting Zeus's design §4 engine ruling before Phase 2 implementation.

lr00rl and others added 4 commits July 22, 2026 21:31
The plugin stores one atomic endpoint document, reports vault and autosync failures, serializes dirty follow-up syncs, and strips secret-bearing response text. The alpha manifest is signed against a deterministic bundle.\n\nConstraint: Endpoint changes and autosync outcomes must remain observable without leaking credentials.\nRejected: Independent secret keys | permits torn endpoint and autosync state\nConfidence: high\nScope-risk: moderate\nDirective: Preserve atomic endpoint writes and explicit degraded status semantics.\nTested: UI tests/typecheck, Go race/vet, deterministic bundle, server-parity signature verification, GitHub CI\nNot-tested: Live Sub-Store service pending canary
Keep the Phase 1 engine comparison reproducible without touching production plugin runtime code. The harness measures goja and QuickJS-on-wazero against an externally built upstream ProxyUtils bundle, then emits JSON for the Olympus spike letter.

Constraint: Phase 1 allows spike work under tools only; production Sub-Store embedding still waits on zeus's §4 ruling

Constraint: Upstream Sub-Store source and generated bundles are not vendored in this commit

Rejected: Commit a generated 1.2 MiB upstream bundle | the Phase 1 artifact should pin and report it without bringing generated upstream bytes into this repo

Confidence: high

Scope-risk: narrow

Directive: Do not treat this tool module as the production engine dependency decision; it is measurement evidence for the ruling

Tested: go test -race ./... in tools/substore-engine-spike

Tested: go test -race ./... in system-go

Tested: go test -race ./... in tools/pluginpack

Tested: go run ./cmd/spike -bundle /tmp/hephaestus-substore-proxy-utils.iife.js -iterations 5 -json

Not-tested: Linux runtime execution inside lattice-server plugin host
Absorb the published Sub-Store design-15 baseline before continuing TASK-0002 because integration was cut behind main. The only conflict was manifest.json; it was resolved byte-identical to origin/main to preserve the signed manifest.

Constraint: Zeus letter 20260726-0736Z instructed already-cut TASK-0002 branches to merge origin/main before building against the pre-design-15 surface

Constraint: Hephaestus did not alter manifest signature fields; conflict resolution kept origin/main signed content

Confidence: high

Scope-risk: moderate

Directive: Do not rebase this branch after it is pushed; future integration reconciliation should merge, not cherry-pick

Tested: git diff --check

Tested: manifest.json byte-identical to origin/main after conflict resolution

Not-tested: Full post-merge repo test suite not rerun yet
Design-15 added no-argument runtime methods that legitimately touch the secret host API. The conformance test still verifies that every manifest-declared runtime method is recognised by the artifact, but its host stub now denies brokered calls instead of failing the test before method recognition can be observed.

Constraint: Merged origin/main introduced endpoint_status and clear_endpoint, which cannot be probed with an empty payload without reaching the host path

Rejected: Remove the manifest conformance test | it is still the gate that prevents declared runtime methods from drifting away from the artifact

Rejected: Require fake payload fields for no-argument methods | that would change UI-facing method semantics just to satisfy a probe

Confidence: high

Scope-risk: narrow

Directive: Future no-argument runtime methods must keep this probe host fake; do not let conformance reach a real broker

Tested: go test -race -cover ./... in system-go (74.3% coverage)

Not-tested: Full UI suite after merging origin/main
lr00rl added a commit to LatticeNet/lattice-olympus that referenced this pull request Jul 26, 2026
Record the draft PR URL so the Phase 1 spike has a durable diff surface before Phase 2 waits on the engine ruling.

Constraint: Olympus requires draft PRs targeting integration for task branches
Confidence: high
Scope-risk: narrow
Tested: gh pr create returned LatticeNet/lattice-plugin-sub-store#5
Not-tested: No merge attempted; Phase 2 still gated on zeus ruling
The qjs/wazero path is viable but the server stdout cap is the next Phase 2 risk, so the spike harness needs repeatable sweep cases instead of ad hoc edits.

Constraint: Phase 2 still waits on the Olympus engine ruling; this remains spike-only tooling
Rejected: Hard-code more representative cases | the cap boundary should be adjustable without another code edit
Confidence: high
Scope-risk: narrow
Tested: go test -race -cover ./... in tools/substore-engine-spike; qjs sweep showed 4306 synthetic sing-box nodes at 1,048,553 bytes and 4307 at 1,048,762 bytes
Not-tested: Production engine integration not attempted pending ruling
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