Skip to content

TASK-0013: document the dev plugin loop - #7

Merged
lr00rl merged 6 commits into
integrationfrom
feat/hephaestus-task0013-dev-plugin-loop
Jul 31, 2026
Merged

TASK-0013: document the dev plugin loop#7
lr00rl merged 6 commits into
integrationfrom
feat/hephaestus-task0013-dev-plugin-loop

Conversation

@lr00rl

@lr00rl lr00rl commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary\n- add Make targets for dev-key, dev-bundle, and dev-plugin\n- keep .lattice-dev/ ignored for local seed, trust file, bundle, and dev manifest\n- document dev publisher workflow without mutating checked-in manifest.json\n\n## Verification\n- make -n dev-key dev-plugin\n- make -n DEVPLUGIN='go run ../lattice-server/tools/devplugin' dev-key dev-plugin\n- test ! -e .lattice-dev\n- git diff --check\n- cd system-go && go test -race ./...\n- cd tools/pluginpack && go test -race ./...\n- cd ui && npm ci && npm test && npm run typecheck && npm run build && npm run verify:build\n\nOlympus: TASK-0013. Zeus ack required before merge.

Template users need an ergonomic way to build local dev bundles without mutating the release manifest or committing local trust material. This adds Make targets that generate only gitignored files and documents how the dev publisher/trust file maps to server verification.

Constraint: TASK-0011 Decision 5 allows plugin docs, Makefile-style tooling, and a gitignored local trust file path, with no key material committed.

Rejected: Commit a sample trust file | even placeholder-shaped trust files invite copy-forward into real server config; the tool generates the local file instead.

Rejected: Overwrite manifest.json during dev signing | would put dev publisher/signature fields in a tracked release manifest.

Confidence: high

Scope-risk: narrow

Directive: Keep .lattice-dev/ gitignored; generated seed, trust file, dev manifest, and local bundle must stay out of git.

Tested: make -n dev-key dev-plugin; make -n DEVPLUGIN='go run ../lattice-server/tools/devplugin' dev-key dev-plugin; test ! -e .lattice-dev; git diff --check; (cd system-go && go test -race ./...); (cd tools/pluginpack && go test -race ./...).

Not-tested: Did not run make dev-key or make dev-plugin for real because that would create local key material and dev signatures.
@lr00rl

lr00rl commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Zeus signing/trust gate r1: request changes on head 384ca69. Scope and dry-run checks are green, but two HIGH blockers remain.

  1. DEVPLUGIN executes mutable remote @integration code for key generation/signing. Today it resolves to server 7e57b85, which does not even contain the reviewed tool; later it can resolve to different code with seed-path access. Merge the server slice first, then pin the exact reviewed server pseudo-version or an approved immutable prerelease.
  2. DEV_BUNDLE_ROOT is overrideable and goes directly to rm -rf. Repro: make -n DEV_BUNDLE_ROOT=system-go dev-bundle starts with rm -rf "system-go", targeting tracked source. Eliminate caller-controlled recursive deletion or enforce/test that the canonical target is a non-root descendant of .lattice-dev/.

Positive evidence: template verify CI is green; Make dry-run, ignore assertions, allowed-path audit, and no-key-material scan pass. Formal Olympus r1 record: 20260731-1104Z-zeus-task0013-r1-request-changes.md. Reissue r2 on the same branch; no merge before Zeus [ack].

Zeus's r1 review found the template default ran mutable branch code and let caller-controlled paths reach rm -rf. The dev loop now pins the server helper to the reviewed commit and stages bundles in a mktemp directory under .lattice-dev so caller overrides cannot delete tracked source.

Constraint: TASK-0013 must keep generated seed, trust, bundle, and dev manifest local and gitignored.

Rejected: Use @integration for convenience | branch movement would change the code that receives a seed path.

Rejected: Keep DEV_BUNDLE_ROOT override | it made recursive deletion caller-controlled.

Confidence: high

Scope-risk: narrow

Directive: Update DEVPLUGIN only to immutable reviewed commits or approved immutable prereleases.

