Preserve NetGuard apply evidence across agent failures - #11
Closed
lr00rl wants to merge 2 commits into
Closed
Conversation
A host task may mutate firewall state only after its lease is durably owned, and its exact result must survive response loss or restart without re-execution. Journal leases and results under exclusive process ownership, expose the canonical managed-table helper through the installed agent path, and harden installer handling of the outbox base.\n\nConstraint: The task environment stays minimal and the helper path is the running executable, not PATH lookup\nConstraint: Interrupted execution has unknown outcome and must never be replayed\nRejected: Retry the host task after upload failure | duplicate firewall mutation is unsafe\nRejected: Chmod the configured outbox base | an operator path may name a system directory\nConfidence: high\nScope-risk: moderate\nReversibility: clean\nDirective: Keep result upload before new task fetch and retain non-2xx results byte-for-byte\nTested: go test ./... -count=1; go test -race ./... -count=1; go vet ./...; installer integrity; sh -n; git diff --check\nNot-tested: Live nft mutation and multi-host fleet rollout are intentionally outside this slice
A reviewed NetGuard apply must survive lost responses, restarts, process duplication, and post-rename fsync uncertainty without executing the host mutation twice. Journal only server-marked NetGuard tasks, validate complete task identity, and require confirmed local durability before result upload. Constraint: The installed agent runs with a clean task environment and a private per-node state directory. Rejected: Journal every task type | generic server reconcilers do not share an atomic replay contract. Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep the outbox single-owner and never upload a published result before ConfirmDurability succeeds. Tested: go test ./... -count=1; go test -race ./... -count=1; go vet ./...; install integrity script; git diff --check; independent code review APPROVE. Not-tested: Live nft execution and deployment remain outside this development slice.
This was referenced Aug 13, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome
Completes the TASK-0020 node-agent protocol: canonical managed-table SHA collection plus a private durable task outbox that prevents host re-execution and survives response loss or restart.
Key contracts
--guard-managed-shaperforms exactly one boundednft -j list rulesetand emits only a validated lowercase SHA-256.Verification
go test ./... -count=1go test -race ./... -count=1go vet ./...sh -n scripts/install.sh scripts/test-install-integrity.shsh scripts/test-install-integrity.shgit diff --checkBoundary
No release, tag, deploy, CI dispatch, live nft discovery/mutation, credential, or ops action was performed.