test(stewardship): comprehensive test suite for Layer 2 — 35 cases #12

Merged
will.anderson merged 1 commits from test/layer-stewardship into feat/layer-stewardship 2026-06-11 17:13:46 +00:00
Owner

Summary

  • Adds tests/test_stewardship.el with 35 distinct test cases covering all five public functions in stewardship.el
  • Uses the assert_eq / assert_contains / assert_not_contains / assert_not_empty helper pattern with labelled PASS/FAIL output
  • Targets feat/layer-stewardship to validate the branch before merge to main

Test cases

Range Area
TC-01 to TC-16 steward_align — pass-through (normal, empty), all five signal keywords, redirect shape, json_get field extraction
TC-17 to TC-22 steward_validate_imprint — standard tools always authorized; all four platform-only tools blocked without platform_auth; authorized with platform_auth=true; auth string "false" is denied
TC-23 to TC-30 steward_cgi_check — all four gated actions return approved==false with cgi_review; non-gated return approved==true; gated result echoes action name
TC-31 to TC-33 steward_get_mission — non-empty, contains "integrity", not an error JSON object
TC-34 to TC-35 Cross-cutting — redirect JSON shape validity, signal text echoed in reason field

Known issues documented by tests

  • steward_get_mission non-Config fallthrough (lines 41-43) — TC-28/TC-29 will surface unexpected content if a non-Config engram overrides the mission
  • && operator (line 31) — if El does not support &&, mission tests surface the compile failure immediately
  • steward_log_event Void/String type mismatch (line 14) — exercised indirectly by every misalignment/auth-denied event

Test plan

  • Run: elc tests/test_stewardship.el
  • All 35 cases print PASS:
  • No FAIL: lines in output
  • After fixing the three bugs in stewardship.el, re-run to confirm no regressions
## Summary - Adds `tests/test_stewardship.el` with 35 distinct test cases covering all five public functions in `stewardship.el` - Uses the `assert_eq` / `assert_contains` / `assert_not_contains` / `assert_not_empty` helper pattern with labelled PASS/FAIL output - Targets `feat/layer-stewardship` to validate the branch before merge to main ## Test cases | Range | Area | |-------|------| | TC-01 to TC-16 | `steward_align` — pass-through (normal, empty), all five signal keywords, redirect shape, `json_get` field extraction | | TC-17 to TC-22 | `steward_validate_imprint` — standard tools always authorized; all four platform-only tools blocked without `platform_auth`; authorized with `platform_auth=true`; auth string `"false"` is denied | | TC-23 to TC-30 | `steward_cgi_check` — all four gated actions return `approved==false` with `cgi_review`; non-gated return `approved==true`; gated result echoes action name | | TC-31 to TC-33 | `steward_get_mission` — non-empty, contains `"integrity"`, not an error JSON object | | TC-34 to TC-35 | Cross-cutting — redirect JSON shape validity, signal text echoed in reason field | ## Known issues documented by tests - `steward_get_mission` non-Config fallthrough (lines 41-43) — TC-28/TC-29 will surface unexpected content if a non-Config engram overrides the mission - `&&` operator (line 31) — if El does not support `&&`, mission tests surface the compile failure immediately - `steward_log_event` Void/String type mismatch (line 14) — exercised indirectly by every misalignment/auth-denied event ## Test plan - Run: `elc tests/test_stewardship.el` - All 35 cases print `PASS:` - No `FAIL:` lines in output - After fixing the three bugs in `stewardship.el`, re-run to confirm no regressions
will.anderson added 1 commit 2026-06-11 16:42:23 +00:00
35 test cases covering all five public functions:
steward_align (pass-through, all five misalignment signals, empty input,
json_get field extraction, redirect shape), steward_validate_imprint
(standard tools, platform-only tools with/without platform_auth,
auth=false string), steward_cgi_check (all four gated actions, non-gated
actions, empty action, action name echoed in response), and
steward_get_mission (non-empty, contains "integrity", not an error object).

Also documents the known bug surface from the code review: the &&
operator in steward_get_mission and the non-Config fallthrough — tests
are written against the actual runtime behaviour so they will catch
regressions when those bugs are fixed.
will.anderson merged commit 084bee9f0f into feat/layer-stewardship 2026-06-11 17:13:46 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: neuron-technologies/neuron#12