Tested: make -n dev-key dev-bundle dev-plugin; make -n DEV_BUNDLE_ROOT=system-go dev-bundle with no rm -rf system-go; test ! -e .lattice-dev; git diff --check.

Not-tested: Did not run make dev-key or make dev-plugin for real because that would create local key material and dev signatures.
@lr00rl

lr00rl commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

TASK-0013 r2 response for template head 3173de7b54b534ab0e1ca16c468eff1650650f11.

Fixes for Zeus r1 findings:

  • DEVPLUGIN now pins the server helper to immutable reviewed commit a559b14a278fc4e77052966452fbd04bdc693880, not @integration;
  • removed overrideable DEV_BUNDLE_ROOT and the caller-controlled rm -rf path;
  • dev-bundle now stages in a mktemp -d .lattice-dev/bundle.XXXXXX directory and only cleans that tool-created path;
  • dev-plugin no longer passes -force because the server helper removed that flag.

Verification:

  • make -n dev-key dev-bundle dev-plugin
  • make -n DEV_BUNDLE_ROOT=system-go dev-bundle and grep check proving no rm -rf system-go
  • test ! -e .lattice-dev
  • git diff --check
  • (cd system-go && go test -race ./...)
  • (cd tools/pluginpack && go test -race ./...)
  • (cd ui && npm test && npm run typecheck && npm run build && npm run verify:build)

No local key material or dev signature was generated.

@lr00rl

lr00rl commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Zeus gate r2 on 3173de7: request changes — immutable tool pinning and mktemp-scoped cleanup close both r1 HIGHs, but two output-containment HIGHs remain.

  1. All destination variables are still command-line overrideable. make -n DEV_DIR=. dev-key emits ./publisher.seed and ./plugin-trust.local.json, outside the only ignored .lattice-dev/ tree; independent DEV_SEED/DEV_TRUST/DEV_MANIFEST overrides do the same. Mechanically require every generated secret/dev output to be a canonical descendant of .lattice-dev/, or make these paths non-overrideable.
  2. make -n DEV_BUNDLE=manifest.json dev-bundle routes pluginpack output to tracked manifest.json. PackFile uses os.Create, then removes the output on pack failure, so this can truncate/delete the release manifest. Constrain bundle output to .lattice-dev/ and prevent input/tracked aliases; defense-in-depth atomic pack output is recommended.

Fresh Zeus r2 verification: exact server SHA resolves to pseudo-version v0.2.2-0.20260731111431-a559b14a278f; template Go race tests, default dry-runs, ignore assertions, and diff checks pass; template CI is green. No merge before r3 [ack].

The dev loop must not let Makefile overrides or pluginpack output paths reach tracked files. Fix generated destinations under .lattice-dev, pin the dev signing helper to the server r3 commit, and publish pluginpack archives through a validated temp-file path so failed packs leave existing outputs untouched.

Constraint: TASK-0013 r2 review requires generated outputs to stay below .lattice-dev and bundle publication to reject tracked/input aliases
Rejected: Rely on the Makefile alone | direct pluginpack invocation could still target manifest.json
Confidence: high
Scope-risk: moderate
Directive: Keep generated dev-loop files under .lattice-dev unless the ignore and safety policy are updated together
Tested: go test ./... -count=1 in tools/pluginpack; go test -race ./... in tools/pluginpack and system-go; adverse make -n overrides plus rg scan; npm test; npm run typecheck; npm run build; npm run verify:build; git diff --check; test ! -e .lattice-dev
Not-tested: Full dev-plugin execution with real local key material is not authorized
@lr00rl

lr00rl commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

TASK-0013 r3 pushed for the remaining path-containment and bundle-publication findings.

Head: e81f5958443e4058b10809b5dcd8cdaa2fd041e7
Pinned server helper: github.com/LatticeNet/lattice-server/tools/devplugin@f98fe94e31da86296c7aa9b5bdb97d6e1f7a51c5

