Skip to content

Preserve NetGuard apply evidence across agent failures - #11

Closed
lr00rl wants to merge 2 commits into
integrationfrom
feat/hephaestus-task0020-netguard-g3-sha
Closed

Preserve NetGuard apply evidence across agent failures#11
lr00rl wants to merge 2 commits into
integrationfrom
feat/hephaestus-task0020-netguard-g3-sha

Conversation

@lr00rl

@lr00rl lr00rl commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

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-sha performs exactly one bounded nft -j list ruleset and emits only a validated lowercase SHA-256.
  • The running agent absolute path is injected into the hardened task environment, independent of PATH.
  • Lease is durable before execution; exact result is durable before POST; pending results flush before new task fetch.
  • Restart never re-runs a journaled task; interrupted execution becomes an explicit unknown outcome.
  • One process exclusively owns a server/node outbox; non-2xx results remain byte-equivalent for retry.
  • Installer creates only a dedicated private leaf and rejects filesystem roots, direct/non-root-owned symlinks, and unsafe external bases.

Verification

  • go test ./... -count=1
  • go test -race ./... -count=1
  • go vet ./...
  • sh -n scripts/install.sh scripts/test-install-integrity.sh
  • sh scripts/test-install-integrity.sh
  • git diff --check

Boundary

No release, tag, deploy, CI dispatch, live nft discovery/mutation, credential, or ops action was performed.

lr00rl added 2 commits August 13, 2026 01:02
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.
@lr00rl

lr00rl commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #13. This PR remains preserved as the immutable audit record. Its final content tree is correct, but ancestor 83ff0eb stores Lore trailers as literal \n sequences and fails native trailer parsing. No force-push, rebase, branch deletion, release, deployment, or merge was performed.

@lr00rl lr00rl closed this Aug 13, 2026
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