Feat/agon everywhere#229
Merged
Merged
Conversation
…desktop attaches to The Agon Everywhere backbone (BrainClient contract + HeadlessTurnBrainClient + AgonServe) was three libraries nothing instantiated. `agon serve` is the runnable seam: build the engine registry, validate + open the single-engine brain, mint + seed a fresh `serve-<ts>` session, bind the loopback bridge, write a 0600 connection file + print the URL/token banner, and hold until Ctrl+C with ordered teardown (serve.close → brain.close → flush). Infrastructure like `daemon`/`attach` (not a Cesar mode): KERN command + facade + one subCommands entry. Design validated by a 6-engine brainstorm (0.90 on all 4 forks): fresh-session only (--session reserved + refused — an existing-session write would be answered by the single-engine brain, not that session's live Cesar = split-brain); foreground (daemon owns detachment); deny-by-default --origin; cesarEngine default with fail-fast on unknown --engine; a startup provenance frame so a client can verify which brain answers. One reasoned deviation: empty --origin starts with a loud warning (not exit 2) so a token-holding local client (curl/Electron) still works. 6-engine agon review: fixed the blocking finding — start()/post-bind steps were unguarded, so a bind failure (EADDRINUSE on a pinned --port) crashed instead of exiting 2 and leaked the opened brain. Now wrapped: tear down serve + brain + flush + remove the handoff file, fail closed. Regression-tested. 14 tests: pure helpers, engine fail-fast, session seed + ready frame, 0600 connection file, runtime-wiring integration, bind-failure-fails-closed. ⚔️ Forged by [Agon](https://github.com/KERNlang/agon) Co-Authored-By: agon (KERN) <292465531+KERN-Agon@users.noreply.github.com>
The unit tests prove the bridge works on the happy path; this proves the four adversarial wire properties a browser/Electron client will inflict on it — the Agon-Everywhere council's gate #2, before any GUI is built on the wire: • fan-out — N concurrent subscribers get identical, ordered streams • reconnect — resume from a cursor: no missed events, no duplicates • dup/order — replay→LIVE-subscribe handoff delivers each seq exactly once • backpressure — a wedged consumer never blocks LIVE delivery to a healthy one Driven by a deterministic counting brain over real loopback HTTP + SSE (the same fetch/ReadableStream API a browser extension uses); each test owns a fresh session + ephemeral port. The live tests (dup, backpressure) send the second turn only after the subscriber confirms it is connected, so they exercise the LIVE subscribe path, not replay. 6-engine agon review: the harness now surfaces protocol regressions LOUDLY rather than masking them as timeouts — non-2xx /events, a missing body, or a malformed complete SSE frame all throw; live dup/backpressure no longer pass via replay-only; temp AGON_HOME is cleaned up; the wedged raw socket has a persistent error handler. ⚔️ Forged by [Agon](https://github.com/KERNlang/agon) Co-Authored-By: agon (KERN) <292465531+KERN-Agon@users.noreply.github.com>
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.
No description provided.