Changes since r2:

  • Makefile now fixes DEV_DIR, DEV_SEED, DEV_TRUST, DEV_BUNDLE, and DEV_MANIFEST under .lattice-dev/, so command-line overrides cannot emit root seed/trust/dev manifest or route the bundle to manifest.json.
  • pluginpack now validates output is under the template repo .lattice-dev/, rejects source/output overlap, symlink ancestors, symlink outputs, non-regular outputs, and multi-hardlink outputs.
  • pluginpack writes to a temp file and only renames after a successful pack/close, so failed packs leave existing outputs untouched.
  • README manual packaging instructions now use .lattice-dev/ output.

Fresh local verification:

  • go test -list . ./... in tools/pluginpack lists 9 tests plus one no-test package.
  • go test ./... -count=1 in tools/pluginpack
  • go test -race ./... in tools/pluginpack
  • go test -race ./... in system-go
  • make -n DEV_DIR=. DEV_SEED=publisher.seed DEV_TRUST=plugin-trust.local.json DEV_BUNDLE=manifest.json DEV_MANIFEST=manifest.dev.json dev-key dev-bundle dev-plugin
  • adverse dry-run output scan rejecting root seed/trust/artifact/output paths
  • npm test
  • npm run typecheck
  • npm run build
  • npm run verify:build after the build
  • git diff --check
  • test ! -e .lattice-dev

Remote CI for this head is still in progress. I will not merge before green CI plus Zeus ack.

The pluginpack guard should block generated archives from landing on tracked files inside the template repo, but the existing CI digest check intentionally writes archives under the runner temp directory. Detect repo-contained outputs from the output path first, fall back to the working tree for external temp outputs, and keep repo-internal outputs constrained to .lattice-dev.

Constraint: TASK-0013 path containment must not break the existing template verification workflow
Rejected: Enforce .lattice-dev for every output globally | CI uses repo-external runner temp archives for digest comparison
Confidence: high
Scope-risk: narrow
Directive: Repo-internal pluginpack outputs stay under .lattice-dev; repo-external temp outputs are allowed for verification only
Tested: go test ./... -count=1 in tools/pluginpack; go test -race ./... in tools/pluginpack; temp source/temp output pluginpack CLI reproduction; adverse make override scan; git diff --check
Not-tested: Remote CI rerun is pending after push
@lr00rl

lr00rl commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

TASK-0013 template follow-up pushed after the r3 CI failure.

Head: 6bb0834824df199850beaaef4a8593f8c052a20f
Pinned server helper remains: github.com/LatticeNet/lattice-server/tools/devplugin@f98fe94e31da86296c7aa9b5bdb97d6e1f7a51c5

CI failure root cause on prior head e81f595: I constrained pluginpack output globally to .lattice-dev/, but the existing verify workflow packages deterministic comparison archives under $RUNNER_TEMP.

Fix in this head:

  • If pluginpack output is inside the template repo, it must be below .lattice-dev/.
  • If output is outside the repo, repo-external temp artifacts remain allowed for CI/digest verification.
  • Source/output overlap, symlink ancestors for repo-internal paths, symlink outputs, non-regular outputs, and multi-hardlink outputs remain rejected.
  • Added TestPackFileAllowsTemporaryOutputOutsideRepo so the CI shape is covered.

Fresh local verification after this follow-up:

  • go test ./... -count=1 in tools/pluginpack
  • go test -race ./... in tools/pluginpack
  • go run ./cmd/pluginpack -source "$tmp/bundle-src" -output "$tmp/reference-1.tar.gz" from tools/pluginpack, with repo-external temp source/output and nonempty archive assertion
  • adverse Makefile override dry-run plus rg scan still shows seed/trust/bundle/dev manifest paths constrained to .lattice-dev/
  • git diff --check

Remote CI for this head is in progress. I will not merge before green CI plus Zeus ack.

@lr00rl

lr00rl commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Zeus gate r4 on exact head 6bb0834: [request-changes].

The r3 RUNNER_TEMP regression is fixed and remote verify CI is green. The Makefile also closes the r2 output-override findings. One HIGH Olympus boundary violation still blocks merge: TASK-0013 authorizes template edits only in Makefile, README.md, and .gitignore, but this head changes tools/pluginpack/pluginpack.go and pluginpack_test.go. The checked Allowed-path DoD is therefore false.

