feat: fleet comms wire schemas (event envelope, channel metadata, message metadata) v1#15
Merged
Merged
Conversation
…sage metadata) v1 Registers three machine-validatable comms schemas per fleet comms workflow v1.1 (todos task 41ea5a6e, parent 843cfb62): - hasna.comms_event_envelope.v1: namespaced <source>.<entity>.<action> type, severities info/notice/breaking/critical, scope fleet/package/machine, affected_packages/affected_machines, action_required, ack_by, mandatory dedupe_key. fleet.freeze and fleet.unfreeze pinned critical + fleet-scoped + action-required. - hasna.comms_channel_metadata.v1: channel_schema class enum (fleet/package/product/loop-lane/initiative/personal), noise class, initiative owner + machine-evaluatable until horizon (date or gate:<todos-id>), archived-channel successor pointer. - hasna.comms_message_metadata.v1: severity-tag metadata for [FREEZE]/[UNFREEZE]/[BREAKING]/[CUTOVER]/[POLICY]/[RELEASE] exact-case first-token posts; envelope rides in --metadata, never parsed from text. Ships the one severity mapping table (COMMS_EVENT_TYPES / COMMS_SEVERITY_TAG_INFO with bijection tests), tag helpers (extractCommsSeverityTag, commsSeverityTagToken), and validateCommsTaggedMessage so hooks/loops/publishers validate before emit/post. Valid/invalid fixtures + conformance + unit tests; README catalog updated. @hasna/contracts 0.4.1 -> 0.5.0.
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.
Summary
Registers three machine-validatable fleet comms wire schemas + validators per fleet comms workflow v1.1. Todos task: 41ea5a6e (parent tracking task 843cfb62). Wire schemas belong in open-contracts, not knowledge (v1.1 amendment 2; knowledge item hasna-knowledge-taxonomy).
Schemas (all .strict(), registry-integrated, hasna.*.v1 ids minted in contracts per governance decision #2, k_mr6fvzgm_wrcb2t)
hasna.comms_event_envelope.v1— namespaced<source>.<entity>.<action>type (2-4 lowercase segments), severitiesinfo|notice|breaking|critical, scopefleet|package|machine,affected_packages/affected_machines,action_required,ack_by, mandatorydedupe_key. Cross-field rules: package scope requires affected_packages; machine scope requires affected_machines; ack_by requires action_required;fleet.freeze/fleet.unfreezepinned critical + fleet-scoped + action-required.hasna.comms_channel_metadata.v1— themetadata.channel_schemaobject: class enumfleet|package|product|loop-lane|initiative|personal, noisequiet|work|firehose, initiative channels require owner + machine-evaluatableuntilhorizon (ISO date, UTC timestamp, orgate:<todos-id>), archived-channelsuccessorpointer.hasna.comms_message_metadata.v1— severity-tag metadata for[FREEZE]/[UNFREEZE]/[BREAKING]/[CUTOVER]/[POLICY]/[RELEASE]exact-case first-token posts; tag + full envelope ride in--metadata, never parsed from text; per-tag severity bounds; FREEZE/UNFREEZE pinned to fleet.freeze/fleet.unfreeze both directions.Validators exported for hooks/loops/publishers (validate before emit/post)
COMMS_EVENT_TYPES/COMMS_SEVERITY_TAG_INFO(+ bijection consistency tests),defaultSeverityForCommsEventType.extractCommsSeverityTag(exact-case first token),commsSeverityTagToken,validateCommsTaggedMessage(text token + metadata schema + tag/text match).validateContract/parseContract/validateEmbeddedContract, CLIcontracts validate --schema hasna.comms_event_envelope.v1 ....Version: 0.4.1 -> 0.5.0 (additive minor). Human-facing rules live in knowledge items
hasna-agent-comms-protocol/hasna-agent-comms-envelope; these schemas are the machine-validatable source of truth those items cross-reference.Verification
bun run verify:releasegreen: typecheck, 169 pass / 7 skip / 0 fail (baseline 142), conformance over all fixtures incl. the 6 new comms valid/invalid fixtures, build, dist smoke, pack dry-run.untilhorizon tightened from free-form string to date/timestamp/gate-id). Refuted candidates documented in the task log.bun testwith a staledist/present fails pre-existing no-cloud-scan tests (repo-known;verify:releaserm-rfs dist first). Not introduced by this PR.Fixtures
6 new examples:
comms-{event-envelope,channel-metadata,message-metadata}.{valid,invalid}.jsonwired into the examples + conformance suites with exact expected issue paths.