Commit 6679318
Hardening phases 4–8: behavioral tests, config cleanup + YAML, CLI, coherence, docs (#61)
* test(behavioral): mock-server harness + end-to-end C-ABI coverage
The unit suites only ever used synthetic ProbeResults, so the real socket
paths — exactly where the Phase 1-3 bugs lived — had zero coverage. Adds
in-process mock servers on ephemeral 127.0.0.1 ports:
- MockA2S (UDP): direct / challenge / silent modes.
- MockSLP (TCP): normal / fragmented (two-segment) response.
New test/behavioral_test.zig (zig build test-behavioral):
- C-ABI end-to-end: init -> gossamer_gsa_probe (returns a handle >= 1000,
not a result code) -> close_handle (ok) -> close again (double_free) ->
unknown id (not_found). This single test would have caught findings 1-3
together — the seam the old tests never touched.
- A2S 0x41 challenge handshake completes and parses.
- Minecraft SLP is reassembled across a fragmented response.
- A 100ms probe budget returns well under 1s against a silent server
(the old code ignored timeout_ms and waited ~3000ms).
build.zig gains the test-behavioral step (mirrors the smoke pattern) with a
shared mock_servers module. CI now runs all five suites, incl. the two
(smoke, property) that were defined but never run. 157 tests green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TaWWedv6VQqeZaPvc94keN
* refactor(config): delete dead parsers, real YAML support, wire fuzz harness
Three related cleanups from the audit's Phase 5:
1. Delete 5 orphaned config_parse_{ini,json,kv,lua,xml}.zig (727 LOC). They
duplicated logic already live and tested inline in config_extract.zig,
were never referenced by build.zig, and had silently drifted (the fuzz
harness below wouldn't even compile against the current API).
2. Real YAML parser, replacing the .YAML -> parseKeyValue stub. New
parseYAML handles a scoped subset (block mappings -> dotted keys, block
sequences -> parent.N, scalars, quotes, comments, ---/... markers), same
complexity class as parseTOML/parseLua. detectFormat now recognises YAML
via a leading --- or colon-mappings with no '=' lines/sections, without
stealing from INI/TOML/ENV/KeyValue. The repo-wide '8 formats' claim is
now true. Detection + nested-parse tests added.
3. Wire the orphaned fuzz_config.zig into (updated to the
Zig 0.15 std.testing.fuzz two-arg testOne API). Running it immediately
caught a real invariant violation: some parsers emitted config fields
with an empty key (a lone '=value' line, a '"":x' JSON key), which
breaks getField and A2ML emission. Fixed at the single addField funnel so
'every field has a non-empty key' now holds by construction.
159 tests green (+2 YAML) plus 104 in the fuzz seed run.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TaWWedv6VQqeZaPvc94keN
* fix(cli): stop truncating config reads, cover + document the Nickel patchers
- config set-default / add-favorite read the user config into a fixed
[16384]u8 buffer with a single read(), silently truncating (and then
corrupting on rewrite) any config larger than 16 KiB. Switched both to
readToEndAlloc(1 MiB).
- Documented writeWithDefaultServer / writeWithFavorite as deliberately
narrow, structure-aware patches of GSA's own generated user-config.ncl —
explicitly not a Nickel parser — that pass unknown-shape input through
unchanged rather than risk corruption.
- Fixed the usage text: GSA_VERISIMDB_URL default printed http://[::1]:8090
but the code defaults to http://localhost:8090.
- cli.zig had zero tests and was only built as an exe. Added a test-cli
build step + 3 round-trip tests (set-default replace, favorite insert,
unknown-shape passthrough) and wired test-cli + the fuzz seed run into CI.
162 tests green across six suites.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TaWWedv6VQqeZaPvc94keN
* chore(coherence): wire nexus-setup panel, fill metadata TODOs, fix version outlier
- nexus-setup was a shipped 61KB panel with no descriptor, clade, or manifest
entry (README/groove listed 7 panels; STATE said 8). Added
panels/nexus-setup/panel.json (+ manifest entry) and the gsa-nexus-setup
clade (GsaNexusSetup.a2ml + config.k9.ncl), matching sibling structure.
The GUI panel family is now consistently 8.
- Filled the blank ECOSYSTEM.a2ml (purpose, role=ffi-infrastructure, the real
related-projects/integration-points: gossamer/ephapax/verisimdb/groove/
standards, verisimdb/steam/groove/podman) and META.a2ml (type note,
languages=[zig,idris2,ephapax]).
- run.js version 0.3.0 -> 0.1.0 (stale outlier; matches main.zig, build.zig,
panels, and all machine-readable files).
- ROADMAP 'beyond 17' -> 'beyond the current 18' (18 profiles/clades exist).
Deliberately DEFERRED (needs a maintainer decision, flagged in META.a2ml and
the human checklist): the license reconciliation. The LICENSE file and all
27 Zig/Idris source headers are MPL-2.0, but the panel descriptors and
META.a2ml declare AGPL-3.0-or-later — a genuine conflict that must not be
resolved by an automated mass-edit in either direction. Also deferred: a full
version bump to a single SSOT number + drift-check, pending the canonical
version choice.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TaWWedv6VQqeZaPvc94keN
* docs: config-format guide + release checklist; honest INDEX statuses
Two concrete, accurate docs written from the code hardened in this series:
- docs/developer/CONFIG-FORMATS.adoc — the 8 formats, most-specific-first
detection order (incl. the INI-vs-JSON and YAML-vs-KeyValue disambiguation),
the addField invariants (non-empty keys, secret redaction), the YAML subset
scope, and how to add a parser. Marked live in INDEX (was 'planned').
- docs/maintainer/RELEASE-CHECKLIST.adoc — the actual CI gates (six test
suites + the ABI-contract regen/diff/comptime + Idris typecheck), the
version/license/docs pre-tag gates, the manual gates, and the tag steps.
Marked live in INDEX (was 'planned').
INDEX also records why the empty-scaffolding prune is deferred: verification/,
docs/theory/, docs/reports/, docs/wikis/ are referenced by the governance layer
(ANCHOR.a2ml, MAINTENANCE-CHECKLIST, panic-attacker), so deleting them needs a
reviewed change that updates those references in lockstep — not an automated
docs pass. The remaining planned docs (FFI module reference, panel-extension
guide, architecture rationale, CI/CD guide, security runbook) stay 'planned'.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TaWWedv6VQqeZaPvc94keN
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent e1b6ec3 commit 6679318
25 files changed
Lines changed: 978 additions & 763 deletions
File tree
- .github/workflows
- .machine_readable/6a2
- docs
- developer
- maintainer
- panel-clades/gsa-nexus-setup
- panels
- nexus-setup
- src/interface/ffi
- src
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
26 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
0 commit comments