Skip to content

operad: an unparseable stratum skips only the M5 rule (Refs #77) - #83

Merged
MSD21091969 merged 3 commits into
masterfrom
gemini/t342-strata-77
Oct 9, 2026
Merged

MSD21091969 merged 3 commits into
masterfrom
gemini/t342-strata-77

Conversation

@MSD21091969

Copy link
Copy Markdown
Collaborator

Refs #77
Stacked on #82 (d57a341): merge after #82. moos-kernel merges with merge commits, so this diff narrows by itself. If #82 is squashed or rebased instead, rebase this onto master first.

  • The unit test failed 4 of 6 subtests without the fix and passed 6 of 6 with it.
  • go build ./..., go vet ./... and go test -count=1 ./... all pass, and gofmt -l . prints nothing.
  • Integration test with MOOS_INTEGRATION=1:
    • with MOOS_ONTOLOGY_PATH set to mtdc-lab's operad/moos-mtdc-2.2.0.json, the stratum test passes
    • on ffs0's 4.0.7, it fails and lists exactly the 5 types (event_notice, governance_proposal, message_packet, tool_call, tool_result), as expected.
  • Replaying the logs (Z440 kernel logs and scratch log): 0 LINKs' verdicts change with the fix.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 14:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new integration assertion knowingly fails the repository’s real-ontology CI job until the sibling ffs0 data is updated.

1 open finding
What changed in this PR

Updates LINK validation so malformed strata skip only M5 direction checks while type-list rules still run.

Changes:

  • Continues stacked wildcard/type-list enforcement from #82.
  • Enforces type constraints despite unparseable strata.
  • Adds unit and integration coverage plus formatting cleanup.
File Description
internal/​transport/​server_port_colors_test.go Updates ontology fixture type lists.
internal/​transport/​auth_test.go Formatting only.
internal/​reactive/​predicate_test.go Formatting only.
internal/​reactive/​engine_test.go Formatting only.
internal/​operad/​wildcard_acceptance_t342_test.go Tests wildcard and list validation.
internal/​operad/​validate.go Separates M5 parsing from type validation.
internal/​operad/​validate_link_pair_test.go Tests malformed-stratum behavior.
internal/​operad/​registry.go Clarifies pair type-list semantics.
internal/​operad/​ports_generate_t342_test.go Updates wildcard fixtures.
internal/​operad/​occupancy.go Formatting only.
internal/​operad/​occupancy_test.go Formatting only.
internal/​operad/​loader.go Validates declared type lists.
internal/​operad/​loader_test.go Updates loader fixture.
internal/​operad/​loader_color_source_t342_test.go Updates color fixtures.
internal/​operad/​loader_closure_t342_test.go Updates closure fixture.
internal/​operad/​integration_ontology_test.go Checks all ontology strata.
internal/​operad/​color_equality_t342_test.go Adds wildcard lists to generated fixtures.
internal/​mcp/​protocol.go Formatting only.
internal/​kernel/​sweep.go Comment formatting only.
internal/​kernel/​liveness_test.go Formatting only.
internal/​hdc/​fiber.go Removes trailing whitespace.
internal/​hdc/​crosswalk.go Removes trailing whitespace.
internal/​graph/​state.go Comment formatting only.
internal/​graph/​node.go Formatting only.
internal/​fold/​errors.go Formatting only.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

return ""
}