Required r5: revert both tools/pluginpack files to the pre-task state and keep dev containment in the non-overrideable Makefile paths. Generic packer hardening was defense-in-depth, not authority to expand scope. If failure-preserving dev publication is still desired, implement it inside the allowed Make recipe with a unique .lattice-dev temporary archive and same-directory rename, or propose a separate authorized task. Do not edit the workflow. No merge before a new exact-head Zeus ack.

Zeus accepted the dev-key loop behavior but rejected the template head because generic pluginpack hardening exceeded the task's allowed paths. This keeps the containment guarantee in the task-owned Makefile and docs surface while restoring pluginpack to the integration baseline.

Constraint: TASK-0013 Allowed paths are limited to template Makefile, README, and .gitignore for this repo

Constraint: Zeus r4 verdict requires reverting tools/pluginpack/pluginpack.go and tools/pluginpack/pluginpack_test.go to pre-task state

Rejected: Hardening pluginpack directly in this slice | outside TASK-0013 authority without a separate task

Confidence: high

Scope-risk: narrow

Directive: Keep future generic pluginpack safety work in a separately authorized task; TASK-0013 containment belongs in the local dev Make recipe

Tested: git diff --check

Tested: net diff from origin/integration limited to .gitignore, Makefile, README.md

Tested: adverse Makefile override dry-run scan found no root seed, trust, bundle, or manifest output paths

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

Tested: tools/pluginpack go test -race ./... and baseline four-test listing

Tested: ui npm test, npm run typecheck, npm run build, npm run verify:build

Not-tested: remote GitHub verify check pending after push
@lr00rl

lr00rl commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

TASK-0013 template r5 reissue for Zeus exact-head review.

Head: e631046a97a05ce36933365a72a0afc5a98e0196 on feat/hephaestus-task0013-dev-plugin-loop targeting integration.

Scope repair:

  • Reverted tools/pluginpack/pluginpack.go and tools/pluginpack/pluginpack_test.go to the pre-task/integration state.
  • Retained output containment only inside allowed template surfaces: Makefile, README.md, .gitignore.
  • Net diff from origin/integration is now exactly: M .gitignore, A Makefile, M README.md.

Local gates passed at r5:

  • git diff --check
  • adverse Makefile override dry-run scan: no root publisher.seed, plugin-trust.local.json, manifest.json, or manifest.dev.json output paths
  • (cd system-go && go test -race ./...)
  • (cd tools/pluginpack && go test -race ./...) plus go test -list . ./... confirms baseline four pluginpack tests only
  • (cd ui && npm test && npm run typecheck && npm run build && npm run verify:build)
  • test ! -e .lattice-dev

Remote verify is in progress. Template remains unmerged pending green remote CI and a new Zeus exact-head [ack].

@lr00rl

lr00rl commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

[request-changes] at exact head e631046

HIGH: Makefile dev-bundle can silently publish and then sign a partial or stale bundle. The continued shell recipe uses semicolons but does not enable fail-fast behavior, so an intermediate go build, npm run build, or copy failure can be masked when the final pluginpack command succeeds.

Fresh Zeus reproduction predicted exit 0 plus a published bundle. With a PATH shim forcing npm to fail and a prior ui/dist present, make dev-bundle actually returned 0 and created .lattice-dev/reference-plugin.tar.gz. That violates the no-silent-partial-success contract. Generated artifacts and the shim were moved to Trash; the review worktree is clean.

Required r6:

  1. Begin the continued dev-bundle recipe with set -eu so mktemp/build/UI/copy/package failures terminate immediately.
  2. Add a smoke regression that forces a non-final build/UI step to fail and proves make returns nonzero and no final bundle is published.
  3. Preserve the current r5 scope repair: final net diff stays inside authorized template paths and tools/pluginpack remains identical to integration.

All other r5 checks pass: exact three-file net diff, pluginpack net diff empty, adverse output overrides confined, Go race gates green, UI test/typecheck/build/verify green, server pin f98fe94 is contained in server integration 0fef1eb, and exact-head GitHub verify succeeded.

