gnomonlearn
Docs/RFC-0004 aspect merge contract proposal

RFC-0004 aspect merge contract proposal

Versioned draft snapshot

RFCs, reference catalogs, and evidence reflect Spec 3b2e3e7a114fb826b1445d39a48756b8fff629cd. Counts and pending/status notes belong to that snapshot. Read the dated project update for later progress.

Source repositories are private during staging. Links marked “repository access required” need access to the linked repository.

This is a trace and gap record from the pinned draft specification. It does not establish proof or implementation conformance.

Status: proposed for the first release. Nothing is deployed; no stored aspect state or diagnostic migration is required. Owner: module architecture and compiler maintainers.

Source conflict

TopicAuthored RFC-0004 and Lean catalogCompanion Q&A
Merge modes§5.1 and §11 define additive, override, and guarded; §5.2 orders them by selector specificity, guard result, module name, and aspect name.Says M0 uses merge_reject, M1 adds merge_last_write_wins and merge_manual, and M2 reserves merge_union.
Cross-module precedence§12 assigns M04811 to conflicting priorities for one aspect across modules. §5.2 uses deterministic module canonical-name ordering within a specificity tier.Assigns the precedence conflict to M04810 and says each module controls imported aspect order.
M04810§10 and the Lean catalog use it for an extend whose base entity lacks a matching extension-points slot.Uses it for the unrelated precedence conflict.

The first-release recommendation is to keep the authored §5/§11 mode system and M04811 precedence identity, then rewrite the two stale Q&A answers to cite those clauses. The Q&A’s merge_last_write_wins and merge_manual describe operational conflict handling absent from the authored aspect compiler contract; adding them would require a new syntax, phase model, diagnostics, Lean facts, and implementation tests. No such addition is assumed here.

Two conflicts remain inside the authored RFC and need separate exact wording before emission:

  1. §5.1 says any two override aspects providing one field cause M04314, while §5.2 and §7 restrict the error to equal specificity. Specify the result for different specificity tiers and align the prose, Lean catalog, and compiler test cases.
  2. §10’s dependency-or-slot rule warns M04810 only when neither condition holds, while its later extension-points paragraph and §12 diagnostic description warn whenever the slot is missing. Specify whether a declared dependency suppresses that warning.
  3. §§6 and 11, with the Lean catalog, use warning M04311 for a presentation facet section that references a missing field. §7 also uses M04311 for two presentation facets grouping one field into different sections of the same view. These are different triggers; keep M04311 for the cataloged missing-field condition and register a distinct first-release conflict code, or explicitly define one shared diagnostic condition with both cases and test it.
  4. §1 points to §10 for presentation-facet Authoring Shape, but that heading is §11. Correct the cross-reference and its projected claim.
  5. The RDF domain projection marks aspect.contribution, facet.appliesToKind, and facet.sections as required. Authored §11 shows these fields but gives no explicit omission rule or diagnostic for them. State which are required, define omissions, and align the field projection with those decisions.

Acceptance

Approve one mode and code contract; align RFC-0004, its companion Q&A, Lean catalog, claim/domain projections, and reference output. Add compiler tests for all three merge modes, conflicting overrides at equal and different specificity, cross-module priority conflicts, and extend with dependency, slot, both, or neither. Cover both M04311 conditions and the corrected presentation-facet source link. Check exact diagnostic identities and RDF query results before publishing the first spec artifact. Test omitted contribution, appliesToKind, and sections fields against the chosen field requirements.