func TestIntegration_EveryNodeTypeStratumParses(t *testing.T) {
@MSD21091969

Copy link
Copy Markdown
Collaborator Author

t342 · Z440 seat · review of #83 (G5, #77 kernel half; delta d57a341..c38a8c2). Verdict: correct and ready to merge after #82.

The review covered the spec, real data, and code with mutation tests. Every finding was re-checked by a skeptic. All copies and caches were on C: and have been deleted.

Verified

  • The fix is operad: ValidateStrataLink returns early on an unparseable stratum and skips the type-list rules (rules 2 and 3) #77's diff in behaviour.
    • Both strata are parsed without an early return. Rule 1 (M5) runs only when both parse. Rules 2 and 3, with operad: * in type lists matches any type (Refs #79) #82's typeAllowed, always run.
    • An absent stratum and "S0-S2" are handled alike, and error messages are unchanged.
    • The rule-1 doc comment is amended.
  • Both tests are byte-identical to the issue's text (diffed).
  • The 4/6 → 6/6 check holds. With only the validate.go hunk reverted, TestValidateStrataLink_UnparseableStratumStillTypeChecked fails exactly 4 of 6: two pair: cases and two wf: cases. The wildcard and S4 controls pass. At the head, 6 of 6 pass.
  • Build and format. go build, go vet and go test ./... pass in all 9 packages. gofmt -l on the committed bytes of the 3 changed files prints nothing.
  • Integration, TestIntegration_EveryNodeTypeStratumParses:
    • fails on ffs0 4.0.7, 4.0.9-B and mtdc-2.1.0, with exactly event_notice, governance_proposal (S0-S2), message_packet, tool_call, tool_result;
    • passes on mtdc-2.2.0;
    • is the only integration failure at the head.
  • Real logs. Every LINK in the primary, menno, lola, moos and scratch logs (707) was replayed through ValidateStrataLink on both commits, over five ontologies.
    • 0 verdicts change. No logged LINK touches one of the five types: 8 governance_proposal nodes are ADDed, but never LINKed.
    • The existing TestIntegration_T342_ShadowLog cannot see this change, because it only calls ValidateLINK.
    • Replay at boot does not call ValidateStrataLink, so restarting on today's logs is unaffected.
  • Future effect on 4.0.7. Measured over every (declared pair × source type × target type):

Low: two test gaps (optional; add as separate tests so the 4/6 count stays valid)

Four of ten plausible wrong fixes survive the suite: an || guard, a source-only guard, no guard at all, and keeping the early return when both ends are unparseable. Two small tests in validate_link_pair_test.go would catch them:

  • (a) a LINK where both ends are unparseable (governance_proposal → tool_call) must still be type-checked;
  • (b) an S4 source → an unparseable target must be admitted. Rule 1 is skipped, not applied.

On Copilot's CI point

The new integration test fails on ffs0's 4.0.7, as #77 intends. Today's green ontology-integration check proves nothing: its log says FFS0_READ_TOKEN is not configured and no integration test ran. Once the token is set, or for anyone running MOOS_INTEGRATION=1 locally on 4.0.x, the suite is red until ffs0 gives the five types a stratum. Sam's call:

  • (i) Keep the red flag on purpose. The operad half stays visibly owed.
  • (ii) Give the five types S2 in ffs0. This could be in the planned 4.0.9 bump (as mtdc-2.2.0 did) or a separate 4.0.x.
    • The cost is 18,169 shapes refused for future LINKs, which also applies on the current 23ba9ce build (the stratum skip ends for those types).
    • No logged LINK is affected.
    • The R1 runbook's gate then stays green on later builds too.

Merge order: #81 → #82 → #83. If #82 is squashed or rebased, rebase this onto master first.

— Z440 seat (urn:moos:agent:claude-cowork.hp-z440), harness-session 71a0b53d

@MSD21091969

Copy link
Copy Markdown
Collaborator Author

t342 · Z440 seat · re-checked 06ca234 (G5b). It adds commits on top of c38a8c2, with no rewrite. Both new tests are separate functions, so the 4/6 count on the verbatim test still holds.

The four wrong fixes that survived before now each fail:

wrong fix killed by
`
source-only guard TestValidateStrataLink_S4ToUnparseable_Admitted
no guard TestValidateStrataLink_S4ToUnparseable_Admitted
early return when both ends are unparseable TestValidateStrataLink_BothUnparseable_StillTypeChecked

gofmt -l is clean, and go vet plus go test ./... pass in all 9 packages. Ready to merge after #82, from the Z440 review side. The integration flag on ffs0 4.x stays red until the five strata land, as agreed. — Z440 seat, harness-session 71a0b53d

@MSD21091969
MSD21091969 merged commit e04839f into master Oct 9, 2026
3 checks passed
@MSD21091969
MSD21091969 deleted the gemini/t342-strata-77 branch October 9, 2026 15:20
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.

2 participants