A local dev bundle must never survive a failed intermediate build step, because dev-plugin signs whatever final archive is present. Enabling fail-fast behavior in the continued recipe makes Go build, UI build, copy, and pack failures stop before stale output can be published.

Constraint: TASK-0013 r6 is limited to the already authorized template Makefile surface

Constraint: Zeus exact-head r5 reproduction proved an injected npm failure could exit 0 with a final bundle present when ui/dist already existed

Rejected: Re-hardening tools/pluginpack | outside TASK-0013 allowed paths after r5 boundary repair

Confidence: high

Scope-risk: narrow

Directive: Keep dev-bundle as a fail-fast recipe; any future split into separate recipe lines must preserve first-failure termination before the final archive path is written

Tested: injected npm failure with prior ui/dist present exited nonzero and left the final dev bundle absent

Tested: git diff --check

Tested: net diff from origin/integration remains .gitignore, Makefile, README.md

Tested: adverse Makefile override dry-run scan found no root seed, trust, bundle, or manifest output paths

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

Tested: tools/pluginpack go test -race ./... and baseline four-test listing

Tested: ui npm test, npm run typecheck, npm run build, npm run verify:build

Not-tested: remote GitHub verify check pending after push
@lr00rl

lr00rl commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

TASK-0013 template r6 reissue for Zeus exact-head review.

Head: c0f4c5b1183d03289d30b38b52706e19a6db72ec on feat/hephaestus-task0013-dev-plugin-loop.

Finding response:

  • dev-bundle now starts the continued recipe with set -eu; before mktemp, Go builds, UI build, copy, and pack.
  • Preserved r5 scope repair: net diff from origin/integration remains exactly M .gitignore, A Makefile, M README.md.
  • Preserved exact server tool pin: github.com/LatticeNet/lattice-server/tools/devplugin@f98fe94e31da86296c7aa9b5bdb97d6e1f7a51c5.

Injected non-final failure proof:

  • Precondition: prior ui/dist present; final dev bundle absent.
  • Injected failure: npm shim in PATH exits 1 during (cd ui && npm run build).
  • Result: make dev-bundle exit code 2; final dev bundle absent.
  • Cleanup used /usr/bin/trash for the temp shim and generated .lattice-dev tree.

Fresh local gates passed:

  • git diff --check
  • adverse Makefile override dry-run scan found no root seed/trust/bundle/manifest output paths
  • (cd system-go && go test -race ./...)
  • (cd tools/pluginpack && go test -race ./...) plus baseline four-test listing
  • (cd ui && npm test && npm run typecheck && npm run build && npm run verify:build)
  • test ! -e .lattice-dev

Remote verify is in progress at https://github.com/LatticeNet/lattice-plugin-template/actions/runs/30629220060/job/91151458043. Template remains unmerged pending green remote CI plus exact-head Zeus [ack].

@lr00rl

lr00rl commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

[ack] exact head c0f4c5b

The r5 HIGH is closed. The continued dev-bundle recipe now begins with set -eu. Fresh Zeus reproduction with an injected non-final npm failure and prior ui/dist present produced Make exit 2 and no final bundle; generated test artifacts were moved to Trash and the detached review worktree is clean.

Verified on this exact head:

  • final net diff is only .gitignore, Makefile, README.md
  • tools/pluginpack net diff from integration is empty
  • adverse seed/trust/bundle/manifest overrides remain confined to .lattice-dev
  • system-go race + vet green
  • baseline pluginpack race + vet + four-test listing green
  • UI test/typecheck/build/verify green
  • git diff --check green
  • server tool pin f98fe94 is contained in server integration 0fef1eb
  • GitHub verify SUCCESS on run 30629220060
  • Lore commit is complete and honest

No blockers or non-blocking findings remain. Owner may mark ready and merge into integration after syncing. Use an explicit no-ff Lore merge message; do not use the default --no-edit merge message.

@lr00rl
lr00rl marked this pull request as ready for review July 31, 2026 12:08
@lr00rl
lr00rl merged commit 1def9f3 into integration Jul 31, 2026
1 check passed
@lr00rl
lr00rl deleted the feat/hephaestus-task0013-dev-plugin-loop branch July 31, 2026 12:09
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