diff --git a/.github/workflows/capability-contract-test.yml b/.github/workflows/capability-contract-test.yml new file mode 100644 index 00000000..0e9cb4dc --- /dev/null +++ b/.github/workflows/capability-contract-test.yml @@ -0,0 +1,28 @@ +name: Capability core contract +on: + pull_request: + paths: + - 'tools/lint.py' + - 'tools/tests/test_capability_contract.py' + - 'notations/schemas/**' + - 'notations/vocabulary.yaml' + - 'notations/views/diagrams/05-capability-map.md' + - 'notations/views/diagrams/10-applications.md' + - 'notations/examples/capability-map/**' + - 'tests/fixtures/capability-management-cycle/**' + - '.github/workflows/capability-contract-test.yml' + workflow_dispatch: +permissions: + contents: read + +jobs: + contract: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - run: pip install pyyaml + - name: Check positive, negative and compatibility cases + run: python -m unittest discover -s tools/tests -p test_capability_contract.py diff --git a/.github/workflows/capability-map-skill-test.yml b/.github/workflows/capability-map-skill-test.yml new file mode 100644 index 00000000..e01809c9 --- /dev/null +++ b/.github/workflows/capability-map-skill-test.yml @@ -0,0 +1,21 @@ +name: Capability-map skill +on: + pull_request: + paths: + - 'transitrix/skills/render-dsm-capabilities-html/**' + - '.github/workflows/capability-map-skill-test.yml' + workflow_dispatch: +permissions: + contents: read +jobs: + renderer: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Run renderer regression checks + run: python3 transitrix/skills/render-dsm-capabilities-html/scripts/test_render.py + - name: Check portable package + run: python3 transitrix/skills/render-dsm-capabilities-html/scripts/test_package.py diff --git a/.github/workflows/document-renderer-test.yml b/.github/workflows/document-renderer-test.yml index 392649cb..79e6cd0a 100644 --- a/.github/workflows/document-renderer-test.yml +++ b/.github/workflows/document-renderer-test.yml @@ -67,3 +67,9 @@ jobs: - name: Run full-run end-to-end test run: node packages/document-renderer/tests/test_full_run.mjs + + - name: Run paged-media CSS tests + run: node packages/document-renderer/tests/test_paged_media_css.mjs + + - name: Run snapshot caption tests + run: node packages/document-renderer/tests/test_render_vivliostyle.mjs diff --git a/.github/workflows/public-surface-hygiene.yml b/.github/workflows/public-surface-hygiene.yml index fe94c1b1..29d43e62 100644 --- a/.github/workflows/public-surface-hygiene.yml +++ b/.github/workflows/public-surface-hygiene.yml @@ -53,6 +53,7 @@ name: Public-surface hygiene on: pull_request: + types: [opened, synchronize, reopened, edited] push: branches: [main] @@ -65,6 +66,11 @@ jobs: with: fetch-depth: 0 + - name: Check declared repository paths + run: | + node scripts/check-publish-manifest.mjs + node --test scripts/check-publish-manifest.test.mjs + - name: Scan diff and PR metadata for blocklisted vocabulary shell: bash env: @@ -228,7 +234,7 @@ jobs: fi if [ "$fail" -ne 0 ]; then - echo "Neutralize the matched content (use neutral wording such as 'the maintainer' / 'internal automation') and re-push. Note that PR metadata is read on push - editing a title or body does not re-run this check, so an empty commit is needed to re-trigger it. The matched terms are deliberately not printed; refer to the file path above and grep your local diff against the blocklist." + echo "Neutralize the matched content (use neutral wording such as 'the maintainer' / 'internal automation') and re-push. Editing a PR title or body automatically re-runs this check against the updated metadata. The matched terms are deliberately not printed; refer to the file path above and grep your local diff against the blocklist." exit 1 fi echo "OK - no internal-vocabulary matches on the diff, PR metadata, or a commit message." @@ -539,3 +545,29 @@ jobs: exit 1 fi echo "OK - work-item reference guard self-test passed (4 positive, 3 negative)." + + - name: Record scanned pull request subject + if: github.event_name == 'pull_request' + shell: bash + run: | + python3 - <<'PYTHON' + import hashlib + import json + import os + from pathlib import Path + + # Bind this execution to the event metadata used by the scans above. + # A later metadata edit needs a new matching successful execution. + event = json.loads(Path(os.environ['GITHUB_EVENT_PATH']).read_text()) + pull = event['pull_request'] + subject = { + 'schema': 'public-hygiene-subject/v1', + 'number': pull['number'], + 'head': pull['head']['sha'], + 'base': pull['base']['sha'], + 'title': pull['title'], + 'body': pull.get('body') or '', + } + encoded = json.dumps(subject, sort_keys=True, separators=(',', ':')).encode() + print('HYGIENE_SUBJECT_SHA256=' + hashlib.sha256(encoded).hexdigest()) + PYTHON diff --git a/.github/workflows/release-drift-check.yml b/.github/workflows/release-drift-check.yml index 5e8c5994..61afecec 100644 --- a/.github/workflows/release-drift-check.yml +++ b/.github/workflows/release-drift-check.yml @@ -10,16 +10,39 @@ on: schedule: - cron: '0 9 * * 1' workflow_dispatch: {} + pull_request: + paths: + - '.github/workflows/release-drift-check.yml' + - 'scripts/release-drift.cjs' + - 'scripts/release-drift.test.cjs' permissions: contents: read - issues: write env: THRESHOLD: 50 +concurrency: + group: release-drift-${{ github.ref }} + cancel-in-progress: false + jobs: + test: + name: Release reminder regression tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22' + - run: node --test scripts/release-drift.test.cjs + check: + if: github.event_name != 'pull_request' + needs: test + permissions: + contents: read + issues: write name: Check commits since last tag runs-on: ubuntu-latest @@ -43,62 +66,13 @@ jobs: echo "skip=false" >> "$GITHUB_OUTPUT" echo "Commits since $LAST_TAG: $COUNT (threshold: $THRESHOLD)" - - name: Open or update reminder issue - if: steps.drift.outputs.skip != 'true' && steps.drift.outputs.count > env.THRESHOLD + - name: Reconcile release reminder + if: steps.drift.outputs.skip != 'true' uses: actions/github-script@v7 env: COUNT: ${{ steps.drift.outputs.count }} TAG: ${{ steps.drift.outputs.tag }} with: script: | - const count = parseInt(process.env.COUNT); - const tag = process.env.TAG; - const threshold = parseInt(process.env.THRESHOLD); - const label = 'needs:release'; - - // Ensure label exists - try { - await github.rest.issues.getLabel({ - owner: context.repo.owner, repo: context.repo.repo, name: label, - }); - } catch { - await github.rest.issues.createLabel({ - owner: context.repo.owner, repo: context.repo.repo, - name: label, color: 'e11d48', - description: 'A release tag is overdue', - }); - } - - // Find an existing open drift-reminder issue - const existing = await github.rest.issues.listForRepo({ - owner: context.repo.owner, repo: context.repo.repo, - labels: label, state: 'open', - }); - - const body = `**${count} commits** on \`main\` since \`${tag}\` — exceeds the ${threshold}-commit reminder threshold.\n\nRun through \`RELEASING.md\` checklist to cut the next release.\n\n_Updated by the weekly release-drift-check workflow._`; - - if (existing.data.length > 0) { - const issue = existing.data[0]; - await github.rest.issues.update({ - owner: context.repo.owner, repo: context.repo.repo, - issue_number: issue.number, - title: `[reminder] Cut a new release — ${count} commits since ${tag}`, - }); - await github.rest.issues.createComment({ - owner: context.repo.owner, repo: context.repo.repo, - issue_number: issue.number, body, - }); - core.notice(`Updated existing reminder issue #${issue.number}`); - } else { - const created = await github.rest.issues.create({ - owner: context.repo.owner, repo: context.repo.repo, - title: `[reminder] Cut a new release — ${count} commits since ${tag}`, - body, labels: [label], - }); - core.notice(`Opened reminder issue #${created.data.number}`); - } - - - name: All good - if: steps.drift.outputs.skip != 'true' && steps.drift.outputs.count <= env.THRESHOLD - run: | - echo "Drift is ${{ steps.drift.outputs.count }} commits — within threshold ($THRESHOLD). No reminder needed." + const reconcile = require('./scripts/release-drift.cjs'); + await reconcile({github, context, core, env: process.env}); diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 38616a1a..4356f70c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ For each issue, include the file path or section reference, what you observed, a 4. **Run the relevant validators locally, before opening the PR.** This repo's own gate is not a single command — `.validators/lint.py` is what an *adopter* repo runs against its `canon/`; this repo has no `canon/` of its own to validate. What CI actually runs here, by what you touched: - Any `notations/**` spec or example, or `transitrix/skills/onboard/templates/**` — `node scripts/check-notations.mjs` (mechanical invariants: example extensions, `notation:` headers, internal link resolution, version-pin consistency). - A single view notation file (`*.transitrix.yaml`) — `npx @transitrix/cli validate ` (`npx.cmd` on Windows PowerShell with a restricted execution policy). - - `tools/lint.py` itself — the encoding regression test in `.github/workflows/lint-encoding-test.yml`. + - `tools/lint.py` itself — the encoding regression test in `.github/workflows/lint-encoding-test.yml`; for capability-map contracts also run `python -m unittest discover -s tools/tests -p test_capability_contract.py` (schema/vocabulary parity, native fixtures and negative controls). - A Claude Code Skill under `transitrix/skills//` — see "Adding or changing a Skill" below. - Anything else — check `.github/workflows/` for a job whose `paths:` trigger matches the files you touched; most packages and skills carry their own targeted test workflow. 5. **Update related docs.** If your change affects naming, layout, or rules, update the relevant file(s) under `method/` (naming: `method/03-modelling.md`; layout: `method/02-repository.md`), `method/00-glossary.md`, and `README.md` as needed. @@ -49,6 +49,10 @@ A Skill is a packaged Claude Code capability under `transitrix/skills//`, Add supporting material only as the skill needs it, following existing precedent: `templates/` for scaffolded files (`onboard/templates/`), `prompts/` for multi-step prompt sequences (`ingest/prompts/`, `reg-intel/prompts/`), `schemas/` for JSON Schema the skill validates against, `tests/` for a deterministic integrity test (`onboard/tests/`, `knowledge-store/tests/`). +Portable Agent Skills may nest runtime-specific trigger/version fields under +`metadata` when their host rejects unknown top-level fields. Their README must +state the input/runtime compatibility rather than implying a released contract. + **Changing an existing skill:** 1. Read the skill's `SKILL.md` and `README.md` in full before editing — the two must stay consistent with each other and with the skill's actual behaviour. @@ -66,7 +70,7 @@ Add supporting material only as the skill needs it, following existing precedent | Touching | Run | |---|---| -| Any skill's `SKILL.md`/`README.md` prose | No dedicated linter for this tree — `node scripts/check-notations.mjs`'s link check is scoped to `notations/**/*.md` only, so check relative links by hand. | +| Any skill's `SKILL.md`/`README.md` prose | `node scripts/check-notations.mjs` and `node --test scripts/check-notations.test.mjs` — shared links, example IDs and layer trees, including installed onboarding guide paths and fixture-root links. | | `onboard`'s family-selection matrix or `templates/` | `node scripts/check-skill-cheatsheet.mjs` | | `onboard`'s scaffold logic | `python transitrix/skills/onboard/tests/test_skill_integrity.py` | | `knowledge-store`'s linter or pattern doc | the test(s) under `transitrix/skills/knowledge-store/tests/` | diff --git a/README.md b/README.md index cf9a4cc0..0627f0a5 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ New to the ideas behind it? Read **[`method/01-foundations.md`](method/01-founda ## Documentation +- **[Semantic Standards Profile](method/semantic-standards-profile.md)** — scopes, identities, provenance, validation claims and compatibility for semantic interoperability; links the [ArchiMate differences register](docs/standards-review/archimate-differences.md) and [non-normative review](docs/standards-review/README.md). - **[ArchiMate 3.2 cheat sheet](https://transitrix.com/library/archimate-cheat-sheet/?utm_source=methodology-readme)** — elements by layer and aspect, relationships, and a printable PDF. - **[`GETTING_STARTED.md`](GETTING_STARTED.md)** — a first modelling session, step by step, illustrated against the `acme-corp` worked example. - **[`WALKTHROUGH.md`](WALKTHROUGH.md)** — a guided tour of the `acme-corp` worked example, read as one story. diff --git a/docs/standards-review/README.md b/docs/standards-review/README.md new file mode 100644 index 00000000..b6ca3dc6 --- /dev/null +++ b/docs/standards-review/README.md @@ -0,0 +1,197 @@ +# Semantic and architecture standards review + +This review helps model authors, methodology maintainers and integration +implementers distinguish Transitrix's existing contracts from possible semantic +interchange profiles. It is **non-normative**. Recommendations below do not adopt +standards, change authoring rules, provide an exporter or establish conformance +or certification. YAML/Git authoring remains unchanged. + +For the bounded normative documentation contract and actual candidate dispositions, +see the [Semantic Standards Profile](../../method/semantic-standards-profile.md). +The findings and proposals below retain their reviewed baseline and are not +retroactively relabeled as implemented capabilities or adopted ontology choices. + +Read the [semantic evidence](semantic-evidence.md) for terminology, identity, +representation, validation and provenance; the [architecture evidence](architecture-evidence.md) +for architecture concepts and optional ontology/registry comparisons; and the +[ArchiMate differences register](archimate-differences.md) for individual mappings, +their benefits, restrictions and losses. Those documents retain their detailed +source registers and findings; this entry point reconciles their scope and proposals. + +## Revision and evidence boundary + +Both domain reviews assess **the same source baseline**: +[`8ca4eabf7666946ffb7a76eb579c31cb0ae3f327`](https://github.com/transitrix/methodology/tree/8ca4eabf7666946ffb7a76eb579c31cb0ae3f327), +observed October 10–11, 2026. Source section references in those reviews mean +that revision, even when a relative link opens a newer document. The semantic +review was delivered in [PR #647](https://github.com/transitrix/methodology/pull/647), +merge `e7002bcbf68329cb270e44158bcd2a486910fca9`; the architecture review and +differences register in [PR #646](https://github.com/transitrix/methodology/pull/646), +merge `165900cc4ce2abccdd63a850d404f63059aa4432`. + +Integration was checked against main +`087374122f72122f2d6d0a3b8db427091f748263` on October 21. The three review +documents are unchanged from their respective merges. This is not a claim that +every finding reassesses current implementation. The following relevant source +deltas remain outside the original comparison: + +| Changed area since the baseline | Integration consequence | +|---|---| +| `notations/CONTRACT.md` §7, `ELEMENT_PRIMITIVES.md`, `elements/17-relations.md`, `elements/19-actors.md`, `vocabulary.yaml` and the reports-to example | Main clarifies first-class temporal relations and adds person-to-person `reports_to`, evidence references and recurrence. SE-03 and AM-008/009 must be revisited for a future current-version mapping; the review does not claim an exhaustive current relation inventory. The source now states inclusive day windows; the older query example remains explicitly illustrative. | +| `packages/ingest-cli/src/canon.mjs` | Reporting records preserve identity, pair and window rather than deduplicating every relationship solely by kind/from/to. A future representation/round-trip test must include recurring reporting records and their evidence. | +| `packages/document-view-engine/src/evaluate.mjs` | Resolution follows canonical IDs, active relation selection and read failures more precisely. This does not implement SHACL, SPARQL or RDF interchange. Claims about a future adapter still need its own evidence. | + +Other entry points in the domain evidence registers retain the cited baseline; +later source additions do not silently become reviewed standards coverage. +No public namespace, ontology, shape suite or semantic endpoint is delivered by +these documents. The illustrative `https://example.org/review/` vocabulary is +an example, not a maintained Transitrix namespace. + +**Alignment** is a supported conceptual comparison. **Interoperability** needs +a defined transformation and tested losses. **Formal conformance** needs a named +subject, edition, target and all applicable requirements. **Certification** needs +its own scheme and evidence. Neither terminology nor passing repository checks +establishes the latter two. + +## Integrated standards matrix + +References prefixed **semantic** or **architecture** belong to the corresponding +document's source register; similarly named source keys are not interchangeable. +P1 means resolve before the affected interoperability claim, P2 a bounded follow-up, +and P3 optional research. These are recommendations, not delivery commitments. + +| Standard / edition and authoritative locator | Relevant area | Current status | Gap | Recommendation | Priority | +|---|---|---|---|---|---| +| RDF 1.1 Concepts (2014), semantic S1 §§3–4 | Identity, REL and dataset context | Graph-like source model, no reviewed RDF contract | Scoped IDs and qualified relations cannot become bare triples without loss | SE-02/03: persistent scoped identities and identified relation records | P1 | +| Turtle (2014), semantic S2 §§2, 5–6 | Graph serialization | YAML is not Turtle | One graph does not describe an entire dataset envelope | SE-03: optional graph serialization plus explicit dataset selection | P2 | +| JSON-LD 1.1 (2020), semantic S3 context and RDF relationship | Interchange | No reviewed versioned context | Coercion, lists, nulls and default values need a mapping | SE-03: version the context and test semantic reconstruction | P2 | +| SKOS (2009), semantic S4 §§3–5, 7–8, 10 | TERM, taxonomy and retrieval | Partial conceptual alignment, no declared thesaurus | Concept scheme, multilingual designation and mapping rules are absent | SE-01/07: optional concept projection; preserve enterprise identity | P1 | +| OWL 2 / OWL 2 RL (2012), semantic S5 Structural §§5, 9; Profiles §§4.2–4.3 | Ontology and inference | No reviewed ontology or RL conformance target | TYPE names do not define class extensions or entailment | SE-01/04: no inference by default; optional separately tested profile | P2 | +| SHACL 1.0 (2017), semantic S6 §§2–5 | Graph constraints | Existing validators are not SHACL engines | Targets, closure and diagnostic mapping are unspecified | SE-04: isolate shapes, inference and admission | P1 | +| SPARQL 1.1 Query (2013), semantic S7 §§8–9, 13, 16–17 | Scoped questions and reports | Illustrative queries, no query-service contract | Dataset completeness, time and entailment affect answers | SE-05: explicit datasets and positive/negative/unknown results; Update/Protocol remain unevaluated | P1 | +| ISO 704:2022, semantic S8 catalogue scope | Definitions/designations | Partial local editorial support; clauses unevaluated | Full normative text unavailable | SE-07: original local guidance, without an ISO conformance claim | P1 | +| ISO 1087:2019, semantic S9 catalogue scope | Terminology vocabulary | Normative correspondence unevaluated | Full definitions unavailable; matching names are insufficient | SE-07: defer clause correspondence pending authorized access | P2 | +| ISO 25964-1:2011, semantic S10 catalogue scope | Retrieval thesaurus | Conditional applicability; clauses unevaluated | No reviewed thesaurus profile or full normative text | SE-07: optional retrieval profile, not a prerequisite for every glossary | P2 | +| ISO 25964-2:2013, semantic S11 catalogue scope | Cross-vocabulary mapping | Conditional applicability; clauses unevaluated | Catalogue bindings do not establish thesaurus equivalence | SE-02/07: curated, versioned mappings with explicit strength | P2 | +| PROV-O (2013), semantic S12 §§3–4 | Assertion origins and activities | Local evidence fields and a document checker exist | Per-fact provenance is not uniform or verified by its presence | SE-06: distinguish declared, observed, inferred and proposed evidence | P1 | +| Dublin Core Terms (2020), semantic S13 property entries | Resource/document metadata | Optional descriptive mapping | Resource identity and field crosswalk need scope | SE-06: descriptive metadata without certification assertions | P2 | +| DCAT 3 (2024), semantic S14 §6 | Actual dataset publication | Conditional, no reviewed publication profile | Dataset/distribution/service semantics are not defined by having a catalogue ID | SE-08: use only for an actual dataset consumer; do not invent a service | P3 | +| ISO/IEC/IEEE 42010:2022, architecture S10 §§3–5 | Architecture descriptions and views | Nine conceptual mappings; §§6–8 conformance unevaluated | Full AD/ADF/ADL requirements unavailable | ARC-001–009: optional evidence package, explicit non-equivalences | P1 | +| ISO/IEC/IEEE 42020:2019, architecture S20 scope/contents | Architecture processes | Relevant local process records, no demonstrated standard outcomes | Full activities/outcomes unavailable | ARC-010: one process/outcome evidence assessment before claims | P2 | +| ISO/IEC 21838-1:2021, architecture S38 scope | Top-level ontology requirements | No Transitrix TLO declared; full requirements unevaluated | Typed enterprise records are not a formal TLO | ARC-011: defer adoption; select a use case first | P3 | +| ISO/IEC 21838-2:2021 / BFO-2020, architecture SBFO scope | Plan, execution, actor and role | Optional candidate; axioms unevaluated | No established category/axiom mapping | ARC-012: compare cases without retyping core | P3 | +| ISO/IEC 21838-3:2023 / DOLCE, architecture SDOLCE introduction | Same areas and contextual meaning | Optional alternative; axioms/conformity unevaluated | No interpretation or BFO equivalence established | ARC-013: assess independently, preserve counterexamples | P3 | +| OMG ODM 1.1 (2014), architecture SODM §§1–2, Table 2.1 | Ontology interchange | Applicability assessed from public normative text; no package conformance target | No selected package or conformant XMI mapping | ARC-014: choose direction/package before an interchange claim | P2 | +| ArchiMate 3.2 (2022), architecture SAM / N221 | Elements, relations and views | Starting foundation with source-identified differences | Full relation admissibility/derivation inaccessible in this review | ARC-015 and AM-001–014: retain useful differences and disclose loss | P1 | +| ISO/IEC 11179-1/-3/-6/-31:2023, architecture S79 scope/accessible registration introduction | Catalogue/metadata registry | Registry-like functions, no demonstrated MDR conformance | Full selected-part requirements unevaluated; other parts explicitly deferred | ARC-016: bounded profile; preserve local IDs alongside external registration | P2 | + +The complete authoritative source URLs, editions and access limits are retained +in the [semantic source register](semantic-evidence.md#authoritative-source-register) +and [architecture source register](architecture-evidence.md#sources-and-access). +Access was recorded October 11. ISO abstracts, previews and ArchiMate reference +cards are not substitutes for inaccessible full requirements. No purchase or +reconstructed clause is required to retain a named unknown. + +## Coverage of the requested semantic questions + +| Question | Finding and evidence | Preserved boundary | +|---|---|---| +| 1. Concept, class and individual | SE-01; semantic T1/T8, S4/S5; AM-003 | `skos:Concept`, `owl:Class` and an instance play distinct roles. Labels do not establish identity; deliberate metamodeling needs its own interpretation/tests. | +| 2. Stable identity, IRIs and catalogue scope | SE-02; semantic T2/T8; ARC-016 | Persistent resource identity differs from file path, snapshot, local ID and central binding. Namespace ownership is an unresolved design choice. | +| 3. Faithful graph representation | SE-03; semantic T2/T3/T9; AM-008/009 | Preserve relation identity, lifecycle, admission, history, context and missing/null/default distinctions. No lossless converter is claimed. | +| 4. Constraints versus inference | SE-04, shapes H1/H2; semantic T3/T6 | Structural shape success is not inference, admission or complete existing-validator coverage. | +| 5. Competency questions | SE-05, Q1–Q3 and explicit QD dataset | Check time/provenance/label cases and counterexamples; denied or incomplete scope remains unknown, not an empty successful answer. | +| 6. Architecture-description concepts | ARC-001–009, table below | Assess each direction and loss; do not equate names or editions. | +| 7. Fact provenance | SE-06; semantic T4/T7; ARC-003 | Source/agent/time/version and fact basis remain distinct from admission and document-generation evidence. | +| 8. Terminology discipline | SE-07; semantic T1; AM-003 | Concept/context, definition, designation, relations and examples/non-examples are explicit editorial candidates; ISO clauses remain unevaluated. | + +The [nine-concept mapping](architecture-evidence.md#nine-architecture-concepts) +provides exact baseline paths, standard locators and direction/loss for every row: + +| Required concept | Finding | Material non-equivalence | +|---|---|---| +| Entity of Interest | ARC-001, 2022 §3.12 | Repository boundary alone does not identify subject/environment. | +| Architecture | ARC-002, §3.2 | Stored descriptions are not the enterprise itself. | +| Architecture Description | ARC-003, §3.3 | A repository or render alone is not a scoped, revision-bound AD. | +| Stakeholder | ARC-004, §3.17 | Identity and stake profile remain distinct. | +| Concern | ARC-005, §3.10 | Free text is not addressable concern-to-view coverage. | +| Viewpoint | ARC-006, §3.8 | A notation/filter is not a complete concern-framing argument. | +| View | ARC-007, §3.7 | Configuration, selected model and rendered evidence differ. | +| Architecture Model | ARC-008, §3.19 view-component comparison | The requested label is not asserted to be the 2022 defined term; no silent 2011 equivalence. | +| Model Kind | ARC-009, §3.15 | Filename/notation alone does not establish interpretation and conventions. | + +## Recommended dispositions for a subsequent profile + +Every row below is a **recommendation awaiting a recorded decision**. Retain, +change, defer and reject describe the proposed disposition of a candidate, not +standards adoption. C1–C6 are the semantic review's candidates; REC-01–06 are the +architecture review's. Their detailed exceptions remain in those documents. + +| Candidate area | Proposed disposition and rationale | Proposed obligation, scope and exception | +|---|---|---| +| RDF 1.1 / stable IRIs / named graphs | **Change** universal RDF adoption to an optional, versioned exchange profile; **retain** identity preservation within that profile (SE-02/03, C1/C2) | Candidate MUST preserve IDs/scopes and declare loss; SHOULD use named graphs when context/provenance needs them. No requirement to replace canonical YAML/Git. Namespace policy needs a decision. | +| Turtle and JSON-LD | **Change** universal format mandates to declared exchange targets (SE-03, C2) | Candidate MUST test the selected mapping/context; a lossy projection MAY omit content only with an explicit loss report. Turtle alone cannot carry a whole dataset envelope. | +| SKOS / ISO 25964 | **Change** blanket taxonomy requirements to an opt-in retrieval concept profile (SE-01/07, C1/C5) | Candidate MUST separate concept/class/object identity; SHOULD review definition/designation/examples. ISO normative claims remain deferred pending full evidence. Do not duplicate enterprise definitions as TERM. | +| OWL 2 / RL | **Defer** mandatory ontology/RL adoption (SE-04, A3; REC-05) | Candidate MAY evaluate bounded inference separately, with rejected non-RL axioms and a declared regime. No inference by default; labels/parent links never justify class or identity equivalence. | +| SHACL 1.0 | **Change** universal tool adoption to optional exchange constraints (SE-04, C3) | Candidate MUST distinguish shape, inference and admission; SHOULD retain versioned diagnostic identity. No exception permits claiming an unevaluated check passed. | +| SPARQL 1.1 | **Change** blanket support to scoped competency questions (SE-05, C3) | Candidate MUST state dataset/time/entailment and report incomplete scope as unknown. Query examples do not commission an endpoint, Update or Protocol support. | +| ISO 704 / ISO 1087 | **Change** ISO MUST/SHOULD wording to original terminology guidance; **defer** normative correspondence (SE-07, C5) | Candidate SHOULD document concept, definition, designation and counterexamples. MAY keep this editorial until a schema is approved. No inaccessible clause is reconstructed. | +| ISO 42010 / ISO 42020 | **Retain** explicit conceptual alignment with edition/loss limits; **defer** conformance/process mandates (ARC-001–010, REC-01/02) | Candidate MUST bound any standards claim; SHOULD try an optional AD evidence companion. A small exploratory model need not opt in; mandatory new fields need migration. | +| PROV-O | **Change** generic SHOULD to an optional fact-provenance mapping with explicit trust limits (SE-06, C4) | Candidate MUST distinguish declaration/observation/inference/proposal and admission. Legacy unknowns MAY remain unknown. Hash matches cannot establish generation. | +| Dublin Core / DCAT 3 | **Retain conditionally**, only for actual described documents/datasets (SE-06/08, C6) | Candidate MAY add metadata; SHOULD omit unsupported service/conformance claims. Non-publishing adopters have no dataset-metadata requirement. | +| ISO 21838 / specific upper ontology | **Defer** the preliminary SHOULD; **reject automatic core adoption** (ARC-011–013, REC-05) | Candidate MAY evaluate BFO and DOLCE independently only for useful competency questions. A specific adoption requires a dedicated decision; neither is selected here. | +| ArchiMate / ODM mappings | **Retain** optional mapping, **reject** blanket equivalence (ARC-014/015, REC-03/04) | Candidate MUST disclose direction, unmapped content and loss. Preserve useful departures unless a modeling case justifies change; no lossless claim without a round-trip witness. | +| ISO 11179 applicability | **Defer** family-wide adoption; assess a bounded registry profile (ARC-016, REC-06) | Candidate SHOULD distinguish registration, concepts, names and data domains. Local-only catalogues MAY keep current IDs; no external registration is required. | + +The detailed differences register is the recommended single authoritative mapping +home. Its [proposed maintenance rule](archimate-differences.md#proposed-maintenance-rule) +would require a changed difference to update its stable ID entry, edition, source, +rationale, status, direction/loss and compatibility in the same delivery. It would +keep deprecated IDs and distinguish existing observations from accepted changes. +This review recommends that rule; a merge alone does not adopt it. ArchiMate is +the starting foundation, not a reason to discard useful identity, time or evidence. + +## Decisions, compatibility and bounded follow-up + +Decision topics below consolidate the domain proposals rather than create accepted +ADRs. Each needs a recorded choice by the applicable methodology decision owner, +with the named consumer reviewers. No agent or tool is assigned new authority. + +| Topic / source | Options and recommendation | Proposed decision owner / required evidence | +|---|---|---| +| Resource identity, semantic A1 | Shared IDs, catalogue-scoped persistent IRIs, or snapshot-only identity. Recommend persistent scoped resources plus separate snapshots. | Methodology governance with catalogue maintainers; demonstrate collisions, relocation, contained-object promotion and namespace ownership/deprecation. | +| Relation/time representation, A2 | Bare edges, identified records, or records plus shortcuts. Recommend records with explicit time/null/default/loss policy. | Metamodel maintainers with report/export implementers; preserve parallel/recurring relations and endpoint validity. | +| Inference/validation, A3 | None, optional bounded RL, or unrestricted OWL. Recommend no inference by default and separately tested opt-in RL. | Semantic-tool/validator maintainers; syntax/entailment counterexamples, separated graphs and unchanged diagnostic meanings. | +| Terminology, A4 | Expand core TERM, add an optional package/projection, or editorial guidance. Recommend guidance first. | Methodology governance with terminology reviewers; definition/examples and multilingual/duplicate-TERM cases; authorized ISO evidence or explicit unknowns. | +| Fact evidence, A5 | Artifact-only, per-fact or graph-level provenance. Recommend per-fact evidence when sources differ, homogeneous graph evidence otherwise. | Evidence/document maintainers with methodology governance; four fact bases, authorization and missing/denied evidence; preserve document-checker boundaries. | +| AD evidence companion, architecture decision table | Prose-only, optional structured profile, or mandatory core. Recommend companion first, then a representative structured case. | Methodology maintainers with authors/renderers; nine concepts and 2022 perspectives/aspects/correspondences. | +| Register authority/maintenance, architecture decision table | Glossary-only, one detailed register plus links, or duplicated consumer tables. Recommend the single detailed register and same-change updates. | Methodology maintainers with semantic-tool implementers; existing/proposed states, known losses and stable-ID lifecycle. | +| Ontology/registry, architecture decision table | No profile, optional bounded mappings, or mandatory upper ontology. Recommend defer until a competency question needs one. | Methodology governance with ontology/catalogue implementers; independent BFO/DOLCE cases, selected ODM/11179 target and rejected collapses. | + +Existing source contracts and consumers remain authoritative. Optional documentation +and separately described outputs can be additive. Changed identity minting, required +fields, relation direction, TYPE meaning, alias policy or diagnostic meanings can +break resolvers, ingest, diagrams, reports and historical queries. Such changes need +consumer tests, a methodology-version decision and an explicit migration under +[the compatibility contract](../../notations/CONTRACT.md#10-versioning-and-compatibility). +This review neither selects that version nor changes a schema. + +| Consolidated proposal and scope | Existing findings / dependency | Acceptance evidence | Compatibility / recommended priority | +|---|---|---|---| +| Qualify introductory relation and broad alignment wording | Architecture B-01; AM-012/013; canonical element/REL contracts | Distinguish introductory and canonical forms, qualify Concern/edition claims and link the detailed register without claiming adoption. | Documentation-only / P1 | +| Define identity and faithful exchange contract | Semantic B1/B2, A1/A2; architecture B-04 and applicable source/license decisions | Two identical local IDs remain distinct; preserve recurring/parallel RELs, history, lifecycle, admission, ordering and null/default/unknown extensions; explicit loss for each format. | Optional specification additive; identity/storage changes breaking / P1 | +| Define validation, query and evidence adapters | Semantic B3/B4, A3/A5; preceding identity/representation contract | H1/H2 and Q1–Q3 positives/negatives; endpoint time, complete/partial/denied population, four fact bases and inference isolation; versioned diagnostics. | Optional adapters additive; new mandatory gates breaking / P1 | +| Demonstrate one AD package and one architecture cycle | Architecture B-02/B-03; companion decision, full applicable 42010/42020 requirements for conformance claims | One subject, two audiences and concern coverage; process outcomes backed by records, gaps or explicit non-applicability. | Optional evidence companion / P2 | +| Review terminology/schema correspondence | Semantic B5, A4; authorized evidence or named limits | Multilingual labels, non-circular definitions, examples/non-examples, duplicate-TERM rejection and non-equivalent mappings. | Editorial additive; mandatory schema/labels need migration / P2 | +| Evaluate ontology/registry and dataset metadata only for consumers | Architecture B-05; semantic B6; approved use case and selected profile | Plan/execution/context counterexamples; named target and losses; one real Dataset/Distribution without invented services. | Optional research/metadata / P3 | + +These are bounded proposals, not executable implementation commissions. The domain +reviews retain their stable gap/backlog IDs and detailed examples. Proposed shape +and query cases assess only the stated hypothetical profile; passing them cannot +prove current product support, standards conformance, admission or publication. + +Review acceptance can confirm evidence coverage while leaving the named design +decisions and inaccessible requirements unresolved. A subsequent normative profile +must record each candidate's actual disposition, scope, edition, exception and +evaluation method. It must not promote the recommendations here to implemented +RDF/OWL/SHACL/SPARQL capabilities or finalize unresolved compatibility choices. diff --git a/docs/standards-review/archimate-differences.md b/docs/standards-review/archimate-differences.md new file mode 100644 index 00000000..d9840e5e --- /dev/null +++ b/docs/standards-review/archimate-differences.md @@ -0,0 +1,416 @@ +# ArchiMate differences register + +This **non-normative review** records observed Transitrix choices and proposed +follow-ups for model authors and semantic-tool implementers. ArchiMate is the +starting foundation; fidelity is one design consideration alongside useful +modeling, precise meaning, clear authoring and verifiable behavior. + +## Comparison basis and status + +This is the authoritative detailed differences register for the +[Semantic Standards Profile](../../method/semantic-standards-profile.md). +SSP-10 requires an accepted change affecting a difference to update its stable +entry in the same delivery: edition/concept, source/revision, exact difference, +benefit/tradeoff, status, direction/loss, compatibility/consumers and decision +reference or explicit unknown. Retired IDs remain with successor notes. +The original comparison below remains a non-normative observation at its stated +baseline; assigning this register its home does not accept every proposed change. + +Profile integration resolves AM-012/013's wording concerns in +[modelling guidance](../../method/03-modelling.md), the +[glossary](../../method/00-glossary.md#archimate-32-alignment) and the +[stakeholder specification](../../notations/elements/20-stakeholders.md). +Their historical findings remain for traceability; no parser, TYPE or relation +semantics is changed by those qualifications. + +All Transitrix citations refer to +[`8ca4eabf7666946ffb7a76eb579c31cb0ae3f327`](https://github.com/transitrix/methodology/tree/8ca4eabf7666946ffb7a76eb579c31cb0ae3f327), +observed on 2026-10-10 and rechecked against main on 2026-10-11 without a delta. +The comparison edition is **ArchiMate 3.2**, as named in the baseline README and +glossary. This does not select a newer edition or an exchange format. + +The primary conceptual source is The Open Group's **N221, ArchiMate 3.2 +Specification Reference Cards (2022)**, [accessible copy hosted by a third +party](https://barbierdarnal.com/Enterprise_Architect/Clinique/ArchiMate_3.2_Specification_notation.pdf). +Card-page references below count the cover as PDF page 1. The cards establish +concept names and short definitions, not the full normative relationship matrix. +The [full 3.2 specification](https://pubs.opengroup.org/architecture/archimate32-doc/) +required sign-in when accessed on **2026-10-11**. Its detailed admissibility, +derivation and conformance requirements are **unevaluated** here. No clause +numbers are inferred from the cards. The +[publisher's access information](https://www.opengroup.org/archimate-licensed-downloads) +and the existing +[Transitrix cheat sheet](https://transitrix.com/library/archimate-cheat-sheet/?utm_source=methodology-standards-review) +remain useful entry points; the cheat sheet is not normative evidence. + +“Existing” means observed in the baseline specification, including draft specs; +it does **not** mean implemented in every validator or accepted through a verified +ADR. “Proposed” means a recommendation made here. “Accepted” would require a +decision citation; “deprecated” applies only to the explicitly identified aliases. +There are no newly accepted semantics in this register. Absent public decision +evidence is recorded as **unknown**, rather than reconstructed from old work items. + +T → A means Transitrix to ArchiMate; A → T means the reverse. Mapping suggestions +are conceptual, not implemented transforms. No entry establishes lossless +exchange, formal conformance or certification. Read the +[architecture evidence review](architecture-evidence.md) for standards scope, +the nine architecture concepts and compatibility-separated recommendations. + +## Existing differences + +### AM-001 — Layer placement is a Transitrix organization scheme + +- **Reference:** ArchiMate 3.2 N221 pp. 4–5, Meaning, Capability and Course of Action. + **Evidence:** [Primitives](../../notations/ELEMENT_PRIMITIVES.md) §§6, 7.19, 7.30; + [glossary](../../method/00-glossary.md), “Layers (ArchiMate)”; [capability map](../../notations/views/diagrams/05-capability-map.md) §§2, 4, 6. +- **Status/class:** existing placement/representation change. CAPABILITY and TERM + reside in the business layer; SCENARIO resides in implementation. The reference + cards place Capability/Course of Action under strategy and Meaning under motivation. +- **Benefit/tradeoff:** business authors find capabilities and vocabulary together; + consumers cannot use a folder number as an ArchiMate layer classifier. Capability + V/H addresses additionally encode a Transitrix hierarchy, not a standard type. +- **Mapping/loss:** T → A needs an explicit TYPE-to-concept table, independently of + folder and ID. A → T must select a local location/address; folder round trips are + not preserved by the standard concept alone. Preserve the original identity. +- **Compatibility/decision:** documenting placement is additive; moving folders or + renumbering capabilities can break catalogue consumers and links. Governing ADR + for the combined layer correspondence: **unknown**. Proposed disposition: keep + storage organization unless a concrete consumer case warrants migration. + +### AM-002 — Identity and stakeholder interest are separate records + +- **Reference:** ArchiMate 3.2 N221 pp. 3, 6, Stakeholder, Business Actor and Business Role. + **Evidence:** [Actors](../../notations/elements/19-actors.md) §§1–3; + [Stakeholders](../../notations/elements/20-stakeholders.md) §§1–3, 5–6. +- **Status/class:** existing extension/restriction of the representation. Every + STAKEHOLDER requires an ACTOR identity; ACTOR distinguishes `person`, + `business_unit` and `system`. Stake-specific concern/interest/influence are kept + separately, and `stakeholding` has a restricted target set. +- **Benefit/tradeoff:** one external service owner can carry several stakes without + duplicating identity. Import requires more information than a stakeholder label; + a software `system` actor must not be classified as Business Actor solely by ID. +- **Mapping/loss:** T → A projects a stake to Stakeholder and evaluates identity + separately; flattening loses the actor/stake linkage and engagement history. + A → T needs an explicit actor binding and target classification. No general + lossless mapping of arbitrary stakeholders is demonstrated. +- **Compatibility/decision:** relaxing `actor` or merging TYPEs changes admission + and downstream joins. The specifications record an identity/stake decision dated + **2026-05-29**; a separately inspectable accepted ADR is **unknown**. Proposed + disposition: retain the split; report absent identity instead of inventing one. + See ARC-004/005 in the [architecture review](architecture-evidence.md). + +### AM-003 — TERM is a constrained vocabulary entry + +- **Reference:** ArchiMate 3.2 N221 p. 4, Meaning. + **Evidence:** [Primitives](../../notations/ELEMENT_PRIMITIVES.md) §7.30 and §9 + (`TERM-001/002`, `ELEM-ALIAS-001`); [glossary report](../../notations/views/reports/32-glossary.md) §§1, 6. +- **Status/class:** existing restriction and domain-friendly naming. TERM is a + standalone name/definition entry with aliases and provenance, prohibited from + duplicating an already modeled object's vocabulary. Meaning is a broader + contextual interpretation concept, so the glossary's correspondence is not identity. +- **Benefit/tradeoff:** the glossary can combine definitions from actual objects + and terms without duplicate masters. Contextual homonyms cannot be imported by + ignoring the catalogue collision rules. +- **Mapping/loss:** T → A can offer a Meaning candidate, with context and provenance + made explicit; A → T is partial because not every contextual interpretation is + a distinct admissible TERM. Standard concept alone loses local uniqueness and + derived-source constraints. +- **Compatibility/decision:** additive mapping documentation; weakening uniqueness + or recasting all object names as TERM breaks vocabulary admission and recognition. + Accepted ADR: **unknown**. Proposed disposition: preserve the existing rule and + investigate contextual naming only through the bounded ISO 11179 profile (ARC-016). + +### AM-004 — ACTION supplies a multi-scale planning vocabulary + +- **Reference:** ArchiMate 3.2 N221 p. 12, Work Package and Deliverable. + **Evidence:** [Action](../../notations/elements/24-action.md) §§1–2; + [glossary](../../method/00-glossary.md), “ArchiMate 3.2 alignment”. +- **Status/class:** existing extension/profile of the intended Work Package + correspondence: Initiative, Programme, Project and Task scales, optional `type` + and `parent`, and a virtual portfolio root. `ACTIVITY` is a **deprecated alias** + in the baseline; this review does not change its acceptance window. +- **Benefit/tradeoff:** portfolio and project models share one primitive. A broad + initiative or unclassified action does not automatically supply the bounded work + evidence a Work Package interpretation needs. + [Primitives §6.1](../../notations/ELEMENT_PRIMITIVES.md) also absorbs Deliverable + into ACTION rather than registering it as an independent TYPE. Work and its result + therefore need separate interpretation even when carried by one local record. +- **Mapping/loss:** T → A is conditional on the action's actual scope and definition; + preserve scale separately and omit the virtual root as a data primitive. A → T + can retain a work package as an action but must not infer Project scale. Scale, + hierarchy conventions and alias diagnostics otherwise disappear. An ArchiMate + Deliverable cannot be equated to execution work solely because both map toward ACTION. +- **Compatibility/decision:** keep aliases/history versioned under + [CONTRACT §18.7](../../notations/CONTRACT.md#187-versioned-diagnostic-identity). + Renaming records or forcing a scale is breaking. Accepted ADR for this mapping: + **unknown**. Proposed disposition: document conditional mapping, not automatic renaming. + +### AM-005 — TARGET_STATE has a narrowed snapshot structure + +- **Reference:** ArchiMate 3.2 N221 p. 12, Plateau. + **Evidence:** [Primitives](../../notations/ELEMENT_PRIMITIVES.md) §7.18; + [relations](../../notations/elements/17-relations.md) §3, `target_state_satisfies_goal`. +- **Status/class:** existing restriction/extension. The snapshot has capability, + process and application lists, `base`/`target` classification, one live baseline + convention and separate goal-satisfaction RELs. An omitted `type` means target. +- **Benefit/tradeoff:** authors compare concrete solution compositions and trace + standing goals. The listed composition is narrower than an arbitrary architecture + state; technology detail or intermediate-stage distinctions need other evidence. +- **Mapping/loss:** T → A is a candidate Plateau plus preserved composition and + satisfaction metadata. A → T cannot assume the imported state fits those lists + or uniquely identifies the live baseline. Dropping classification or satisfaction + loses operational-versus-future meaning. +- **Compatibility/decision:** changing the default, uniqueness or lists affects + scenario readers and impact queries; requires explicit migration. Accepted ADR: + **unknown**. Proposed disposition: retain the useful restriction and state losses. + +### AM-006 — CHANGE does not require a pair of plateaus + +- **Reference:** ArchiMate 3.2 N221 p. 12, Gap (a difference between plateaus). + **Evidence:** [Primitives](../../notations/ELEMENT_PRIMITIVES.md) §§7.3–7.3.1. +- **Status/class:** existing changed semantics relative to the stated Gap mapping. + CHANGE describes a required delta, may decompose into changes, and may address + requirements/constraints. Its published fields do not require two TARGET_STATE + endpoints. +- **Benefit/tradeoff:** an obligation can be tightened before both architecture + states are modeled. This supports early change analysis but cannot establish the + two-state interpretation just from a CHANGE ID. +- **Mapping/loss:** T → A requires separately supported baseline/target evidence + before asserting a Gap correspondence; otherwise mark unmapped. A → T may record + the delta, but losing the plateau pair prevents reverse reconstruction. No pair + is inferred from `addresses` or `derived_from`. +- **Compatibility/decision:** a mapping report is additive; making two state + references mandatory would break existing changes and intake. Accepted ADR: + **unknown**. Proposed disposition: retain early modeling, qualify the equivalence. + +### AM-007 — SCENARIO is a particular path, not any strategy + +- **Reference:** ArchiMate 3.2 N221 p. 5, Course of Action. + **Evidence:** [Primitives](../../notations/ELEMENT_PRIMITIVES.md) §7.19; + [Scenarios report](../../notations/views/reports/11-scenarios.md). +- **Status/class:** existing restriction/extension. A scenario has non-empty + `pursues`, exactly one `arrives_at` target state, and ordered ACTION/CHANGE steps. +- **Benefit/tradeoff:** two alternative paths can reach the same state and be + compared. A broad approach without that destination/step structure is not yet a + Transitrix scenario, even when it is strategically meaningful. +- **Mapping/loss:** T → A offers a Course of Action interpretation with steps and + destination preserved separately. A → T needs explicit destination and intent; + no default is safe. Collapsing the path to one label loses ordering and alternatives. +- **Compatibility/decision:** broadening cardinality changes report and planning + consumers; no such change is proposed here. Accepted ADR: **unknown**. Proposed + disposition: explain the narrower path concept rather than remove its precision. + +### AM-008 — REL is an admitted, independently time-bounded fact + +- **Reference:** ArchiMate 3.2 N221 p. 2, relationships and connectors; compare + Assignment, Realization, Association and Serving as candidate interpretations. + Full 3.2 temporal customization/relationship rules remain unevaluated. + **Evidence:** [Relations](../../notations/elements/17-relations.md) §§1–3, 5; + [shared lifecycle](../../notations/CONTRACT.md) §7. +- **Status/class:** existing explicit temporal/admission extension and restricted + local relation vocabulary. `employment`, `stakeholding`, `hosts` and other kinds + carry their own windows; not all links are RELs, because some stable references + are inline. There is no blanket name-to-name relation equivalence. +- **Benefit/tradeoff:** service relocation or a person's changing engagement can be + reconstructed without replacing endpoint identity. Consumers must resolve a date + and understand inline versus first-class links. +- **Mapping/loss:** T → A selects the applicable slice and maps each kind separately; + export of only ordinary edges loses admission and temporal history. A → T needs + provenance/window information or an explicitly incomplete staging representation. + A generic Association can convey a link but not all of its local meaning. +- **Compatibility/decision:** deleting windows or changing kind endpoints breaks + temporal queries and validators. Accepted ADR covering a general ArchiMate mapping: + **unknown**. Proposed disposition: preserve the extension; require explicit loss + reporting rather than claim that ArchiMate forbids temporal metadata. + +### AM-009 — Consumption and need-trace relations cannot share a name mapping + +- **Reference:** ArchiMate 3.2 N221 p. 2, Serving and Realization. + **Evidence:** [Relations](../../notations/elements/17-relations.md) §3 (`uses`, + `serves`, `realizes`); [requirement](../../notations/elements/15-requirement.md) §2.7. +- **Status/class:** existing direction/profile difference and a draft extended + meaning. `uses` is APPLICATION → TECHNOLOGY_SERVICE. Requirement-chain `serves` + is REQUIREMENT → NEED, not functionality supplied to a consumer. `realizes` is + limited locally to BUSINESS_SERVICE → CAPABILITY. +- **Benefit/tradeoff:** local verbs answer distinct domain questions plainly; + identical-looking standard names encourage invalid automatic translations. +- **Mapping/loss:** T → A consumption, if represented by Serving, reverses the + consumer-to-service edge to provider-to-consumer; detailed endpoint admissibility + must still be checked against the full specification. Requirement `serves` has + **no established direct equivalent** here. A → T requires endpoint and intent + classification, not a string substitution. Draft REL `serves` support remains + pending as stated in the source; the inline field is a separate form. +- **Compatibility/decision:** changing stored direction or reusing one diagnostic + meaning for another breaks joins and history. Accepted mapping ADR: **unknown**. + Proposed disposition: use endpoint-aware mapping; never infer implementation from + the vocabulary table. See REC-03 and the requirement-chain case. + +### AM-010 — Obligation and evidence primitives extend motivation modeling + +- **Reference:** ArchiMate 3.2 N221 p. 4, Requirement and Constraint. + **Evidence:** [Requirement](../../notations/elements/15-requirement.md) §§1–2; + [Primitives](../../notations/ELEMENT_PRIMITIVES.md) §7.13; + [relations](../../notations/elements/17-relations.md) §§3.1–3.2; + [requirement chain](../../notations/views/reports/requirement-chain.md) §§1–2. +- **Status/class:** existing semantic classification/extension. Transitrix uses + positive obligation versus restriction/prohibition, origin taxonomy, evidence, + agreement and release scope. Draft chain additions are identified by their source, + not promoted to implemented semantics by this review. +- **Benefit/tradeoff:** “must do” and “must not cross” support regulatory modeling; + `required_for` records applicability without implying an implementation schedule. + Merely converting every REQUIREMENT to the same-named standard concept loses + the source, agreement, verification and release dimensions. +- **Mapping/loss:** T → A offers obligation concepts with an explicit extension + payload, or reports the discarded dimensions. A → T needs local classification + and admission evidence. ASSERTION, VERIFICATION and VALIDATION have **no established + one-to-one equivalent** in this comparison; they cannot be folded into Requirement + without loss. `depends_on` is neither decomposition nor work ordering. +- **Compatibility/decision:** collapsing types affects coverage and applicability + queries; required new fields need migrations. Accepted general mapping ADR: + **unknown**. Proposed disposition: preserve distinctions and report missing traces. + +### AM-011 — The canonical TYPE registry is not the whole ArchiMate inventory + +- **Reference:** ArchiMate 3.2 N221 pp. 3–5, 8, Outcome, Value, Resource, Value Stream + and Application Function. + **Evidence:** [ID registry](../../notations/IDS_AND_REFERENCES.md) §3.1; + [Primitives](../../notations/ELEMENT_PRIMITIVES.md) §4; + [machine vocabulary](../../notations/vocabulary.yaml), `element_types`. +- **Status/class:** existing unsupported **first-class canonical TYPEs** in the + inspected registry. The named concepts above have no dedicated entries there. + This is not a claim that prose, PlantUML, a package or every external tool cannot + express them, and it is not an exhaustive inventory of all unmapped concepts. +- **Benefit/tradeoff:** a smaller enterprise catalogue reduces authoring choices; + importing a model that depends on those distinctions needs a loss report or an + explicitly designed extension. +- **Mapping/loss:** A → T has no registered one-to-one target for those concepts. + T → A cannot recover omitted distinctions from a generic description. Mapping + all of them to APPLICATION, GOAL or TERM would be a semantic collapse. + Application Interface is a different case: it has an explicit INTEGRATION profile + despite lacking a separate TYPE (AM-014). +- **Compatibility/decision:** an additive TYPE still requires tool capability + reporting and unknown-type handling; retyping existing records is potentially + breaking. Accepted omission-by-omission ADR: **unknown**. Proposed disposition: + add a concept only for a demonstrated modeling case, not an inventory score. + +### AM-012 — Introductory and canonical relation shapes need qualification + +- **Reference:** ArchiMate 3.2 N221 p. 2, Access; comparison of representation forms, + not a claim that YAML syntax is specified by ArchiMate. + **Evidence:** [Modelling](../../method/03-modelling.md) §1.2 has `source`, `target`, + `type: Access`; [Relations](../../notations/elements/17-relations.md) §§2–3 has + `from`, `to`, a closed local enum and admission/lifecycle fields; + [Primitives](../../notations/ELEMENT_PRIMITIVES.md) §5 documents legacy envelope reconciliation. +- **Status/class:** existing documentation/interface ambiguity. The introductory + example is not sufficient evidence that `Access` is an admitted canonical REL kind. +- **Benefit/tradeoff:** the introductory shape makes a familiar edge easy to read, + but readers may mistake it for a canonical authoring contract. +- **Mapping/loss:** no general T → A or A → T adapter between these file forms is + established. Renaming endpoints alone loses required metadata and does not resolve + type meaning. Full ArchiMate Access admissibility remains unevaluated. +- **Compatibility/decision:** propose a **documentation-only** qualification first; + changing parser acceptance needs separate compatibility evidence. Accepted ADR + resolving this specific discrepancy: **unknown**. See B-01 in the architecture review. + +### AM-013 — “Concern” needs an edition-specific explanation + +- **Reference:** ArchiMate 3.2 N221 pp. 3–4, motivation inventory and Stakeholder; + compare ISO/IEC/IEEE 42010:2022 §3.10 in [S10](architecture-evidence.md#sources-and-access). + Full ArchiMate viewpoint provisions remain unevaluated. + **Evidence:** [Stakeholders](../../notations/elements/20-stakeholders.md) §6 says + ArchiMate models concern as its own element, while §2 defines local free text; + [glossary](../../method/00-glossary.md), “ArchiMate 3.2 alignment”, broadly says + aligned names need no divergence entry. +- **Status/class:** existing explanatory overstatement. N221's motivation inventory + does not establish a first-class Concern element. It is therefore not evidence + that deferring a local CONCERN TYPE departs from such an ArchiMate element. Nor do + aligned names erase AM-001–010's structural differences. +- **Benefit/tradeoff:** concern text helps authors express interests cheaply; a + claimed standard equivalence obscures the separate question of stable concern + identity and cross-view coverage. +- **Mapping/loss:** T → A can preserve text as stakeholder context; A → T has no + demonstrated standalone Concern target. For the 42010 mapping, see ARC-005. + Omitting the text loses context, while assigning it a new TYPE invents a contract. +- **Compatibility/decision:** propose a wording correction and explicit separation + of the two standards, without adding a primitive. Accepted ADR for this correction: + **unknown**. B-01 should resolve the claims; REC-02 separately evaluates a richer + concern profile. + +### AM-014 — Application Interface is represented through INTEGRATION + +- **Reference:** ArchiMate 3.2 N221 p. 8, Application Interface; the local spec + cites §8.2.5, whose full normative text was not independently accessible here. + **Evidence:** [Primitives](../../notations/ELEMENT_PRIMITIVES.md) §§7.8–7.8.1; + [integration map](../../notations/views/diagrams/12-integration-map.md). +- **Status/class:** existing representation change and restriction/extension. + `interface_semantics: true` selects a profile of INTEGRATION rather than a new + TYPE. The profile requires known source/target APPLICATIONs, protocol, payload + class, sensitivity and directionality. An unqualified integration is not thereby + an Application Interface. +- **Benefit/tradeoff:** authors govern an endpoint without another catalogue kind; + an interface exposed to an unspecified user or node does not directly fit this + two-application shape. Interface identity and a connection are easy to conflate. +- **Mapping/loss:** T → A is conditional on the explicit profile and actual point + of access; retain connection and classification information separately. A → T + needs a supported application pair and the profile metadata, or remains unmapped. + A bare Interface concept cannot reconstruct the local payload/security fields. +- **Compatibility/decision:** introducing a separate required TYPE or splitting + existing records affects views, references and validation. The specification + records the **2026-06-28 Application Interface representation decision**; an + independently accessible accepted ADR is **unknown**. Proposed disposition: + retain the profile while testing a named endpoint and rejecting a data pipe + without an interface contract. INT-001 is documented enforcement, not evidence + that every consumer implements it. + +## Proposed changes and modeling checks + +These entries are **proposed**, not newly accepted semantics. Priority and +compatibility follow the [architecture review](architecture-evidence.md#candidate-recommendations-compatibility-and-decisions). +Each proposal inherits the exact source paths, baseline revision and two-way +mapping/loss assessment of the existing entries it names. It proposes a review +or documentation improvement, not a replacement transformation. + +| Proposal | Improvement and representative test | Precision, clarity and validation | Compatibility / decision | +|---|---|---|---| +| **AM-P01** (AM-002/013; ArchiMate 3.2 Stakeholder, N221 p. 3) | Optional concern/viewpoint evidence accompanying two views over a shared goal | Positive: distinguish each audience's concern and answer. Negative: identical `notation` does not imply identical viewpoint. This is a proposed evidence check, not a current validator. | Additive companion first; mandatory concern references would be breaking. Owner: methodology maintainers with model authors. Accepted ADR unknown; options in REC-02. | +| **AM-P02** (AM-006/008/009; ArchiMate 3.2 Gap and relationships, N221 pp. 2, 12) | A mapping specification that records direction, date selection and loss | Positive: distinguish before/after hosting; require supported states for a Gap mapping. Negative: reject direct `serves` string substitution and simultaneous export of ended/current links as current facts. Full relation rules must be accessible before an admissibility claim. | Additive specification; reversing core edges would be breaking. Owner: semantic-tool implementers with methodology maintainers. Accepted ADR unknown; REC-03/B-04. This proposal defines mapping evidence only. | +| **AM-P03** (AM-001/011; ArchiMate 3.2 Capability/Resource, N221 p. 5) | Document storage-layer and supported-TYPE boundaries rather than force fuller inventory coverage | Positive: keep a capability's local V/H identity while distinguishing its comparison concept. Negative: do not silently map Resource to Capability merely to finish an import. | Documentation is additive. New mandatory TYPEs/paths require consumer review. Owner: methodology maintainers. Accepted ADR unknown; retain current modeling benefit until a specific counterexample justifies change. | + +A review of these cases favors preserving useful departures. Service history, +stake identity and obligation evidence are valuable even when their faithful +interchange needs extensions. The strongest immediate improvements are explaining +the actual forms and qualifying equivalence claims. A diagram that looks closer +to ArchiMate but drops those facts is not an improvement on these cases. + +## Proposed maintenance rule + +This section preserves the original review recommendation at the comparison +baseline. The current maintenance obligation is now specified by SSP-10 in the +[Semantic Standards Profile](../../method/semantic-standards-profile.md); +the historical candidate wording below is not a second normative authority. + +Recommend **`docs/standards-review/archimate-differences.md` as the authoritative +detailed register**, with the glossary and cheat sheet linking to it after that +maintenance decision is accepted. The glossary remains a vocabulary introduction; +the element/relation specifications remain authoritative for Transitrix semantics. +This location recommendation does not itself adopt a maintenance policy. + +Candidate **MUST**: a semantic change affecting a registered mapping updates the +relevant stable ID, comparison edition, source revision, direction/loss and +consumer/migration consequences in the same reviewed delivery. No exception for +claiming lossless interoperability; documentation-only comparisons may explicitly +retain unknown normative evidence. + +Candidate **SHOULD**: demonstrate both a preserved modeling case and a rejected +interpretation before changing a mapping. Keep observed and proposed status +separate; mark accepted only with a public decision by name/date or accessible ADR. +If a source or decision is unavailable, keep **unknown**, not an invented citation. + +Candidate **MAY**: retire an entry as deprecated while retaining its ID and successor +link. Do not reuse its ID. Reassess later standard editions as a separate comparison +with an explicit source delta; never relabel the 3.2 findings silently. + +Maintainers should decide between this single register, the existing brief glossary +table and distributed consumer tables. The recommended single detailed register +reduces conflicting mappings; consumers still own their versioned implementation +coverage. Neither a register entry nor its merge proves that a converter exists. diff --git a/docs/standards-review/architecture-evidence.md b/docs/standards-review/architecture-evidence.md new file mode 100644 index 00000000..1d737bcf --- /dev/null +++ b/docs/standards-review/architecture-evidence.md @@ -0,0 +1,171 @@ +# Architecture standards: evidence and mapping + +This review is for model authors, methodology maintainers and semantic-tool +implementers assessing interoperability. It is **non-normative**: recommendations +below do not adopt a standard, change a schema, or establish conformance or +certification. Read it with the [ArchiMate differences register](archimate-differences.md). + +## Evidence boundary + +The reviewed Transitrix baseline is +[`8ca4eabf7666946ffb7a76eb579c31cb0ae3f327`](https://github.com/transitrix/methodology/tree/8ca4eabf7666946ffb7a76eb579c31cb0ae3f327), +observed on 2026-10-10 and rechecked on 2026-10-11. Main still matched that +revision; no later semantic delta is included. Every repository path and section +below refers to that revision, even when its relative link opens a newer file. +Specification status, implementation coverage and external-standard conformance +are different facts. + +Here, **alignment** means a useful conceptual correspondence; **interoperability** +requires a defined transformation and explicit losses. **Formal conformance** +requires evidence against the applicable standard's requirements for a named +subject and edition. **Certification** additionally requires the relevant +certification process. This review establishes neither of the latter two. + +### Sources and access + +Access date for all sources: **2026-10-11**. No normative text is reproduced or +vendored. Primary documents hosted by another site are identified as such; +publisher abstracts and reference cards are not substitutes for full requirements. + +| Key | Edition, source and accessible material | Limit of this review | +|---|---|---| +| S10 | [ISO/IEC/IEEE 42010:2022, edition 2](https://www.iso.org/standard/74393.html); [ISO/IEC/IEEE preview hosted by iTeh](https://cdn.standards.iteh.ai/samples/74393/fc7b7f103d8446a4b87a3261e31370d3/ISO-IEC-IEEE-42010-2022.pdf), terms §3, conformance §4 and beginning of §5 | Definitions and conformance categories are accessible. §§6–8 requirements are listed in the contents but their full text is unavailable here; clause-level compliance is **unevaluated**. | +| S20 | [ISO/IEC/IEEE 42020:2019, edition 1, ISO preview](https://www.iso.org/obp/ui?_escaped_fragment_=iso:std:iso-iec-ieee:42020:ed-1:v1:en), scope, definitions and contents | Architecture processes are relevant; full outcomes, activities and conformance requirements are **unevaluated**. Contents identify §4 conformance, §5 process overview, §6 governance and §7 management; headings alone prove no coverage. | +| S38 | [ISO/IEC 21838-1:2021, edition 1](https://www.iso.org/standard/71954.html), requirements for top-level ontologies | Publisher scope available; complete requirements unavailable. Transitrix is not established as a top-level ontology. | +| SBFO | [ISO/IEC 21838-2:2021, edition 1](https://www.iso.org/standard/74572.html), BFO, including BFO-2020 | Publisher scope available, including OWL 2/Common Logic formalizations; axioms and domain-module requirements not evaluated. | +| SDOLCE | [ISO/IEC 21838-3:2023, edition 1, ISO preview](https://www.iso.org/obp/ui?_escaped_fragment_=iso:std:iso-iec:21838:-3:ed-1:v1:en), DOLCE | Scope/introduction available; full axioms and §4 conformity demonstration unavailable. No equivalence of BFO and DOLCE is presumed. | +| SODM | [OMG ODM 1.1, September 2014](https://www.omg.org/spec/ODM/1.1/), [normative PDF](https://www.omg.org/spec/ODM/1.1/PDF), §§1–2 and Table 2.1 | Public normative specification available. This review assesses applicability and the conformance boundary, not every metamodel package. | +| SAM | ArchiMate **3.2**, the baseline named by Transitrix; [publisher access page](https://www.opengroup.org/archimate-licensed-downloads) and [N221 reference cards](https://barbierdarnal.com/Enterprise_Architect/Clinique/ArchiMate_3.2_Specification_notation.pdf), authored by The Open Group, hosted by a third party | Cards accessible; [full specification](https://pubs.opengroup.org/architecture/archimate32-doc/) required sign-in. Full relationship admissibility/derivation requirements remain **unevaluated**. 3.2 is the comparison edition, not a claim about the latest edition. | +| S79 | ISO/IEC 11179: [Part 1:2023 framework publication record](https://www.iso.org/files/live/sites/isoorg/files/news/magazine/ISOupdate/EN/2023/ISOupdate-February-2023.pdf), [Part 3:2023 common facilities](https://www.iso.org/standard/78915.html), [Part 6:2023 registration preview](https://www.iso.org/obp/ui?_escaped_fragment_=iso:std:iso-iec:11179:-6:ed-4:v1:en), [Part 31:2023 data specification registration](https://www.iso.org/standard/78925.html) | Publication/scope evidence and Part 6 introduction/§§1–3 accessible. Full registry conformance requirements not evaluated. Part 1 edition 4, Part 3 edition 4, Part 6 edition 4, Part 31 edition 1 are the selected comparison set. | + +### Transitrix evidence followed beyond the indexes + +The starting points were [README](../../README.md), [CONTRIBUTING](../../CONTRIBUTING.md), +[glossary](../../method/00-glossary.md), [modelling](../../method/03-modelling.md), +[notation inventory](../../notations/README.md), +[ID/reference contract](../../notations/IDS_AND_REFERENCES.md) and +[shared contract](../../notations/CONTRACT.md). The evidence chain continues into: + +| Evidence | What it establishes, and what it does not | +|---|---| +| [Element primitives](../../notations/ELEMENT_PRIMITIVES.md) §§1–6, 7.18–7.19, 7.30; [relations](../../notations/elements/17-relations.md) §§1–5; [stakeholders](../../notations/elements/20-stakeholders.md) §§1–5 | Authored structure, identity, scope and temporal semantics; these take precedence over a shorthand alignment table for this comparison. | +| [Goals Tree](../../notations/views/diagrams/04-goals.md), “Source of truth” and §§4–6; [report configuration](../../notations/views/REPORT_VIEW_CONFIG.md) §§1–6; [document view engine](../../packages/document-view-engine/README.md), “What this package admits, and what it defers” | Inline models, selected projections and document assembly are different forms. A render configuration alone does not identify all of an architecture description's concerns. | +| [Codex](../../notations/elements/14-codex.md) §§1–3; [TERM](../../notations/ELEMENT_PRIMITIVES.md) §7.30; [glossary report](../../notations/views/reports/32-glossary.md) §§1, 6 | Existing external-standard citation and vocabulary mechanisms can be reused. A STANDARD record or a TERM does not assert that the organisation adopted or conforms to its source. | +| [Requirement chain](../../notations/views/reports/requirement-chain.md) §§1–2; [requirement](../../notations/elements/15-requirement.md) §§1–2; [shared contract](../../notations/CONTRACT.md) §§18.2, 18.7 | The chain contains draft additions with consumer implementation still pending. Stored diagnostics retain versioned meaning. Proposed checks below cannot be counted as implemented coverage. | +| [Linter](../../tools/lint.py), `TransitrixLinter`; [notation checker](../../scripts/check-notations.mjs), documented checks | Model and documentation checks have bounded scopes. Neither is a standards conformance assessor. | +| [Catalogue integration](../../packages/ingest-cli/src/catalogue.mjs), `parseCatalogueDecl` and `loadCatalogueSlice`; [release/propagation](../../method/09-releases-and-propagation.md) §6.4; [manifest](../../notations/MANIFEST.md) §2; [binding](../../notations/CONTRACT.md) §17 | Optional version-pinned catalogue bindings preserve local IDs; missing or mismatched configured input is not a successful lookup. This is not an ISO metadata-registry registration procedure. | +| [Document provenance](../../packages/document-renderer/PROVENANCE.md), API/result contract; [issued-document queries](../../packages/documents-cli/README.md), “Querying retained issuance events” | Retained output can be compared with recipe/run evidence; absent evidence remains unknown. Provenance is reusable for an AD package, but does not prove semantic completeness. | +| [6.0 → 7.0 migration](../../migrations/6.0-to-7.0/README.md); [compatibility](../../notations/CONTRACT.md) §10 | Renaming fields, changing required data or diagnostic meanings needs an explicit consumer/migration treatment. This review supplies none of those changes. | + +## Standards coverage and gap register + +P1 means resolve before making the affected interoperability claim; P2 means a +bounded design follow-up; P3 means optional research. These are recommendations, +not assigned delivery priorities. IDs remain stable even if a finding is rejected. + +| Standard | Relevant Transitrix area | Current status | Gap | Recommendation | Priority | +|---|---|---|---|---|---| +| ISO/IEC/IEEE 42010:2022 (S10) | Views, primitives, stakeholders, manifest, issued documents | Partial conceptual alignment; no demonstrated AD/ADF/ADL conformance | **ARC-001–009** below: no complete concern → viewpoint → view evidence contract | Define an optional AD evidence profile using existing model identities; validate against full §§6–8 before any conformance claim | P1 | +| ISO/IEC/IEEE 42020:2019 (S20) | [Admission](../../notations/CONTRACT.md) §6, [decision log](../../method/07-decisions.md), [team operations](../../method/06-team-operations.md), [propagation](../../method/09-releases-and-propagation.md) | Useful governance/process records exist | **ARC-010**: records and Git gates do not demonstrate the standard's process outcomes, roles or tailoring basis | Prepare a process/outcome evidence matrix for one architecture cycle, with unknowns retained; no new lifecycle mandates | P2 | +| ISO/IEC 21838-1:2021 (S38) | TYPE system and [vocabulary](../../notations/vocabulary.yaml) | Optional candidate; not adopted | **ARC-011**: a typed enterprise catalogue is not thereby a top-level ontology or formal theory | Evaluate only against explicit competency questions; full TLO-conformance assessment is presently not applicable to a declared Transitrix TLO because none is declared | P3 | +| ISO/IEC 21838-2:2021 / BFO-2020 (SBFO) | ACTOR, ROLE, PROCESS, ACTION, lifecycle | Optional interpretation candidate | **ARC-012**: identity records, organisational positions and planned actions have no established mapping to BFO categories or axioms | Compare a plan, its execution and the actor's role separately; retain an external mapping without retyping core | P3 | +| ISO/IEC 21838-3:2023 / DOLCE (SDOLCE) | Same areas; TERM and contextual meaning | Optional alternative candidate | **ARC-013**: no demonstrated DOLCE interpretation or equivalence to BFO | Evaluate the same cases under DOLCE independently; reject mappings that collapse plan, event and description; full axiom checks unevaluated | P3 | +| OMG ODM 1.1 (SODM) | YAML primitives, REL, catalogue integration | Conceptual interchange candidate only | **ARC-014**: no selected ODM package conformance target or ODM-conformant XMI contract | If ontology interchange is commissioned, name a package and mapping direction first. §2/Table 2.1 distinguish package compliance and interchange; mapping clauses are informative | P2 | +| ArchiMate 3.2 (SAM) | Element/relation vocabulary and views | Declared foundation, with observed differences | **ARC-015**: simplified names are insufficient to establish equivalence; full matrix checks unknown | Use [AM-001–014](archimate-differences.md) to preserve the modeling benefit and disclose mapping loss | P1 | +| ISO/IEC 11179-1/-3/-6/-31:2023 (S79) | TERM, aliases, IDs, admission and catalogue binding | Registry-like functions, not demonstrated MDR conformance | **ARC-016**: local identity/admission is not international registration; data concepts and value domains have no established mapping | Assess framework/common facilities and registration separately from data specification; keep any registry identifier alongside local IDs | P2 | + +For ARC-016, Parts 1 and 3 concern framework/common facilities; Part 6 concerns +registration and its responsible bodies. Part 31 is a candidate only for a data +dictionary profile, not for every architecture element. Part 6 also names concept +systems (Part 32), datasets (Part 33), computable data (Part 34) and models (Part +35). Their detailed requirements are **unevaluated**: no corresponding registry +profile is selected here. Parts 4/5 definition/naming guidance and Part 30 basic +attributes are also deferred to that profile review; no family-wide 11179 claim +is implied by the selected parts. Existing `REGISTRY` rows in Primitives §7.20 +track normative sources and scans; their name is not evidence of an MDR. + +## Nine architecture concepts + +This is a mapping assessment, not nine pass/fail compliance assertions. Clause +references below are to accessible S10 definitions. The requested “Architecture +Model” label needs an edition qualification: **2022 §3.19 defines view component**. +It must not silently inherit a 2011 architecture-model equivalence. Requirements +in §§6–8 remain unevaluated even where the concepts are understandable. + +In the table, T → S maps Transitrix evidence to a standards concept; S → T asks +what a standards-oriented description would need to preserve in Transitrix. + +| Finding / concept | Source | Exact Transitrix evidence at the baseline | Direction, loss and non-equivalence | +|---|---|---|---| +| **ARC-001 — Entity of Interest** | S10 §3.12 | [Manifest](../../notations/MANIFEST.md) §§1–2; [Primitives](../../notations/ELEMENT_PRIMITIVES.md) §§7.5–7.7; [Actors](../../notations/elements/19-actors.md) §1 | T → S: an organisation, product or application can identify the subject, but the repository boundary alone does not distinguish subject from environment. S → T: preserve an explicit subject and boundary narrative; no universal EoI field is established in these contracts. Loss: multi-entity scope is implicit if only a repo name is retained. | +| **ARC-002 — Architecture** | S10 §3.2 | [Modelling](../../method/03-modelling.md) §1; [Primitives](../../notations/ELEMENT_PRIMITIVES.md) §§1–3; [Codex](../../notations/elements/14-codex.md) §2 | T → S: primitives, relations and principles describe selected properties; they are not the enterprise itself. S → T: important principles and environmental assumptions may require prose as well as model records. Loss: unmodelled properties remain unknown, never false. | +| **ARC-003 — Architecture Description** | S10 §3.3 | [Zones/admission](../../notations/CONTRACT.md) §§5–6; [report config](../../notations/views/REPORT_VIEW_CONFIG.md) §1; [document provenance](../../packages/document-renderer/PROVENANCE.md) | T → S: a selected, revision-bound set of records and views is an AD candidate; an entire Git repository is not automatically an AD. S → T: retain its purpose, scope, selected artifacts and rationale as one identified package. Loss: a live query without its input revision cannot reconstruct an issued description. | +| **ARC-004 — Stakeholder** | S10 §3.17 | [Stakeholders](../../notations/elements/20-stakeholders.md) §§1–3, 5 | T → S: a stake profile plus its actor can identify a stakeholder. S → T: the required `actor` link narrows admission; a role/class described by a standard-oriented AD cannot simply be imported as an actor-free STAKEHOLDER. Loss: flattening several stakes to one identity merges their distinct interests. See AM-002. | +| **ARC-005 — Concern** | S10 §3.10 | [Stakeholders](../../notations/elements/20-stakeholders.md) §§2–3, 6 | T → S: `concern` text gives evidence of an interest; it is recommended, not required. S → T: no addressable concern inventory or concern-to-view coverage relation is specified there. Loss: repeated strings do not provide stable cross-view identity. A missing string is not proof that no concern exists. | +| **ARC-006 — Viewpoint** | S10 §3.8 | [Goals Tree](../../notations/views/diagrams/04-goals.md) §§2, 4–6; [report config](../../notations/views/REPORT_VIEW_CONFIG.md) §§1–6 | T → S: notation purpose, conventions and validation are useful ingredients. S → T: specify whose concerns are framed, conventions used and how results are interpreted. Loss: a filter or diagram type omits that argument; `view_config` is not automatically a viewpoint. | +| **ARC-007 — View** | S10 §3.7 | [Goals Tree](../../notations/views/diagrams/04-goals.md), “Source of truth”; [shared contract](../../notations/CONTRACT.md) §14 | T → S: a rendered selection can contribute to a view addressing stated concerns. S → T: retain the selection, inputs and correspondence to the chosen viewpoint. Loss: treating the YAML configuration as the whole view drops the rendered/content evidence; deleting an inline document can delete model facts. | +| **ARC-008 — Architecture Model** | S10 §3.19 (2022 view-component comparison), §3.15 | [Primitives](../../notations/ELEMENT_PRIMITIVES.md) §§1–2; [Goals Tree](../../notations/views/diagrams/04-goals.md) §4 | T → S: an inline goal hierarchy or resolved canonical graph can supply a view component. S → T: retain its governing model kind or legend and reuse boundaries. Loss: one-file = one-model assumptions fail for projections and shared primitives. The requested label is assessed, not asserted to be a 2022 defined term. | +| **ARC-009 — Model Kind** | S10 §3.15 | [Goals Tree](../../notations/views/diagrams/04-goals.md) §§4–6; [Capability Map](../../notations/views/diagrams/05-capability-map.md) §§2, 4, 13; [notation inventory](../../notations/README.md) | T → S: syntax, conventions and rules describe useful candidate model kinds. S → T: document interpretation and intended use, with explicit edition/form. Loss: a filename extension or `notation` string identifies a format, not complete model-kind evidence. No §8.2 conformance claim follows. | + +The nine concepts do not exhaust 2022. Stakeholder perspectives (§3.18), aspects +(§3.9), correspondences (§3.11), decisions and rationale need separate evidence +in any future AD profile. A binary REL between enterprise primitives cannot be +assumed to represent every correspondence between description artifacts. + +## Representative cases and proposed acceptance examples + +These are **review cases**, not executable schemas or implemented validation rules. +“Positive” means the proposed mapping preserves the stated distinction; “negative” +means a reviewer should reject the interpretation, not that today's CLI rejects it. + +| Case | Positive interpretation | Negative interpretation / result | Findings | +|---|---|---|---| +| Shared goal, two audiences | One admitted goal appears in an operational Goals Tree and a change-planning view; each names its audience, concern and input revision in the proposed AD evidence profile | Equating both configurations to one viewpoint merely because both use `goals` loses audience/concern coverage | ARC-003, 005–009 | +| External service owner | An ACTOR supplies identity; two STAKEHOLDER records preserve two different stakes and link to selected goals/actions | Dropping the actor during import fails the documented STAKE-002 condition; merging the stakes loses meaning even if YAML still parses | ARC-004; AM-002 | +| Service moves to another node | End the old `hosts` REL window and start a new one; a dated projection selects the applicable link | Exporting both links as simultaneously current loses temporal truth; relation validity is not a scheduled migration date | AM-008 | +| Requirement applies to a release | Preserve requirement scope, comparison outcome and the selected release separately; reuse the requirement-chain contract | Treating `required_for` as a deadline, or an ASSERTION as executed VERIFICATION, invents execution evidence | AM-010; ARC-015 | +| Architecture report is reissued | Bind selected canon, recipe and retained output using the existing provenance machinery | A successful render is not proof of concern completeness, stakeholder agreement or standards compliance | ARC-003, 006, 010 | +| Same term in two catalogues | Preserve local identity and an accepted catalogue binding; qualify provenance by catalogue revision | Assuming identical labels are the same ISO registry item, or globally renaming local IDs, destroys distinctions | ARC-016; AM-003 | +| Plan and execution | Compare a planned ACTION, actual performance evidence and the actor/role separately when evaluating BFO and DOLCE | Assigning all three to one ontology class solely because their labels match is an unevaluated mapping | ARC-011–014 | + +These cases favor semantic precision over nominal fidelity: retaining stakeholder +stakes and temporal relations is useful even when interchange requires extra +metadata. Replacing them with simpler standard names would not by itself improve +the model. Conversely, an optional concern/viewpoint evidence profile could improve +clarity without forcing every small inline model into a new metamodel. + +## Candidate recommendations, compatibility and decisions + +MUST/SHOULD/MAY below express **proposed priorities for a future decision**. They +are not new Transitrix requirements. None changes an accepted ADR or adoption policy. + +| ID | Candidate recommendation and rationale | Exceptions / compatibility / affected consumers | +|---|---|---| +| REC-01 | **MUST** bind a future standards claim to its edition, subject, reviewed revision, evaluated clauses and unknown evidence. Names and green YAML checks are insufficient. | No exception for formal claims; informal comparisons may remain explicitly unevaluated. Additive documentation; affects model reviewers and claim-producing tools. | +| REC-02 | **SHOULD** add an optional AD evidence profile identifying scope, stakeholders, concerns, viewpoints, view components and correspondences. Reuse existing element IDs, model kinds and provenance. | A small exploratory model need not opt in. Optional documentation is backward-compatible; making new fields mandatory or redefining `view_config` is potentially breaking for authors, parsers and renderers. | +| REC-03 | **MUST** disclose direction, unmapped content and losses for any commissioned mapping. See AM-008/009 before translating relation names. | No claim of lossless conversion without a round-trip witness. A report is additive; changing core relation direction or TYPE meaning is breaking and requires consumer review/migration. | +| REC-04 | **SHOULD** retain the existing identity/stake, obligation/scope and model/projection distinctions unless a representative case justifies change. | A concrete counterexample may justify a new design decision. Documentation is additive; collapsing TYPEs or changing admission rules is breaking. | +| REC-05 | **MAY** evaluate BFO, DOLCE and ODM as separate optional mapping profiles. | Defer if no competency question benefits. No core ontology commitment, inference behavior or dependency follows. A required ontology classification would affect every consumer and need migration. | +| REC-06 | **SHOULD** assess ISO 11179 using a bounded vocabulary/catalogue profile; distinguish local IDs, names, registration and data domains. | Local-only catalogues may keep current IDs without external registration. An optional external identifier is additive; replacing IDs or uniqueness scope is breaking. | + +Proposed ADR topics and owners: + +| Topic | Options and recommended choice | Recommended decision owner / acceptance evidence | +|---|---|---| +| AD evidence profile | Prose-only companion; optional structured profile; mandatory core extension. Start with the companion and evaluate a structured profile against the shared-goal case. | Methodology maintainers, with model-author and renderer review; no accepted ADR identified for this proposal. Require all nine mappings plus explicit treatment of 2022 perspectives/aspects/correspondences. | +| Difference-register authority | Keep the glossary table alone; maintain this detailed register with glossary links; duplicate tables per consumer. Recommend this register plus links. | Methodology maintainers with semantic-tool implementers; see [maintenance proposal](archimate-differences.md#proposed-maintenance-rule). Acceptance would need a recorded decision; none is invented here. | +| Ontology/registry mapping | No profile; optional bounded BFO or DOLCE profile; mandatory upper ontology. Recommend an optional experiment only when competency questions justify it. | Methodology maintainers and ontology/catalogue implementers. Choose each ontology independently, demonstrate counterexamples and disclose loss. | + +Bounded backlog proposals (these do not change any implementation): + +| Item | Dependency | Acceptance | Priority / compatibility | +|---|---|---|---| +| B-01: qualify broad alignment prose and reconcile introductory REL examples | ARC-015; AM-012/013; authoritative element/relation contracts | Glossary avoids an unqualified “no divergence”; introductory examples clearly identify their form and link to canonical fields. No silent record conversion. | P1; documentation-only | +| B-02: demonstrate one AD evidence package | REC-02 decision; authorized access to full S10 requirements for any compliance assessment | One subject, two audiences, shared model evidence and positive/negative concern coverage; inaccessible clauses stay unknown. | P2; optional, backward-compatible | +| B-03: assess one 42020 architecture cycle | Full S20 requirements and a selected cycle's records | Each selected process outcome has a cited record, gap or explicit non-applicability rationale; no inference from a merge or a gate tick. | P2; evidence-only | +| B-04: specify mapping losses for the register's cases | Full SAM semantics for definitive relationship admissibility; mapping-scope decision | Preserve direction, temporal selection, aliases and unsupported facts; a rejected conversion is visible. Exchange implementation and licensing require a separate decision. | P1; specification-only; core changes require migrations | +| B-05: evaluate ontology and registry candidates | Competency questions; selected S38/SBFO/SDOLCE/SODM/S79 requirements and profile decisions | Compare plan/execution and contextual-term cases; select, reject or defer with rationale and a named conformance target. | P3; optional experiment | + +No export implementation or licensing path is selected. Source access gaps are +named above; resolving them enables deeper conformance assessment, not automatic +adoption. The review's findings remain useful as bounded conceptual evidence. diff --git a/docs/standards-review/semantic-evidence.md b/docs/standards-review/semantic-evidence.md new file mode 100644 index 00000000..1f9f7119 --- /dev/null +++ b/docs/standards-review/semantic-evidence.md @@ -0,0 +1,489 @@ +# Semantic, terminology and provenance standards evidence + +This review is for methodology maintainers, model authors and semantic-tool +implementers. It evaluates candidate interoperability mechanisms; it does not +adopt a standard, change the metamodel, or implement an RDF exporter, ontology, +SHACL validator or query service. All examples and capitalized recommendations +below are **non-normative proposals**. + +## Evidence baseline and claim boundaries + +Reviewed repository revision: `8ca4eabf7666946ffb7a76eb579c31cb0ae3f327` +(main observed 2026-10-11; identical to the 2026-10-10 review baseline). +Every Transitrix path and section below refers to that revision; no later +implementation is included. The entry points were [README](../../README.md), +[contribution checks](../../CONTRIBUTING.md), [glossary](../../method/00-glossary.md), +[modelling](../../method/03-modelling.md), [notation index](../../notations/README.md), +[identifier contract](../../notations/IDS_AND_REFERENCES.md) and +[shared contract](../../notations/CONTRACT.md). The evidence register follows +those entry points into specifications and consumers rather than treating an +index or scaffold as the metamodel. + +Here, **alignment** means a supported conceptual comparison; **interoperability** +requires an explicit mapping and exchange tests; **formal conformance** requires +an identified conformance target and its complete applicable requirements; +**certification** requires a separately identified scheme and evidence. This +review establishes no formal conformance or certification. A similarly named +Transitrix field is not an equivalence axiom. + +### Transitrix evidence register + +| Key | Exact path and section at the baseline | Evidence and limits | +| --- | --- | --- | +| T1 | [ELEMENT_PRIMITIVES](../../notations/ELEMENT_PRIMITIVES.md) §§1.1, 3, 7.30, 9; [glossary view](../../notations/views/reports/32-glossary.md) §§1–3 | TERM has no additional per-TYPE fields: name, aliases and description use the shared envelope. An enterprise object retains its own definition. A duplicate TERM fails the name/alias gate. A glossary is a projection, not a concept store. | +| T2 | [IDS_AND_REFERENCES](../../notations/IDS_AND_REFERENCES.md) §§1, 4–5; [MANIFEST](../../notations/MANIFEST.md) §4; [CONTRACT](../../notations/CONTRACT.md) §17 | IDs have scoped uniqueness, including contained objects; the nearest manifest defines a catalogue. `canon_id` and central `origin` bind catalogue provenance, not global RDF identity. REQUIREMENT's scalar `origin` is a different taxonomy. | +| T3 | [Relations](../../notations/elements/17-relations.md) §§1–3; [CONTRACT](../../notations/CONTRACT.md) §§6–7, 9, 11–14 | REL identity, direction, closed kind enum, independent validity window; admission, reviewer authority, agreement, confidence, history gaps and view configuration are distinct. | +| T4 | [Codex](../../notations/elements/14-codex.md) §§1–3; [Requirement](../../notations/elements/15-requirement.md) §§2, 4; [Assertion](../../notations/elements/16-assertion.md) §§1–2 | STANDARD represents an external authority document. `derived_from` is a source reference. ASSERTION is specifically a requirement satisfaction claim, not a universal RDF statement container. | +| T5 | [Requirement-chain](../../notations/views/reports/requirement-chain.md) §§3–9; [Relations](../../notations/elements/17-relations.md) §3 | Population completeness, release scope and definition versus execution evidence already have a consumer contract. Six additional relation kinds are specified with implementation limitations; a source delivery is not proof of released support. | +| T6 | [CONTRACT](../../notations/CONTRACT.md) §§18.1–18.7; [diagnostic migration](../../migrations/6.0-to-7.0/README.md) | Coverage and diagnostic identity carry notation/form, methodology and tool versions. Preserve historical codes and meanings; a SHACL result must not silently replace one. | +| T7 | [Document provenance](../../packages/document-renderer/PROVENANCE.md), “Authorization and observation boundary”, “Result contract”; [checker](../../packages/document-renderer/src/provenance.mjs), `checkDocumentProvenance` | Independent authorized observations are separate from recorded claims. `run.generation` remains unverifiable; matching digests do not prove input consumption. | +| T8 | [Catalogue consumer](../../packages/ingest-cli/src/catalogue.mjs), `parseCatalogueDecl`; [name/alias gate](../../packages/ingest-cli/src/canon.mjs), `buildCanonIndex`; [glossary consumer](../../packages/document-view-engine/src/glossary-view.mjs), `parseGlossaryYaml`, `renderGlossaryHtml`; [engine](../../packages/document-view-engine/src/evaluate.mjs) | Concrete YAML consumers exist. They are not evidence of an RDF identity service, SKOS thesaurus or OWL reasoner. Existing glossary output and admission selection must survive any export. | +| T9 | [Domain packages](../../notations/PACKAGES.md) §5; [3.0 migration](../../migrations/2.1-to-3.0/README.md), “What this recipe does”; [catalogue release example](../../integration/catalogue-release-example.yaml) | Optional packages, archival migration and versioned catalogue distribution already exist. Semantic integration should be removable and version-bound, not an implicit core migration. | + +### Authoritative source register + +Access date for all sources: **2026-10-11**. W3C and DCMI full specification +pages were accessible. Section references identify the reviewed concepts, not a +claim that every clause was audited. ISO catalogue pages were accessible; +ISO's browser previews for 704 and 1087 returned a JavaScript-only shell. +No licensed full ISO text was available in this review. No standard was +purchased or reproduced. ISO recommendations below are local design candidates, +not reconstructed normative clauses. Undated assignments are pinned here. + +| Key | Edition / part and authoritative source | Reviewed locator / access limitation | +| --- | --- | --- | +| S1 | [RDF 1.1 Concepts, 25 February 2014](https://www.w3.org/TR/2014/REC-rdf11-concepts-20140225/) | §§3.1–3.6 triples, IRIs, literals and graph comparison; §4 datasets. | +| S2 | [RDF 1.1 Turtle, 25 February 2014](https://www.w3.org/TR/2014/REC-turtle-20140225/) | §§2.1–2.5 syntax, §6 grammar, §5 conformance. | +| S3 | [JSON-LD 1.1, 16 July 2020](https://www.w3.org/TR/2020/REC-json-ld11-20200716/) | “The Context”, “Advanced Concepts”: typed values, language, lists/sets, named graphs; “Relationship to RDF”. | +| S4 | [SKOS Reference, 18 August 2009](https://www.w3.org/TR/2009/REC-skos-reference-20090818/) | §§3–4 concepts/schemes; §5 S13–S14 labels; §§7–8 semantic relations/documentation; §10 mappings. | +| S5 | [OWL 2 Structural Specification, second edition, 11 December 2012](https://www.w3.org/TR/2012/REC-owl2-syntax-20121211/) and [OWL 2 Profiles, same edition/date](https://www.w3.org/TR/2012/REC-owl2-profiles-20121211/) | Structural §§5, 5.9, 9; Profiles §§4.2–4.3 distinguish RL syntax from RDF rule processing. | +| S6 | [SHACL 1.0, 20 July 2017](https://www.w3.org/TR/2017/REC-shacl-20170720/) | §§2–3 targets, data/shapes graphs and reports; §§4.1–4.5 cardinality, types and pair constraints; §5 SPARQL constraints. | +| S7 | [SPARQL 1.1 Query, 21 March 2013](https://www.w3.org/TR/2013/REC-sparql11-query-20130321/) | §§8 negation, 9 property paths, 13 datasets, 16 query forms, 17 expressions. Query proposals only; Update, Protocol and remote endpoint conformance are unevaluated, since no service is proposed. | +| S8 | [ISO 704:2022, edition 4](https://www.iso.org/standard/79077.html) | Catalogue scope: terminology principles/methods. Clause-level requirements unevaluated: full normative text unavailable. | +| S9 | [ISO 1087:2019, edition 2](https://www.iso.org/standard/62330.html) | Catalogue scope: terminology vocabulary. Definitions/clauses unevaluated without full text. | +| S10 | [ISO 25964-1:2011, edition 1](https://www.iso.org/standard/53657.html) | Part 1, thesauri for information retrieval; full normative requirements unevaluated. The accessible catalogue also lists revision activity, not an adopted replacement here. | +| S11 | [ISO 25964-2:2013, edition 1](https://www.iso.org/standard/53658.html) | Part 2, interoperability with other vocabularies; full normative requirements unevaluated. | +| S12 | [PROV-O, 30 April 2013](https://www.w3.org/TR/2013/REC-prov-o-20130430/) | §§3.1–3.3 starting-point, expanded and qualified terms; §4 cross-reference for Entity, Activity, Agent and provenance properties. | +| S13 | [DCMI Metadata Terms, 20 January 2020](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/2020-01-20/) | Individual entries `identifier`, `source`, `creator`, `created`, `modified`, `hasVersion`, `isVersionOf`, `conformsTo`. | +| S14 | [DCAT 3, 22 August 2024](https://www.w3.org/TR/2024/REC-vocab-dcat-3-20240822/) | §6 vocabulary entries for Catalog, Dataset, Distribution and DataService; versioning properties. Applicable to published datasets, not every enterprise element. | + +## Standards matrix + +P1 means a prerequisite for a credible semantic exchange proposal; P2 means a +useful optional extension after that contract; P3 means defer until a consumer +exists. These are proposed priorities, not an implementation schedule. + +| Standard | Relevant Transitrix area | Current status | Gap | Recommendation | Priority | +| --- | --- | --- | --- | --- | --- | +| RDF 1.1 (S1) | T2–T3 identity, relations, context | Graph-like model; no reviewed RDF mapping contract | Local IDs and metadata cannot be reduced to unqualified triples | SE-02/03: scoped persistent identities and identified relation records | P1 | +| Turtle (S2) | T3, T8 serialization | YAML is not Turtle | A Turtle file represents one graph, not the entire dataset envelope | SE-03: optional graph serialization; preserve named-graph selection separately or use a dataset syntax | P2 | +| JSON-LD 1.1 (S3) | T2–T3, T8 exchange | No pinned JSON-LD context in the reviewed contracts | JSON-shaped YAML is not JSON-LD; coercion can erase nulls, ordering or reference types | SE-03: version a context and loss manifest; require round-trip examples before claiming interoperability | P2 | +| SKOS (S4) | T1 terminology and taxonomy | Partial conceptual alignment only | TERM does not declare a concept scheme, multilingual labels or thesaurus mappings | SE-01/07: opt-in concept projection, distinct from enterprise-object identity | P1 | +| OWL 2 / OWL 2 RL (S5) | T1, T3 TYPEs and relations | No reviewed ontology or RL profile declaration | Type names do not define class extensions or allowed axioms | SE-01/04: a small optional ontology with explicit RL checks; no automatic hierarchy conversion | P2 | +| SHACL 1.0 (S6) | T3, T6 validation | Existing validators are not SHACL engines | Shape targets, graph completeness and diagnostic mapping undefined | SE-04: separate graph constraints from inference and admission | P1 | +| SPARQL 1.1 (S7) | T5 graph reports | Existing report contracts, no semantic query contract | Query answers depend on graph selection, time and entailment | SE-05: competency questions with counterexamples and unknown states | P1 | +| ISO 704:2022 (S8) | T1 definitions/designations | Local fields offer partial terminology support; ISO conformance unknown | Concept characteristics, definition review and examples lack structured profile | SE-07: editorial concept record proposal; clause audit remains unevaluated | P1 | +| ISO 1087:2019 (S9) | T1 glossary language | Terminology vocabulary correspondence unevaluated | “TERM”, “Meaning”, concept and designation cannot be presumed identical | SE-07: maintain a reviewed correspondence table after normative access | P2 | +| ISO 25964-1:2011 (S10) | T1 glossary and retrieval | Glossary is not a declared thesaurus; requirements unevaluated | No reviewed thesaurus exchange or multilingual relationship profile | SE-07: optional retrieval vocabulary, preserving existing definitions | P2 | +| ISO 25964-2:2013 (S11) | T2 catalogue integration | Bindings do not establish thesaurus equivalence; requirements unevaluated | Mapping scope, provenance and equivalence strength unspecified | SE-02/07: curated mappings with source/version, never inferred from labels | P2 | +| PROV-O (S12) | T3–T4, T7 fact and document evidence | Local provenance fields and a document checker exist | Generic assertion evidence is not uniformly modeled | SE-06: separate fact, admission and generation records | P1 | +| Dublin Core Terms (S13) | T4 source documents, T7 outputs | Descriptive metadata can align | Field-level crosswalk and resource being described are unspecified | SE-06: optional document metadata mapping; `conformsTo` is not certification | P2 | +| DCAT 3 (S14) | T2, T9 distributed catalogues | Conditional applicability to dataset publication | No reviewed dataset/distribution/service publication contract | SE-08: evaluate on an exported catalogue dataset; inapplicable to individual ACTORs or RELs merely because they are catalogued | P3 | + +## Semantic gap register + +### SE-01 — concepts, classes and individuals + +A taxonomy entry may be a `skos:Concept`; an enterprise occurrence may be an +individual; a TYPE may become an `owl:Class` only under a defined interpretation. +These are different modeling decisions (S4 §§3, 8; S5 Structural §§5, 5.9). +For example, a retrieval concept “payment service” can index the individual +`APPLICATION-PAYMENTS-1`; it does not make that application a class. A +capability's `parent` relation is not automatically `rdfs:subClassOf`, nor is +`skos:broader` a generic organizational containment relation. + +Candidate default: distinct IRIs for the concept, ontology class and enterprise +object, connected by an explicitly defined annotation. Deliberate metamodeling +is a separate option: OWL 2 punning uses independent class and individual +interpretations under Direct Semantics; it does not license arbitrary +cross-level entailment. Any such option needs a profile-specific test. + +Positive: `ex:paymentConcept a skos:Concept` and `ex:app a ex:Application` with +an explicit indexing link. Negative: transform every TERM and application +with the same label into one `owl:sameAs` identity. Labels alone prove neither +identity nor class equivalence. T1's existing no-duplicate-TERM rule remains. + +**Compatibility:** an optional projection is additive. Reclassifying existing +IDs, merging by labels or changing `parent` semantics is potentially breaking +for catalogue resolvers, diagrams and report consumers. Depends on SE-02/07. + +### SE-02 — persistent IRIs and catalogue boundaries + +T2's identifiers are locally scoped, not globally persistent IRIs. Candidate +export identity is an immutable catalogue identity plus the applicable local +scope and ID. Include a parent scope for contained identifiers. A pathname, +repository basename, branch name or today's remote URL is not a persistence +policy. Keep the original ID and scope in export metadata and retain an +explicit registry mapping if a contained object is promoted without renaming. + +Two unrelated catalogues may both contain `GOAL-1`: positive export produces +two IRIs. Negative export produces one IRI by concatenating only a shared +namespace and `GOAL-1`. Catalogue central binding does not imply `owl:sameAs`: +preserve `canon_id`, origin source/version and the local incarnation (T2, T8). +IRIs identify resources; versioned snapshots identify descriptions of them. +S1 §3.2 supplies RDF identity syntax, not an operational persistence service. + +**Compatibility:** optional mapping is additive. Replacing local IDs or changing +IRI minting after publication is breaking for links and consumers; require a +migration/redirect mapping, collision tests and an ownership decision first. + +### SE-03 — representation and loss accounting + +An identified n-ary relation resource is the candidate default for REL (T3). +A shortcut edge may be derived for one declared as-of projection, but cannot +replace the relation's identity or history. RDF 1.1 datasets do not themselves +define what a graph name means (S1 §4); specify that policy explicitly. + +| Source information | Candidate representation | Loss or extension risk | +| --- | --- | --- | +| REL id, kind, from, to | IRI for the record with explicit kind/source/target properties | A single binary edge collapses parallel records and loses record identity. | +| REL and endpoint validity | Separate typed dates for each resource, explicit open-end marker | Filtering by relation date alone can include retired endpoints. No asserted temporal inference from RDF itself. | +| Admission, reviewer authority, agreement, workflow status | Separate properties/decision records | `active` admission is not temporal validity, truth, agreement or human approval. Preserve absent-field defaults and their derivation. | +| History sidecars | Identified attribute-version entries with date and value/gap marker | Latest-value-only export loses past queries; absent value is not a recorded null gap. | +| Lists, duplicate entries, null versus absent, extension fields | Ordered collections/occurrence records and explicit null markers where needed | RDF sets erase duplicate triples; JSON-LD ordinary arrays need not retain order; unhandled fields require an explicit loss report. | +| Catalogue, source revision, package/profile, selection, as-of date | Dataset manifest plus graph identities | A union of all graphs mixes versions, proposed and admitted facts. Missing selection closure is unknown. | +| Views | Derived output linked to source selection and configuration | Views cannot become a second authoritative fact home (T1, T3). | + +Candidate round-trip acceptance is semantic reconstruction of all supported +fields, including distinction between missing/defaulted/explicit values and +ordered occurrences. Byte-for-byte YAML restoration additionally needs retained +source bytes: comments, anchors, formatting and lexical forms are not an RDF +promise. Unknown extension fields must be retained opaquely with version and +loss status, or the export declared incomplete. No lossless claim is made here. + +Turtle (S2) can carry a selected graph; a dataset needs a manifest plus graph +files or a suitable dataset serialization. JSON-LD (S3) needs versioned term +expansion, IRI/datatype/language coercion and list/null rules. Neither syntax +alone supplies the Transitrix mapping. Changing existing storage is potentially +breaking; an optional export is additive. Dependencies: SE-02, SE-06. + +### SE-04 — validation, inference and rules + +The shapes below illustrate a closed validation boundary over one supplied graph. +They do not implement T3's admission judgment or T6's existing diagnostics. +Required fields, types, enumerations, endpoint presence, date order and local +language-label uniqueness can become graph constraints. Cross-catalogue alias +normalization, population completeness and source authorization additionally +need a declared dataset and adapter behavior. Human consistency/completeness +gates cannot be inferred from a shape passing. + +Inference is a separate step over a separate graph. A future OWL 2 RL candidate +must pass the Profiles §4.2 syntax restrictions and declare the §4.3 rule regime; +running some RL/RDF rules is not proof of profile conformance. A rule deriving +class membership cannot manufacture admission. Avoid automatic equivalence, +functional properties and cardinalities that unintentionally merge identities. +Positive candidate: named classes, subclass axioms and named-individual types. +Negative RL candidate: an existential restriction in a superclass position +requiring a newly existing filler; do not accept arbitrary OWL 2 DL as RL. + +**Compatibility:** optional validation adds evidence. Making shapes a new core +gate, altering defaults, or rewriting diagnostic codes is potentially breaking; +retain T6's original tool/version/form/code beside a separately versioned shape +result. Dependencies: SE-02/03 and approved constraint coverage. + +### SE-05 — query answers are scoped evidence + +The competency questions below use an explicit named graph, a fixed date and +no entailment. This makes absence meaningful only within that supplied complete +selection. Missing graphs, denied inputs and incomplete populations produce +**unknown**, not a zero-count success. T5 already separates requirement +populations, release scope and execution evidence; reuse that contract rather +than treating any assertion as proof of every release's compliance. + +**Compatibility:** read-only query proposals are additive. A union default graph, +changed end-date comparison, or different entailment regime changes answers and +must version the query contract. Consumers: reports, search and semantic APIs. +Dependencies: SE-03/04/06. + +### SE-06 — fact provenance is not approval or generation evidence + +Use a generic **fact record** or assertion occurrence in an optional export, +not a new meaning for Transitrix's requirement-specific `ASSERTION` (T4). +Candidate fields are source resource and locator, source version/digest, +responsible agent/author, assertion/capture timestamp and record version. +Unknown historical evidence stays explicitly unknown; a migration must not +invent timestamps or label author-supplied data as observed. + +| Fact basis | Candidate evidence | Interpretation boundary | +| --- | --- | --- | +| Declared | Author, declaration time, versioned source/locator | Records who said it; does not prove it. | +| Observed/imported | Observer/import activity, observed snapshot, source version, capture time | Importing a declaration proves its presence, not the underlying enterprise fact. | +| Inferred | Input fact IDs/versions, rule/ontology version, inference activity and time | Keep derived graph separate; reproducibility depends on input closure and regime. | +| AI-proposed | Proposal activity, tool/model identity, input references and time | Proposal basis remains after later admission; admission state and reviewer authority stay separate. | + +PROV-O (S12) offers Entity/Activity/Agent and attribution, derivation, generation +and qualified links. A local fact-basis vocabulary is still needed; provenance +properties alone do not enforce trust. Dublin Core (S13) can describe document +creator, dates, identifiers and source/version links. Describe the fact record, +source document and output artifact separately; their timestamps are not +interchangeable. Missing evidence is not a negative observation. + +Reuse T7 unchanged for generated documents: `model_id` denotes the model used +for generated prose. Repository/snapshot identity belongs in its separate +claims/observations interface. A supplied commit, timestamp or matching checksum +does not prove generation; `run.generation` remains unverifiable. Authorization +precedes loading, and a hidden subset must not leak through counts or findings. +An approved assertion does not certify the artifact's generation chain. + +**Compatibility:** additive records are possible without rewriting canon. +Mandatory retrospective provenance and repurposed `model_id` would be breaking. +Consumers include evidence viewers, document adapters and audit exports. +Dependencies: SE-02/03; T7 remains the document evidence boundary. + +### SE-07 — terminology and definition quality + +T1 already prevents a glossary from duplicating enterprise objects. Preserve +that behavior while evaluating a concept-oriented optional record. S8–S11 +justify the relevance of terminology/thesaurus work by scope only; the following +is a Transitrix proposal, not a claim to implement an unavailable ISO clause. + +| Editorial concern | Current support | Candidate addition / example | +| --- | --- | --- | +| Concept and context | TERM sense or enterprise object's own description | Identify subject field and discriminating characteristics without a duplicate TERM. | +| Definition | `description` | Review for scope and circularity: “A retained copy from which specified data can be restored” is a useful candidate definition of backup; “a backup is backed-up data” is circular. | +| Preferred designation | `name` | Explicit language and preferred designation per language; do not infer language solely from script. | +| Other designations | `aliases[]` | Distinguish alternative, hidden, deprecated and abbreviated forms; preserve the current normalized collision gate. | +| Concept relations | Typed enterprise RELs exist | Propose broader/narrower/associative concept relations separately; organizational parentage is not concept subsumption. | +| Examples/non-examples | Free prose | Example: a retained restorable snapshot. Non-example: an unretained live replica by itself. Attach rationale and source, not just labels. | +| Cross-vocabulary mapping | Catalogue bindings | Specify mapping strength, scheme/version and reviewer; label match does not imply exact equivalence. | + +SKOS's language-specific preferred-label condition is not T1's catalogue-wide +name/alias collision policy (S4 §5). Keep both distinct. A proposed multilingual +profile must decide how legacy untagged strings migrate; assigning every legacy +name English without evidence is not acceptable. ISO 25964 Parts 1 and 2 are +conditional candidates when a retrieval thesaurus/mapping service is needed, +not prerequisites for every glossary report. + +**Compatibility:** optional editorial metadata is additive. Relaxing collision +rules, mandating language tags, adding new canonical relation kinds or replacing +TERM's semantics requires a versioned migration for glossary and ingest +consumers. Depends on SE-01/02; ISO clause correspondence remains unevaluated +until authorized normative evidence is available. + +### SE-08 — publish dataset metadata only where applicable + +A released catalogue export could be a DCAT Dataset with separate Distributions +for exchange formats, inside a Catalog (S14 §6). Describe an actual DataService +only if one exists; a repository URL alone does not establish one. Keep dataset +version, source methodology/profile version and resource identity distinct. +An individual enterprise object is not a Dataset because it has a catalogue ID. + +**Compatibility:** optional metadata is additive; no current core adoption or +migration is proposed. Consumers: dataset discovery and exchange clients. +Dependencies: a real publication use case and SE-02/03/06. + +## Non-normative SHACL examples + +All `ex:` terms below are illustrative, using `https://example.org/review/`; +they are not a published Transitrix vocabulary. Validate the following Turtle +as one data graph, with the shapes in a separate graph, inference disabled. +The shapes intentionally cover only the listed properties. Passing them is +not complete Transitrix validation, SKOS conformance or approval. + +Positive data D1: + +```turtle +@prefix ex: . +@prefix xsd: . +@prefix skos: . +ex:app a ex:Element ; ex:admission "active" . +ex:cap a ex:Element ; ex:admission "active" . +ex:r1 a ex:Relation ; ex:from ex:app ; ex:to ex:cap ; + ex:kind ex:supports ; ex:admission "active" ; + ex:validFrom "2026-01-01"^^xsd:date ; + ex:validTo "2026-12-31"^^xsd:date . +ex:backup a skos:Concept ; skos:prefLabel "backup"@en . +``` + +Shapes H1 (relation structure/date order) and H2 (preferred-label proposal): + +```turtle +@prefix ex: . +@prefix sh: . +@prefix xsd: . +@prefix skos: . +ex:RelationShape a sh:NodeShape ; sh:targetClass ex:Relation ; + sh:property [ sh:path ex:from ; sh:minCount 1 ; sh:maxCount 1 ; + sh:nodeKind sh:IRI ; sh:class ex:Element ] ; + sh:property [ sh:path ex:to ; sh:minCount 1 ; sh:maxCount 1 ; + sh:nodeKind sh:IRI ; sh:class ex:Element ] ; + sh:property [ sh:path ex:kind ; sh:minCount 1 ; sh:maxCount 1 ; + sh:in ( ex:supports ) ] ; + sh:property [ sh:path ex:admission ; sh:minCount 1 ; sh:maxCount 1 ; + sh:in ( "active" "proposed" "rejected" ) ] ; + sh:property [ sh:path ex:validFrom ; sh:minCount 1 ; sh:maxCount 1 ; + sh:datatype xsd:date ; sh:lessThanOrEquals ex:validTo ] ; + sh:property [ sh:path ex:validTo ; sh:maxCount 1 ; sh:datatype xsd:date ] . +ex:ConceptShape a sh:NodeShape ; sh:targetClass skos:Concept ; + sh:property [ sh:path skos:prefLabel ; sh:minCount 1 ; + sh:datatype ; + sh:uniqueLang true ; sh:disjoint skos:altLabel ] . +``` + +The illustrative closed enum contains only `ex:supports`; it is not a copy of +the Transitrix relation registry. Requiring a language-tagged label is a proposed +profile restriction, stronger than merely checking SKOS's per-language maximum. +For these examples only, absent `validTo` means an open end. A production mapping +must distinguish source null, missing and unknown per SE-03 before validation. + +Each negative case starts afresh from D1; mutations are independent. + +| Case | Mutation | Expected result | +| --- | --- | --- | +| H-P | D1 unchanged | Conforms to H1 and H2 only. | +| H-N1 | Remove `ex:r1 ex:from ex:app` | H1 violation: minimum source count. | +| H-N2 | Replace `ex:cap` in `ex:to` with a literal `"cap"` | H1 violation: IRI/class constraint. | +| H-N3 | Change validTo to `"2025-12-31"^^xsd:date` | H1 violation: start exceeds end. | +| H-N4 | Add `ex:backup skos:prefLabel "reserve copy"@en` | H2 violation: two preferred labels in one language. | +| H-N5 | Add `ex:backup skos:altLabel "backup"@en` | H2 violation: same preferred and alternative label. | +| H-P2 | Change relation admission to `"proposed"` | H1 still passes structure; admitted-only query below excludes it. | +| H-P3 | Add `ex:backup skos:prefLabel "sauvegarde"@fr` | H2 passes; different language. | + +These cases demonstrate S6 cardinality/type/pair constraints; they do not check +all endpoint kinds, date windows, alias collisions or admission obligations. + +## Non-normative SPARQL competency questions + +Dataset QD contains exactly D1 in named graph `ex:admitted`, the following +metadata in named graph `ex:evidence`, and an empty default graph. The graph +name describes this fixture, not a proof that all its contents are admitted. +The query adapter must establish dataset completeness before answering. +For Q1, the fixture's endpoints are assumed valid for the queried date; a real +adapter must also select endpoint lifecycle and history values (SE-03). + +Evidence graph E1: + +```turtle +@prefix ex: . +@prefix prov: . +@prefix xsd: . +ex:r1 ex:basis ex:Declared ; prov:wasDerivedFrom ex:sourceV1 ; + prov:wasAttributedTo ex:author ; + prov:generatedAtTime "2026-01-02T10:00:00Z"^^xsd:dateTime ; + ex:recordVersion "1" . +ex:sourceV1 ex:sourceVersion "1" . +``` + +### Q1 — Which admitted relation records connect app to capability at a date? + +For the fixture, end dates are inclusive; changing this is a query-contract +decision. RDF and SPARQL do not decide that business convention. + +```sparql +PREFIX ex: +PREFIX xsd: +SELECT ?r WHERE { + GRAPH ex:admitted { + ?r a ex:Relation ; ex:from ex:app ; ex:to ex:cap ; + ex:kind ex:supports ; ex:admission "active" ; ex:validFrom ?start . + ex:app ex:admission "active" . ex:cap ex:admission "active" . + OPTIONAL { ?r ex:validTo ?end } + FILTER (?start <= "2026-06-01"^^xsd:date && + (!BOUND(?end) || ?end >= "2026-06-01"^^xsd:date)) + } +} ORDER BY ?r +``` + +Expected: exactly `ex:r1`. Negative: set its admission to proposed, or its end +to 2026-05-31, and expect no rows. Boundary: an end of 2026-06-01 still returns +r1. Put an otherwise matching r2 only in `ex:proposed`: it never appears. +A missing/denied `ex:admitted` graph must be reported unknown by the adapter, +even though the raw SPARQL engine would return no rows. + +### Q2 — Which relation records lack a complete recorded provenance tuple? + +This tests evidence presence, not its authenticity or approval. + +```sparql +PREFIX ex: +PREFIX prov: +SELECT ?r WHERE { + GRAPH ex:admitted { ?r a ex:Relation } + FILTER NOT EXISTS { + GRAPH ex:evidence { + ?r ex:basis ?basis ; prov:wasDerivedFrom ?source ; + prov:wasAttributedTo ?agent ; prov:generatedAtTime ?time ; + ex:recordVersion ?version . + ?source ex:sourceVersion ?sourceVersion . + } + } +} ORDER BY ?r +``` + +Expected on QD: no rows. Negative: remove sourceVersion or attributed agent +from E1 and expect exactly r1. An invented complete tuple also produces no rows; +it remains an unverified declaration. Denied evidence is unknown, not a missing +fact report. Inferred/AI-proposed cases additionally need their activity and +input/rule/model records from SE-06; Q2 alone does not cover those requirements. + +### Q3 — Are preferred labels ambiguous within a language? + +```sparql +PREFIX ex: +PREFIX skos: +SELECT DISTINCT ?concept WHERE { + GRAPH ex:admitted { + ?concept skos:prefLabel ?a, ?b . + FILTER (LANG(?a) = LANG(?b) && ?a != ?b) + } +} ORDER BY ?concept +``` + +Expected on QD: no rows. H-N4 returns exactly `ex:backup`; H-P3 returns no rows. +This is not the existing cross-element alias gate, a semantic definition check, +or a complete SKOS integrity suite. No same-label-to-same-identity inference is +permitted. These questions use S7 graph matching/negation and explicit datasets; +no result is claimed for an unspecified union graph or entailment regime. + +## Candidate requirements and decision topics + +The following MUST/SHOULD/MAY language is scoped to a **future optional semantic +exchange profile**, never to current adopters. Each item is a recommendation +for later synthesis and approval. + +| Candidate | Recommendation, rationale and exception | Compatibility | +| --- | --- | --- | +| C1 (SE-01/02) | MUST preserve source IDs/scopes and distinguish concepts/classes/individuals. No identity merge based solely on labels. Exception: an explicitly reviewed identity mapping with retained provenance. | Additive export; changed identity mapping needs migration. | +| C2 (SE-03) | MUST declare supported fields, context, time policy and loss status; MUST retain REL identity and source defaults. A deliberately lossy view MAY omit fields only when labeled a projection, never a round trip. | Additive; replacing canonical storage is breaking. | +| C3 (SE-04/05) | MUST separate shape validation, inference and admission; MUST report incomplete/denied query scope as unknown. SHOULD retain versioned diagnostic provenance. Exception: none to presenting unknown as success. | Optional results additive; new mandatory gates require versioned migration. | +| C4 (SE-06) | MUST distinguish declaration, observation, inference and proposal, with source/agent/time/version or explicit unknowns. MUST NOT infer generation from hashes. Legacy records MAY remain unknown rather than fabricated. | Additive evidence; retrospective mandatory fields breaking. | +| C5 (SE-07) | SHOULD document concept context, definition, preferred designation, relations, examples and non-examples. MAY keep these in editorial review until a package schema is approved. Do not duplicate enterprise definitions as TERM. | Additive editorial practice; terminology schema changes need consumer review. | +| C6 (SE-08) | MAY describe actual published datasets with DCAT and documents with Dublin Core. SHOULD omit unsupported service/conformance claims. No metadata requirement for non-publishing adopters. | Additive opt-in. | + +| ADR topic | Options and recommendation | Recommended decision owner | +| --- | --- | --- | +| A1: resource identity | Shared ID namespace; catalogue-scoped persistent IRIs; per-snapshot-only identities. Recommend persistent scoped resource IRIs plus separate snapshots (SE-02). | Methodology governance, with catalogue consumer maintainers. | +| A2: representation and time | Bare edges; identified relation records; both with derived shortcuts. Recommend records plus scoped shortcuts and an explicit end-date/null policy (SE-03). | Metamodel maintainers, with report/export implementers. | +| A3: entailment and validation | No inference; bounded OWL 2 RL; unrestricted OWL 2. Recommend no inference by default, separately tested RL as opt-in; shapes never grant admission (SE-04). | Semantic-tool and validator maintainers. | +| A4: terminology | Expand core TERM; optional terminology package/projection; editorial guidance only. Recommend guidance first, optional profile after source/consumer review (SE-07). | Methodology governance with terminology reviewers. | +| A5: provenance | Artifact-only evidence; per-fact occurrences; graph-level provenance only. Recommend fact occurrences where sources differ, graph provenance for homogeneous captures, T7 separately for documents (SE-06). | Evidence/document consumer maintainers with methodology governance. | + +These are proposed ADR topics, not adopted decisions. Their answers are needed +before implementation, not to complete this evidence review. + +## Backlog proposals and acceptance boundaries + +| Proposal | Acceptance evidence | Dependency | Compatibility / priority | +| --- | --- | --- | --- | +| B1: identity mapping contract | Two catalogues with identical local IDs remain distinct; contained-object promotion retains identity; relocation and central binding have explicit mappings. | A1; SE-02 | Optional additive exporter; identity changes require migration / P1. | +| B2: representation contract and round trip | Preserve parallel RELs, lifecycle, null/missing/default distinctions, history gaps, list order, admission and unknown extensions; publish supported/lossy cases for both Turtle graph bundles and JSON-LD context. | B1, A2; SE-03 | Additive exchange; no core migration assumed / P1. | +| B3: validation and query profile | H/Q cases pass expected outcomes; add endpoint-time, complete/partial/denied population and inference-isolation cases; bind shape/query/tool versions and preserve original diagnostics. An RL option needs syntax and entailment tests, including a rejected non-RL axiom. | B2, A3, T5–T6 | Additive optional checks; mandatory gate is breaking / P1. | +| B4: fact provenance crosswalk | Demonstrate all four fact bases, missing evidence and authorized/denied bundles; preserve admission separately; replay input/rule versions for inference; demonstrate that matching digests still do not prove document generation. | B1–B2, A5, T7 | Additive, no `model_id` change / P1. | +| B5: terminology evidence/profile | Obtain authorized normative access or retain named unknowns; review concept/definition/designation correspondence against exact ISO clauses; test multilingual labels, circular definitions, examples/non-examples, existing duplicate-TERM rejection and non-equivalent mappings. | A4, B1; S8–S11 | Optional profile additive; schema/gate changes need migration / P2. | +| B6: dataset publication metadata | Identify a consumer; describe one real Dataset and its Distributions, version and source; do not invent a service or certification assertion. | B2, B4; SE-08 | Optional metadata / P3. | + +No backlog item is commissioned or implemented by this review. ISO 704:2022, +ISO 1087:2019 and both assigned ISO 25964 parts retain a named normative-access +limitation. OWL/RL profile approval, IRI ownership, temporal boundary semantics, +provenance capture and optional terminology/DCAT adoption remain explicit design +decisions. None is silently resolved by a source merge or by a passing example. diff --git a/guides/adoption-health-profile.md b/guides/adoption-health-profile.md index c5fa1962..99fe21c5 100644 --- a/guides/adoption-health-profile.md +++ b/guides/adoption-health-profile.md @@ -8,7 +8,7 @@ license: MIT # Adoption health profile -This is a proposed review method, not a shipped command or an adoption certification. It helps an adopter identify gaps worth investigating. The repository's `repo-check` provides configuration and coverage information; it does not implement this whole profile. +This is a proposed review method, not an adoption certification. The [health-profile skill](../transitrix/skills/health-profile/README.md) ships a runnable, bounded collector for a synthetic pilot; neither it nor `repo-check` implements the whole profile. The collector reports all six indicators, marking unsupported results unavailable. It helps an adopter identify gaps worth investigating. The adopter owns the review scope, evidence and interpretation. No central telemetry, universal healthy threshold or automatic admission gate is implied. Health findings do not fail validation or CI. Compute the profile on demand; a static export is a dated snapshot, not live state. Collection and reconciliation require effort; the indicators can be incomplete or manipulated and must remain inspectable. @@ -39,4 +39,25 @@ Do not turn six measures into a single score without an explicit adopter decisio Identify a collector and its supported rules, supply the required sources and permissions, and test known valid, invalid, stale and missing-evidence cases. Publish the report's scope and collection failures alongside its results. Retain enough input identity to reproduce a calculation without exposing protected content to an unintended audience. -Until that implementation and its coverage are verified, use this as a manual review checklist and label results accordingly. Completing the checklist does not establish organisation-wide adoption, completeness or correctness. +Use the shipped collector only for its documented supported subset; use the remaining profile as a manual review checklist and label those results accordingly. Completing the checklist does not establish organisation-wide adoption, completeness or correctness. + +## Candidate metrics within this profile + +These metrics refine the existing indicators; none creates an adoption score or requires a new model field. + +| Candidate metric | Existing home | Required evidence and current collector limit | +| --- | --- | --- | +| Change acceptance time | Assertion queue operational drill-down | Actual submission and accepted-review timestamps for the stated cohort and period; exclude cancellation/administrative closure and expose held work. No workflow collector is implemented. | +| Open review age | Assertion queue operational drill-down | Actual opening timestamp, observation/effective time, review target and adopter policy. Compare age with an SLA only when one is explicitly supplied. Unavailable in the shipped subset. | +| Current validation | Validity | Executed checks bound to exact inputs and rules. The collector reuses existing atomicity checks over parsed records; full notation/schema/admission validation remains outside this subset. | +| Reference integrity | Connectedness diagnostic | Existing linter checks on the declared parsed cohort. Resolved references do not establish graph completeness; supported fields and unchecked shapes are listed in the report. | +| Requirement verification coverage | Connectedness / traceability drill-down | Declared applicable requirements and their scoped verification links/evidence/outcomes, with exclusions and unknowns. A link is not a passing verification. This collector does not compute that ratio; it never represents adoption success. | +| Review freshness | Freshness for canonical reaffirmation; queue drill-down for workflow reviews | Qualified admission date and explicit per-type decay policy for canonical records. Workflow review timestamps/policies require a separate collector and remain unavailable. | + +There is no genuinely missing seventh indicator in these candidates. Extending collection requires real sources, an explicit population and rules, and positive/negative controls. Git author time, file timestamps and invented review targets cannot stand in for those sources. + +## Reproducible collector subset + +The [scanner README](../transitrix/skills/health-profile/README.md) defines the common Python/Node entry points, dependencies, supported checks and calculations. It distinguishes parsed file classification from distinct canonical-ID inventory, and admitted inventory from an active lifecycle cohort. Reports retain effective date, observation time, revision and input hashes, rule identity, scope, numerator/denominator, exclusions and unknowns. Zero known evidence is unavailable; an empty applicable population is not applicable. + +The shipped synthetic controls exercise fresh-checkout/synchronization invariance, policy-qualified reaffirmation, absent evidence/policy, exclusions, duplicate IDs, parse failures, empty populations, and positive/negative existing atomicity/reference checks through both runnable entry points. Health findings remain informational; ordinary validator gates are unchanged. Consumer propagation and operational data collection are not established by these synthetic tests or by a source merge. diff --git a/guides/capability-map-compatibility.md b/guides/capability-map-compatibility.md new file mode 100644 index 00000000..d2f86381 --- /dev/null +++ b/guides/capability-map-compatibility.md @@ -0,0 +1,45 @@ +# Capability-map compatibility checks + +This change corrects the core methodology. It adds optional native fields rather +than requiring a renderer-specific extension. No existing methodology version +pin changes until a release is prepared under CONTRACT §10. + +| Surface | Checked on 2026-10-23 | Limit | +| --- | --- | --- | +| Published additive JSON Schema | Draft-07 AJV with date-format assertions: nine fixture fragments accepted; four malformed controls refused | Validate the selected definition, not the full organisation envelope | +| `tools/lint.py` | Positive/negative integration cases, legacy omission, published schema/vocabulary parity and existing capability examples | New fields, mapping references, local keys, dates and view selections; no history reconstruction or renderer geometry | +| CLI `@transitrix/cli@2.11.0`, file scope | Native capability-map example returns zero errors and six `NOTATION-SKIP-001` warnings for unavailable maturity sidecars | The result says the file remains unvalidated; it is not full compatibility proof | +| CLI negative control | The same file with `management_cycle_stage: ESG` and `view_config.display.depth: 99` still returns zero errors | Released CLI does not enforce these new core contracts; run the reference linter and do not silently treat this acceptance as validation | +| DSM / Studio / standalone renderer | Not adopted by this source change | Separate consumer implementation and release evidence required | + +The reference validator preserves its existing single-file installation shape: + +```sh +python tools/lint.py +python -m unittest discover -s tools/tests -p test_capability_contract.py +python tools/tests/test_lint_encoding.py +``` + +The complete synthetic source model lives in +`tests/fixtures/capability-management-cycle/`. From that directory, run +`python ../../../tools/lint.py`. The view example is checked against that fixture +for drift. Past, present and future dates are accepted as selections; validating +a date does not establish that evidence exists for it. + +The new validator rejects malformed **new** native fields. Existing source data +without them remains valid; it is not classified from names, H/V orientation, +parent stages, tags or maturity. Existing direct application coverage fields +retain their previous validation boundary; new technical mappings always check +canonical CAPABILITY targets before display filtering. Common free-form tags +are not narrowed to ESG, MDM and Support. + +For proposals that placed these values under `extensions`, move +`extensions.management_cycle_stage` to the defined native field explicitly. +Reconcile conflicts before moving and retain the source history. Do not infer +stages from a legacy renderer's `layer`: canonical architectural `layer` remains +`business`. Native APPLICATION technical entry `key` projects to standalone +renderer `id`; source and adapter endpoint conventions require explicit date +conversion. This is a mapping boundary, not a new global technical TYPE. + +CLI/DSM/Studio adoption, whole-source temporal assessment, source-to-renderer +projection and product release remain separate from this methodology PR. diff --git a/guides/modelling-capabilities.md b/guides/modelling-capabilities.md index 73db084f..d3018b55 100644 --- a/guides/modelling-capabilities.md +++ b/guides/modelling-capabilities.md @@ -1,7 +1,7 @@ --- title: Modelling capabilities status: active -last_reviewed: 2026-09-14 +last_reviewed: 2026-10-23 audience: public license: MIT --- @@ -31,3 +31,34 @@ attribute_versions: ``` Before accepting the map, check IDs and references, admission and lifecycle, sidecar placement, and the evidence behind each assessment. Confirm the view displays the selected date's values. A rendered diagram alone does not establish model validity. Full sidecar rules and migration guidance are in the specification's attribute-history section. + +## Management cycle, tags and system coverage + +Use the capability element's optional `management_cycle_stage` to state its +management role. The five definitions and order live in +[capability-map §6a](../notations/views/diagrams/05-capability-map.md#6a-management-cycle-stage-and-tags). +Strategic includes strategic planning; Planning is tactical/operational. Keep +architectural `layer: business`. ESG, MDM and Support are ordinary tags, not stages +or automatic horizontal capabilities. Classify explicitly and never inherit. + +Record a system's direct `capabilities` on its APPLICATION element. Where the +source identifies technical abilities, record them as the application's native +`technical_capabilities` inventory, with unique local keys and explicit targets, +per [the applications contract](../notations/views/diagrams/10-applications.md#6a-technical-capabilities-and-business-coverage). +Neither field belongs in an `extensions` bag or solely inside a view. Missing +mapping means not specified. Do not infer mappings from containment or names. + +Choose stage grouping, tag filters, selected systems and date in the map's +[declared view_config](../notations/views/diagrams/05-capability-map.md#163-view_config-defaults). +Retain observation date, model-validity date, revision and target intent when +comparing snapshots. A red geometric intersection is an investigation aid, not +a finding of redundant functionality. Confirm source evidence before drawing +that conclusion. + +These core-contract corrections are prepared for review. Current standalone +rendering uses a documented JSON projection; this is not proof of native CLI, +DSM or Studio adoption. Verify consumer support before migrating source files. + +The core additive schemas and whole-model checks are described in the +[capability-map compatibility guide](capability-map-compatibility.md). They ship +with the methodology source; released consumers require separate adoption. diff --git a/guides/requirement-chain.md b/guides/requirement-chain.md index 5c6da549..bb02ef64 100644 --- a/guides/requirement-chain.md +++ b/guides/requirement-chain.md @@ -18,9 +18,9 @@ The proposed `source_trace` records the deliberate citation. Keep permitted code citations in `derived_from`; do not put a driver, raw research ID or documents package ID in REQUIREMENT `derived_from`. -Model the product and the project (an ACTION with `type: Project`) before scoping -requirements. The proposed product/project membership relations name where a -requirement belongs even before any release exists. `required_for` still answers +For 0.2 product reports, model the product and the project (an ACTION with +`type: Project`) before scoping requirements. The proposed product/project +membership relations name where a requirement belongs even before any release exists. `required_for` still answers which release must carry the obligation. A requirement assigned to another release is not unassigned; a broken release link needs repair, not a clean unassigned label. No script can safely recover membership from matching names or folder placement. @@ -43,3 +43,10 @@ snapshot. Unclassified, unassigned, invalid and unresolved are different states. The six categories overlap. Neither cardinality nor a child's passing test proves a parent's completion. See the [worked example](../notations/examples/requirement-chain/README.md) for the exact expected populations and drill-downs. + +For application membership, separate subject identities and physical +products, see the [accepted requirement-chain/0.3 subject-scope contract](../notations/views/reports/requirement-subject-scope.md) +and its [synthetic subject cases](../notations/examples/requirement-subject-scope/README.md). +The 0.2 contract remains unchanged; 0.3 consumers preserve product calls through an +explicit compatibility adapter. Use the added relation kinds and PRODUCT value +only with methodology and consumer versions that declare support. diff --git a/method/00-glossary.md b/method/00-glossary.md index 44f50250..cc7ae9dd 100644 --- a/method/00-glossary.md +++ b/method/00-glossary.md @@ -2,7 +2,7 @@ **Purpose:** Plain-language definitions of Transitrix terms and abbreviations, for readers who don't yet know the vocabulary. For anything that changes as the methodology evolves — the full TYPE registry, relation kinds, field names — this glossary links to the authoritative spec rather than repeating it, so it can't drift out of sync the way a duplicated list does. **Format:** English -**Last updated:** 2026-07-04 +**Last updated:** 2026-10-21 --- @@ -12,7 +12,7 @@ |---|---| | **Transitrix** | Text-native methodology for managing enterprise architecture as code: models, processes, and capabilities stored as YAML files in a Git repository. | | **Architecture-as-Code (AaC)** | Approach to defining and managing architecture through version-controlled text files rather than a GUI-only modelling tool. | -| **ArchiMate** | The Open Group's open standard for enterprise architecture modelling (current version: 3.2). Transitrix's element and relation vocabulary is grounded in it — see [ArchiMate alignment](#archimate-32-alignment) below. | +| **ArchiMate** | The Open Group's standard for enterprise architecture modelling. This methodology compares against edition 3.2; its element and relation vocabulary is grounded in that foundation — see [ArchiMate alignment](#archimate-32-alignment) below. | | **Element** | An architectural primitive — the atomic unit of modelling (a goal, a role, a process, an application component). One element = one file. | | **Relation (`REL`)** | A first-class, time-aware, typed link between two canonical primitives (`valid_from` / `valid_to`), stored as its own file under `canon/relations/`. See [`elements/17-relations.md`](../notations/elements/17-relations.md) for the closed enum of relation kinds (e.g. `parent`, `action_goal`, `depends_on`, `offers`, `realizes`, `hosts`, `uses`). | | **Atomicity** | Principle by which an element's description and its relations are stored in separate files — an element file never inlines a first-class relation. | @@ -96,7 +96,13 @@ Full grammar, the exception, and the complete TYPE registry (element types, docu ## ArchiMate 3.2 alignment -Transitrix is grounded in ArchiMate 3.2 but uses deliberately simplified or domain-friendly names in a few places. This table records only the **intentional divergences** — for the full TYPE list see [`notations/IDS_AND_REFERENCES.md`](../notations/IDS_AND_REFERENCES.md) §3. +ArchiMate 3.2 is Transitrix's starting foundation. Model representation quality, +precision and useful validation take precedence over strict fidelity. Similar +names do not establish equivalent semantics. The authoritative detailed +[ArchiMate differences register](../docs/standards-review/archimate-differences.md) +records exact differences, rationale, status, direction, loss and compatibility; +the table below is only a terminology introduction, not a second mapping registry. +For the full TYPE list see [`notations/IDS_AND_REFERENCES.md`](../notations/IDS_AND_REFERENCES.md) §3. | Transitrix TYPE | ArchiMate 3.2 term | Note | |---|---|---| @@ -108,7 +114,11 @@ Transitrix is grounded in ArchiMate 3.2 but uses deliberately simplified or doma | `ACTOR` | Business Actor | A single active-structure identity type (`person` \| `business_unit` \| `system`) replacing the former separate `UNIT` / `EMPLOYEE` TYPEs. | | `TERM` | Meaning | "Term" is more accessible than ArchiMate's "Meaning" for a business-vocabulary entry (name + definition, no modelled behaviour). | -Everything else in the registry (`GOAL`, `DRIVER`, `CONSTRAINT`, `REQUIREMENT`, `STAKEHOLDER`, `ASSESSMENT`, `EQUIPMENT`, `ROLE`, `PROCESS`, `CAPABILITY`, `APPLICATION`, `NODE`, `TECHNOLOGY_SERVICE`, `BUSINESS_SERVICE`, `LOCATION`, …) uses the ArchiMate term directly or a name aligned with it — no divergence to record. +Other names can align with ArchiMate while their structure, lifecycle, endpoints +or interpretation still differ. Consult the detailed register before asserting +equivalence; unmapped or lossy cases remain explicit. The +[Semantic Standards Profile](semantic-standards-profile.md) distinguishes concept, +class and instance and specifies identity, evidence and mapping-claim boundaries. --- diff --git a/method/03-modelling.md b/method/03-modelling.md index 0c4c7a1b..e1fc11e0 100644 --- a/method/03-modelling.md +++ b/method/03-modelling.md @@ -17,6 +17,17 @@ Two file shapes do most of the work: **elements** (objects) and **relations** (c ### 1.1 Element template +The simplified examples in §1.1–1.2 illustrate objects and edges; they are +**not canonical authoring templates**. Canonical primitives use `notation`, the +per-TYPE subtype vocabulary and the shared admission/lifecycle envelope; canonical +REL files use `from` / `to` and the local kind enum. Copy the +[primitive contract](../notations/ELEMENT_PRIMITIVES.md) or +[canonical REL schema](../notations/elements/17-relations.md) +when authoring. `ApplicationComponent`, `source` / `target` and `Access` below +are conceptual illustration labels, not newly admitted canonical values. +No parser conversion is implied. For comparisons and exchange claims use the +[Semantic Standards Profile](semantic-standards-profile.md) and its linked register. + ```yaml id: "APPLICATION-ORDERS-1" # TYPE-DOMAIN-INTEGER, uppercase, hyphens only, no leading zeros name: "Order API" # Human-readable name diff --git a/method/semantic-standards-profile.md b/method/semantic-standards-profile.md new file mode 100644 index 00000000..f1b0dc52 --- /dev/null +++ b/method/semantic-standards-profile.md @@ -0,0 +1,207 @@ +# Transitrix Semantic Standards Profile + +**Profile version: 1.0.** This is the normative documentation contract for an +explicit claim of conformity to this profile. It does not assert that existing +Transitrix tools implement RDF exchange, OWL reasoning, SHACL validation or a +SPARQL endpoint. Canonical authoring remains Git/YAML under the +[notation contract](../notations/CONTRACT.md); existing file schemas, identifiers, +admission rules and diagnostic meanings are unchanged. + +Architects can read a [concise interoperability explanation](https://transitrix.com/semantic-standards/?utm_source=methodology-semantic-profile). +The [standards review](../docs/standards-review/README.md) supplies the evidence, +editions, findings and access limitations behind this profile. The +[ArchiMate differences register](../docs/standards-review/archimate-differences.md) +is the single detailed home for comparisons, including partial and lossy mappings. +Neither this profile nor that register establishes standards certification. + +## Scope, language and conformance + +**MUST** identifies an obligation for the explicitly claimed scope. **SHOULD** +identifies a recommendation: a departure needs a stated reason, assessed effect +and evidence. **MAY** identifies a permitted option. These words express this +Transitrix contract, not a reproduction of inaccessible standards requirements. + +There are three independently declared scopes: + +- **A — authoring and interpretation:** definitions, original local identities, + source authority and truthful capability/mapping claims. This adds no required + YAML fields or new automated admission gate. +- **X — a described semantic interchange:** an optional mapping contract and its + selected formats, identity, context, loss, evidence and compatibility. Choosing + X does not commission an exporter or replace source storage. +- **T — a tool's claim of profile support:** the exact implemented subset, versions, + test evidence, limitations and unsupported behavior. A documentation proposal + is not an implementation claim. + +A conformity declaration MUST identify profile version, subject/source revision, +selected scopes and formats, satisfied rule IDs, evidence and explicit deviations. +It MUST NOT use a partial scope as a claim that all Transitrix software conforms, +or treat conformity to this local profile as conformity to an external standard. +There is no default claim for an existing model or tool merely because it uses +Transitrix terminology. A diagram, valid YAML, successful render or approved +assertion alone is insufficient evidence. + +For a SHOULD deviation or permitted exception, record the rule, scope, reason, +alternative, responsible maintainer, affected versions and evidence. An exception +cannot authorize a false implementation/conformance claim, label unknown evidence +as verified, or hide semantic loss. An incompatible core/schema change, a concrete +ontology adoption or a new service requires its own recorded architecture decision +and compatibility work; this profile supplies none of those decisions. + +## Concepts, identity and authority + +A **taxonomy** is an organized concept scheme for classification or retrieval, +with explicitly interpreted broader/narrower/related links. An **ontology** defines +classes, properties and their formal interpretation or axioms. A **knowledge graph** +is a selected graph or dataset of identified resources and assertions, with declared +context and evidence; being graph-shaped alone does not establish an ontology or +entailment regime. A taxonomy can index resources in a knowledge graph; an optional +ontology can describe their classes. None of these roles implies another. + +`skos:Concept`, `owl:Class` and an individual have distinct semantic roles. A +retrieval concept about applications is not the class of applications, and neither +is a particular application. Sharing a label does not justify identity or class +equivalence. Deliberate metamodeling must name its interpretation and test its +consequences; it cannot silently reinterpret a canonical TYPE or TERM. Existing +[TERM and glossary semantics](../notations/ELEMENT_PRIMITIVES.md) remain +authoritative; an enterprise object's definition is not duplicated as a TERM. + +ArchiMate 3.2 is a starting foundation, not an overriding fidelity constraint. +Preserve useful distinctions in identity/stake, history, obligations and evidence. +Compare actual meanings, direction and applicability rather than substitute +similarly named types or relations. The element/relation specifications remain +authoritative for Transitrix behavior; the differences register explains comparisons. + +## Applicable rules and evaluation + +All rule evidence is bound to the declared subject, source/methodology/profile +revision and selected scope. Standards locators and known access limits are in +the [semantic](../docs/standards-review/semantic-evidence.md#authoritative-source-register) +and [architecture](../docs/standards-review/architecture-evidence.md#sources-and-access) +source registers. A source field's presence establishes a declaration, not its truth. + +| Rule / scope | Standard and finding | Transitrix obligation | How satisfaction is evaluated | +|---|---|---|---| +| **SSP-01 — roles and interpretation; A/X/T** | SKOS 2009 §§3–5, OWL 2 Structural 2012 §§5/9; SE-01/07 | MUST distinguish concept, class and individual; MUST NOT infer identity from labels or `subClassOf` from organizational parentage. A deliberate metamodeling option MUST state its separate interpretations. | Three-role example and a rejected same-label merge; preserve existing duplicate-TERM behavior. No unreviewed TYPE reinterpretation. | +| **SSP-02 — persistent identifiers; X/T** | RDF 1.1 Concepts 2014 §3.2; SE-02 | MUST preserve local ID, catalogue identity and containment scope separately from the resource IRI. MUST document namespace controller, minting rule, collision policy, persistence and successor/redirect policy. A branch/path/repository basename alone MUST NOT define identity. | Two catalogues with the same local ID produce distinct resources; relocation retains identity; contained-object promotion has an explicit mapping. No specific production namespace or registry service is selected here. | +| **SSP-03 — reuse and mappings; A/X/T** | SKOS 2009 §10, RDF 1.1; SE-01/02/07, REC-03 | SHOULD reuse an applicable published vocabulary with pinned edition/context; MUST state a mapping's direction, strength, source/version, provenance and loss. MUST NOT turn label similarity into `owl:sameAs`, exactMatch or class equivalence. | Distinguish exact, broader/narrower, related and unmapped cases. A partial or lossy projection is labeled as such; no lossless claim without evidence. | +| **SSP-04 — graph and formats; X/T** | RDF 1.1 Concepts 2014 §§3–4, Turtle 2014, JSON-LD 1.1 2020; SE-03 | MUST declare graph/dataset selection and selected exchange formats. RDF claims MUST use RDF 1.1 semantics. A Turtle target MUST state how a dataset is packaged; a JSON-LD target MUST pin its context and coercion/list/null rules. MUST preserve relation identity and supported fields or explicitly report loss. | Reconstruct parallel/recurring RELs, endpoint/window selection, admission, history, missing/null/default values, ordered occurrences and unknown extensions. Byte-identical YAML round trip is not promised without retained source bytes. | +| **SSP-05 — assertion provenance; A/X/T** | PROV-O 2013 §§3–4; SE-06, C4 | MUST distinguish declared, observed/imported, inferred and AI-proposed evidence where such a claim is made. MUST identify source/locator, source and record versions, responsible agent and time, or explicitly retain unknowns. SHOULD map to PROV-O where exchanging that evidence. | Demonstrate all four bases, missing/denied evidence and differing assertion sources. Inference retains input/rule versions; an import proves source presence, not enterprise truth. Admission/approval and document generation remain separate. No retrospective fabricated evidence. | +| **SSP-06 — validation and queries; X/T** | SHACL 1.0 2017 §§2–5, SPARQL 1.1 Query 2013 §§8–9/13/16–17, OWL 2 Profiles 2012 §§4.2–4.3; SE-04/05 | MUST separate structural constraints, inference and admission. A SHACL claim MUST identify shapes/data graphs and engine/version; a SPARQL claim MUST identify dataset/time/entailment and completeness. Denied/incomplete scope MUST remain unknown at the adapter boundary. SHOULD preserve original diagnostic identities and versions. | Positive and negative H/Q cases, time boundaries, endpoint lifecycles and graph isolation. An OWL/RL claim needs its own syntax/entailment tests. No engine, endpoint or inference is required merely to author YAML. | +| **SSP-07 — vocabulary lifecycle; A/X/T** | RDF/SKOS identity, DCAT 3 2024 version metadata; SE-02/03/07/08 | MUST distinguish resource identity, description snapshot, vocabulary/profile version and source-methodology version. MUST retain deprecated IDs with successor and compatibility notes; MUST NOT reuse an ID for a different meaning. SHOULD publish mappings for renamed or retired terms. | Existing references remain interpretable after rename/deprecation; new versions identify changed meanings/contexts and losses. No automatic deletion, redirect service or tool behavior is assumed. | +| **SSP-08 — compatibility; A/X/T** | Local compatibility contract §10; SE-02–07, REC-03/04 | MUST assess changed identity, meaning, required fields, relation direction, context expansion and diagnostics against consumers. MUST document migration/version implications before an incompatible implementation. Optional outputs MAY be additive; no automatic major/minor classification overrides the existing contract. | Compare before/after interpretations and affected parsers, resolvers, views/reports, catalogue bindings and historical queries. Keep unsupported/unknown distinct from success. | +| **SSP-09 — terminology; A** | ISO 704:2022 / 1087:2019 scope, SKOS 2009; SE-07, C5 | SHOULD describe concept/context, definition, preferred designation, other designations, relations and examples/non-examples. MUST label ISO clause correspondence unevaluated where full evidence is unavailable. | Review non-circular definitions, language-specific labels and non-equivalent mappings without duplicating canonical enterprise definitions. No new mandatory terminology fields or unsupported ISO compliance claim. | +| **SSP-10 — architecture and mapping register; A/X/T** | ISO 42010:2022 conceptual mapping, ArchiMate 3.2; ARC-001–009/015, AM-001–014 | MUST identify comparison edition and subject; MUST preserve partial/non-equivalent mappings. A change introducing, changing or removing an ArchiMate difference MUST update its stable register entry in the same change. SHOULD use an optional AD evidence companion where stakeholder/concern coverage matters. | Entry contains edition/concept, exact Transitrix path/revision, difference, benefit/tradeoff, status, direction/loss, consumers/compatibility and decision reference or explicit unknown. Retain deprecated IDs; do not promote proposals to accepted semantics without a recorded decision. | +| **SSP-11 — claim boundaries and optional metadata; A/X/T** | PROV-O/DCMI Terms 2020/DCAT 3 2024; REC-01/05/06 | MUST state implemented versus specified/proposed/unevaluated capability. MAY use Dublin Core for actual described resources and DCAT for real datasets/distributions. MUST NOT invent a service, selected upper ontology, external registration, conformance or certification. | Inspect claim, named resource/consumer, exact implementation/test evidence and remaining unknowns. No specific BFO/DOLCE/ODM/11179 profile or external system follows from this document. | + +## Disposition of the reviewed candidates + +The review's preliminary stack is not a universal replacement for current authoring. +This version specifies the following bounded documentation contract; an unimplemented +selected target still needs separate source, decision, compatibility and release evidence. + +| Candidate | Disposition and rationale | Scope / findings | +|---|---|---| +| RDF 1.1, stable IRIs, named graphs | Change universal adoption to explicit X/T claims. Retain scoped persistent identity and declared context; named graphs are recommended where context/provenance requires them. | SSP-02/04; SE-02/03. No mandatory RDF storage. | +| Turtle and JSON-LD 1.1 | Change universal format mandates to requirements for each selected target. A claimed format must preserve its stated contract; neither format alone supplies a Transitrix mapping. | SSP-04; SE-03. No exporter is delivered. | +| SKOS / ISO 25964-1:2011 and -2:2013 | Retain SKOS as a selected concept-scheme mapping; defer ISO normative correspondence without full evidence. A glossary is not automatically a thesaurus. | SSP-01/03/09; SE-01/07. Optional retrieval profile. | +| OWL 2 / RL | Defer mandatory ontology/inference adoption. A selected optional ontology must declare interpretation and regime; no inference by default is introduced into existing tools. | SSP-01/06; SE-04/A3. Concrete ontology choice requires a separate decision. | +| SHACL 1.0 | Change universal validator requirement to explicit X/T graph-constraint claims, separated from current validators and admission. | SSP-06; SE-04. H1/H2 remain illustrative shapes. | +| SPARQL 1.1 | Change blanket support to explicit query claims with dataset/completeness evidence. Query examples do not implement Update, Protocol or an endpoint. | SSP-06; SE-05. Q1–Q3 are examples. | +| ISO 704:2022 / ISO 1087:2019 | Use original concept-oriented guidance; defer clause-level normative correspondence. Full text was unavailable in the review. | SSP-09; SE-07. No certification or new core schema. | +| ISO/IEC/IEEE 42010:2022 / 42020:2019 | Retain edition-specific conceptual alignment; defer conformance and new process mandates pending complete evidence. | SSP-10/11; ARC-001–010. Architecture Model has the review's 2022 qualification. | +| PROV-O | Retain optional provenance interchange, with required truthful source/basis distinctions for evidence claims. | SSP-05; SE-06. Existing document provenance remains separate. | +| Dublin Core Terms / DCAT 3 | Retain conditionally for actual resources/datasets and consumers, not every catalogued element. | SSP-11; SE-08. No invented service or registry. | +| ISO/IEC 21838-1:2021 / BFO / DOLCE | Defer upper-ontology adoption; neither a specific ontology nor its axioms are selected. A concrete choice needs a dedicated architecture decision and representative cases. | SSP-11; ARC-011–013. No required core classification. | +| ArchiMate 3.2 / OMG ODM 1.1 | Retain optional mappings with explicit edition, direction and losses; reject blanket equivalence. Adopt one detailed differences-register home and same-change maintenance for comparisons. | SSP-03/10; ARC-014/015, AM-001–014. No exchange implementation or license path selected. | +| ISO/IEC 11179 selected 2023 parts | Defer general adoption; a bounded registry profile must select its parts, target and evidence independently. | SSP-11; ARC-016. Catalogue binding does not establish external registration. | + +Remaining architecture choices—production namespace ownership/minting, concrete +exchange mapping and time/default policy, inference regime, terminology schema, +provenance capture implementation, structured AD companion and ontology/registry +selection—are not decided here. The rules require them to be declared/evidenced +before the corresponding implementation or conformance claim. Deferral is explicit, +not an implementation backlog automatically commissioned by this profile. + +## Worked interpretation: concept, class and instance + +This fictional example demonstrates SSP-01–05/07; all namespaces are illustrative, +not published Transitrix vocabulary. Assume a publisher controls the immutable +catalogue identity `example-catalogue-1` and its `https://example.org/catalogue/one/` +namespace. Its policy keeps resource IRIs stable across repository moves and gives +description snapshots separate versioned IRIs. A second catalogue uses another +namespace even if its YAML also contains `APPLICATION-PAYMENTS-1`. + +```turtle +@prefix res: . +@prefix concept: . +@prefix onto: . +@prefix record: . +@prefix external: . +@prefix skos: . +@prefix owl: . +@prefix prov: . +@prefix dct: . +@prefix xsd: . + +concept:topics a skos:ConceptScheme . +concept:payment-processing a skos:Concept ; + skos:inScheme concept:topics ; skos:prefLabel "Payment processing"@en ; + skos:relatedMatch external:payment-processing . +onto:Application a owl:Class . +res:APPLICATION-PAYMENTS-1 a onto:Application ; + dct:identifier "APPLICATION-PAYMENTS-1" ; + dct:subject concept:payment-processing . + +record:subject-assertion-1 a prov:Entity ; + record:subject res:APPLICATION-PAYMENTS-1 ; + record:predicate dct:subject ; record:object concept:payment-processing ; + record:basis "declared" ; record:version "1" ; + prov:wasDerivedFrom record:source-snapshot-1 ; + prov:wasAttributedTo record:author-1 ; + prov:generatedAtTime "2026-10-21T00:00:00Z"^^xsd:dateTime . +record:source-snapshot-1 a prov:Entity ; record:sourceVersion "source-revision-1" . +record:author-1 a prov:Agent . +record:mapping-1 a prov:Entity ; + record:subject concept:payment-processing ; + record:predicate skos:relatedMatch ; record:object external:payment-processing ; + record:direction "local-to-external" ; record:loss "related, not equivalent" ; + record:basis "declared" ; record:version "1" ; + prov:generatedAtTime "2026-10-21T00:00:00Z"^^xsd:dateTime ; + prov:wasDerivedFrom external:scheme ; + prov:wasAttributedTo record:author-1 . +external:scheme record:sourceVersion "1" . +``` + +The concept supports retrieval, the class describes an optional ontology +interpretation, and the application is an instance. `relatedMatch` deliberately +does not promise equivalence. The source-backed assertion is declared, not proved; +its admission and any document-generation evidence are separate. Mapping direction +and source version are recorded rather than inferred from the edge alone. + +For a revision that deprecates the concept, retain its IRI, old snapshot and a +replacement/compatibility note. A new preferred label does not change instance +identity. Changing the class meaning or upgrading relatedMatch to exactMatch is +a semantic change requiring evidence and compatibility review, not cosmetic editing. + +Reject these interpretations: one shared label means all three resources are +`owl:sameAs`; moving a repository requires minting all object IRIs again; a missing +provenance timestamp may be invented; a shape pass admits a fact; or the example +proves a production exporter exists. For concrete graph-constraint/query examples +and counterexamples, reuse [the review's H/Q cases](../docs/standards-review/semantic-evidence.md#non-normative-shacl-examples). + +## Maintenance and compatibility + +The [differences register](../docs/standards-review/archimate-differences.md) remains +the one detailed comparison source; glossary and guidance link to it. SSP-10 applies +to future accepted changes introducing, changing or removing a difference in the +same delivery. Existing baseline observations do not become accepted semantic +changes merely because this profile names the register. + +Profile versions are separate from methodology, vocabulary, context, shape/query +and tool versions. A changed mandatory interpretation or incompatible profile claim +requires a major profile version; additive optional guidance can use a minor version; +editorial corrections can use a patch. Core methodology compatibility and migration +remain governed by [CONTRACT §10](../notations/CONTRACT.md#10-versioning-and-compatibility). +Tool support and release propagation require their own evidence; prose does not +silently migrate stored models or upgrade installed consumers. diff --git a/notations/CONTRACT.md b/notations/CONTRACT.md index 67603e19..2a3af621 100644 --- a/notations/CONTRACT.md +++ b/notations/CONTRACT.md @@ -397,12 +397,13 @@ The lifecycle fields are required on every canonical primitive once a notation s `ELEM-FORMER-ID-001` ([ELEMENT_PRIMITIVES.md](../notations/ELEMENT_PRIMITIVES.md) §9) flags any `former_id` that collides with a live element `id` or another element's `former_ids` — such a collision means Phase 2 was not completed cleanly. +**First-class time-aware relations.** Kinds declared in [the REL specification](elements/17-relations.md) are lifecycle-bearing files in `canon/relations/`, with independent admission and inclusive day windows contained in both endpoint lifecycles. Each host notation declares which links remain inline; there is no blanket inline-only phase. Person reporting uses `reports_to` (REL §3.4). + ### 7.5 Out of scope (v1) - **Bitemporality.** No separate `transaction_time` vs `valid_time`. v1 records what is true *now* about what was true *then*; back-dating corrections rewrite the file via git, and the git history is the audit trail. - **Branching timelines.** Alternative futures are the concern of the Scenarios notation (`notations/views/reports/11-scenarios.md`), not of the primitive lifecycle. - **Sub-day precision.** ISO 8601 date precision only; no timestamps, no timezones in canon. "Today" is the date of the query or render. -- **First-class time-aware relations.** Promoting relations like `parent` / `applies_to` / activity→goal to first-class lifecycle-bearing files is planned for Wave 3 of the temporal model. In v1 such relations remain inline and timeless on their host primitive. --- @@ -1230,6 +1231,14 @@ A project repository's element and a central repository's element are related by Both fields are facts recorded *alongside* an element's own envelope (§3) — neither is a required field on any TYPE, and neither substitutes for `id`. **No tool ever rewrites a local `id`** in order to add or remove a binding. +**Requirement taxonomy is distinct.** The scalar `REQUIREMENT.origin` values +`legislative`, `process-product`, and `project-product` retain their meaning in +[elements/15-requirement.md](elements/15-requirement.md) §2.1 and are valid on local +requirements. They are not the central-admission map above. No field rename, +migration, or change to either authored shape is required. This distinction does +not permit central-admission maps on local REQUIREMENTs or taxonomy scalars on +other TYPEs; it does not define a combined scalar/map representation. + ### 17.2 Validation rules | Rule | Severity | Description | @@ -1238,7 +1247,13 @@ Both fields are facts recorded *alongside* an element's own envelope (§3) — n | `BIND-002` | error | `canon_id` resolves, but the resolved central element's TYPE differs from this element's own TYPE. | | `BIND-003` | error | Two or more elements in the same catalogue carry the same `canon_id` — a central element cannot be the binding target of more than one local element. A **cross-catalogue** gate, requiring a full catalogue scan. | | `BIND-004` | error | `canon_id` is present but the repository has no catalogue pin configured — a binding without a pin. | -| `BIND-005` | error | `origin` is present on an element that is not itself admitted in the central repository — `origin` records provenance for a central element, it is not a project-repository field. | +| `BIND-005` | error | Central-admission `origin` metadata is present on a local element. A recognised REQUIREMENT taxonomy scalar (§17.1) is exempt; other TYPEs and central-origin maps on REQUIREMENTs are not. The ingest checker retains this error for unrecognised or ambiguous local origins rather than assuming they are valid provenance. | + +The ingest checker's bounded reader recognises the three taxonomy values as +single-line plain, single-quoted, or double-quoted scalars, with optional trailing +comments. Duplicate keys, nested content, and unsupported YAML forms remain +ambiguous and are reported, not silently accepted. This check does not replace +`REQ-004` taxonomy validation. ### 17.3 Rendering rule diff --git a/notations/ELEMENT_PRIMITIVES.md b/notations/ELEMENT_PRIMITIVES.md index 92934a88..b2087df0 100644 --- a/notations/ELEMENT_PRIMITIVES.md +++ b/notations/ELEMENT_PRIMITIVES.md @@ -450,6 +450,7 @@ Inline shape (catalogue entry): [views/09-products.md](./views/diagrams/09-produ | `type` | yes | string | `application` \| `integration` \| `platform` \| `data_store`. | | `domain` | no | string | Business domain. | | `capabilities` | no | list | `CAPABILITY-…` IDs supported. | +| `technical_capabilities` | no | list | Application-owned technical abilities and explicit business-capability mappings; field shape and containment boundary in [applications catalogue §6a](views/diagrams/10-applications.md#6a-technical-capabilities-and-business-coverage). | | `products` | no | list | `PRODUCT-…` IDs supported. | | `description` | recommended | string | Short description. | | `owner_role` | no | string | `ROLE-…`. **Time-varying** — sidecar ([CONTRACT.md](CONTRACT.md) §9), not inline. | @@ -565,6 +566,7 @@ The active-structure identity primitive — *who or what exists and performs wor | `external_ref` | no | string | External identifier or URL — e.g. a `system`'s integration endpoint, or an external organisation's reference. | - **Identity only.** A `person` actor is *who someone is*, independent of engagement. Employment, candidacy, alumni status, community membership, and contracting are **first-class time-aware `REL` records** ([elements/17-relations.md](elements/17-relations.md) §3), not fields here — a person can exist in the org's scope (candidate, alumnus, contractor, community member) without being an employee. +- **Person reporting.** `reports_to` is a first-class time-aware REL from subordinate `ACTOR(person)` to manager `ACTOR(person)`, never an inline manager field. Concurrent unranked managers are valid with a repository-health warning; employment, membership and unit hierarchy imply no reporting link. See [the reporting contract and oracle](elements/17-relations.md#34-reports_to--direct-person-reporting). - **Org hierarchy.** A `business_unit` actor's parent unit is a time-aware `REL` of `type: unit_parent` (`ACTOR(business_unit) → ACTOR(business_unit)`), not an inline field. - **Role assignment.** Which `ROLE` an actor fills is carried on the relevant engagement `REL` (e.g. `employment` carries role assignments), not inline on the actor. diff --git a/notations/README.md b/notations/README.md index dc06cd19..f0947fc3 100644 --- a/notations/README.md +++ b/notations/README.md @@ -6,6 +6,11 @@ For the shared envelope and GOAL, ACTION, REQUIREMENT and VERIFICATION fields, see [Reading fields by purpose](field-purpose.md): source data, provenance, admission history and derived diagnostics, with worked readings. +For semantic roles, persistent identity, mapping losses, provenance and truthful +tool-support claims, read the [Semantic Standards Profile](../method/semantic-standards-profile.md). +Its [ArchiMate differences register](../docs/standards-review/archimate-differences.md) +records comparison limits; it does not replace the element/relation contracts here. + ## Views The view notations live under [`views/`](views/), split by class into a folder per class — [`diagrams/`](views/diagrams/), [`reports/`](views/reports/), and [`documents/`](views/documents/) — so a spec's class is a filesystem fact, not a table position. Studio also renders **PlantUML** (`.puml`/`.plantuml`) natively — no separate Transitrix notation is needed for it. diff --git a/notations/elements/17-relations.md b/notations/elements/17-relations.md index 910a72f5..f7b7818a 100644 --- a/notations/elements/17-relations.md +++ b/notations/elements/17-relations.md @@ -1,8 +1,8 @@ --- title: "Relations — first-class time-aware links" -version: "0.5" +version: "0.6" author: "Valerii Korobeinikov" -last_updated: "2026-09-24" +last_updated: "2026-10-12" status: "draft" --- @@ -84,6 +84,7 @@ The enum is **closed** in v1. Each value names a specific kind of link between t | `assessment_influences_goal` | assessment → goal | `ASSESSMENT` → `GOAL` | An assessment (a dated finding about a `DRIVER`) influences a goal — the polarity edge of the ArchiMate motivation chain *Driver → Assessment → influences(±) → Goal*. **All polarity in the motivation model lives here**, not on the assessment node (the assessment records *what is*, this REL records *how it bears on this specific intent*). **M:N**: one assessment may bear on several goals, with opposite signs (one finding can support goal A and threaten goal B — SWOT is goal-relative), and one goal is influenced by many assessments. Required `sign` attribute on the REL file: closed vocabulary `positive` \| `negative` — the direction of the influence (DSM's up/down arrows on goals). Optional `magnitude` attribute: closed vocabulary `low` \| `medium` \| `high` — the strength of the influence; omit when unknown. Each (assessment, goal) pair is its own REL file; same shared REL machinery as `goal_parent`'s multi-parent form and `target_state_satisfies_goal`, not a one-off mechanism. A finding that ceases to bear on a goal (the goal retires, or re-measurement reverses the sign) ends with `valid_to` set; a new REL file carries the new sign. | | `action_goal` | action → goal | `ACTION` → `GOAL` | An action serves a goal. An action re-aimed mid-stream produces a new relation. **Deprecated alias:** `activity_goal` (accepted with `ACTION-005` warning). | | `unit_parent` | child → parent | `ACTOR(business_unit)` → `ACTOR(business_unit)` | Organisational re-parenting — a business-unit actor moved under a different parent unit. (Was `UNIT → UNIT` before the 2026-05-29 Actors decision folded `UNIT` into `ACTOR`.) | +| `reports_to` | subordinate → manager | `ACTOR(person)` → `ACTOR(person)` | Direct person reporting, with concurrent unranked managers permitted. Each pair/window is a separate REL; reverse retrieval uses the same records. See §3.4. | | `employment` | person → org | `ACTOR(person)` → `ACTOR(business_unit)` | Employment of a person by a unit / organisation. Time-aware (the employment window); carries the most attributes of the engagement kinds — `contract_type`, role assignments (`roles: [ROLE-…]`). | | `candidacy` | person → org | `ACTOR(person)` → `ACTOR(business_unit)` | A person under evaluation (pre-hire). Carries `stage`, `source`. | | `alumni_membership` | person → org | `ACTOR(person)` → `ACTOR(business_unit)` | A former employee's continuing relationship; may reference the prior `employment`. | @@ -176,6 +177,76 @@ What it says, and what it refuses to say: --- +### 3.4 `reports_to` — direct person reporting + +A `reports_to` REL states that the subordinate person (`from`) reports directly +to the manager person (`to`). Both endpoints MUST resolve to independently +admitted `ACTOR` records with `type: person`. Employment, unit membership, +role assignment and `unit_parent` retain their existing meanings and never +imply a reporting edge. There is no same-unit or shared-employer prerequisite. +The relationship is binary and M:N: concurrent managers are unranked, with no +primary/functional distinction or allocation percentage. Store no inverse kind +and no canonical inline manager field on ACTOR; free-form `extensions:` remain +pass-through and do not establish reporting authority. + +**Time and admission.** Each REL has its own admission record and required +`valid_from` and `valid_to`. Dates are quoted ISO days; the window is inclusive +at both ends, and null end means unbounded, not already active. Equal dates +form a valid one-day window. The entire window MUST fit inside both endpoint +lifecycles (`REL-003`); a null relation end cannot fit a finite endpoint end. +Do not silently clip invalid windows. A draft REL does not become admitted +because its actors are admitted, nor does admitting a REL admit its actors. + +**Identity and graph.** Resolve supported identity aliases before comparing +endpoints or counting people. A resolved self-link is `REL-011` (error). +`REL-012` (error) rejects a cycle, including a cycle of three or more persons, +whose admitted, resolved reporting edges are simultaneously effective on any +date. Validate all history by interval change points or by a nonempty common +intersection of the cycle's edge windows and endpoint lifecycles. A union of +historical edges is insufficient: A→B ending June 30 and B→A starting July 1 +is valid; starting the second on June 30 creates a cycle on that date. Retain +the ordered actor path, all incident REL IDs and a witness date/overlap interval +in the diagnostic. Traversals must terminate with a visited set; invalid data +must not produce a fabricated hierarchy. + +**Direct queries at date D.** Resolve identities, require admission and valid +contained windows, and select edges for which both endpoints and the REL are +in effect at D. `managers(A, D)` groups matching `from=A` edges by resolved `to`; +`directReports(B, D)` groups matching `to=B` edges by resolved `from`. Return +deterministically ordered distinct identities with **all contributing REL IDs** +for each pair. Listing and trace must use the same population. No transitive +management inference is required. Zero edges means “no reporting relationship +recorded”, not proof that the person has no manager. An unresolved/unadmitted +endpoint produces `REL-002`; an incomplete or unreadable catalogue produces an +explicit incomplete result, never a clean empty answer or health success. + +**Matrix warning and evidence.** A repository-health scan emits `REL-013` +(warning) when a person has more than one distinct concurrently effective +manager. Include the person, manager identities, contributing REL IDs and +witness date/overlap window. A dated scan evaluates D; an all-history scan +checks interval change points. This warning does not invalidate the otherwise +valid matrix relationship. Multiple records for one resolved manager do not +trigger it. Preserve authored evidence IDs and windows, including disjoint +recurrence of the same pair; ingest deduplication must not discard recurrence +merely because kind/from/to already appeared. + +**Specification and compatibility boundary.** The [synthetic consumer example +and acceptance oracle](../examples/relations/reports-to/) specify expected +results and positive/negative vectors. This is an additive MINOR contract +change (relation spec 0.6); it allocates `REL-011`–`REL-013` under +[diagnostic identity rules](../CONTRACT.md#187-versioned-diagnostic-identity). +The new errors apply only to the newly introduced kind. Existing codes, meanings +and severities are unchanged. Existing records need +no migration. Older pinned vocabularies/validators can reject `reports_to` +as an unknown kind; a current vocabulary loader recognizing the token is not +proof of subtype, temporal, graph or query enforcement. The methodology release +pin remains unchanged until release preparation; no package is released here. +Dependent validators, ingest and query consumers must bind conformance evidence +to the delivered specification revision and diagnostic allocation. These rules +and example are not a claim of released or installed runtime support. + +--- + ## 4. File location and naming ``` @@ -208,6 +279,9 @@ A typical naming convention encodes the endpoints and kind in the middle segment | `REL-008` | warning | A cycle exists in the `process_parent` graph among admitted REL files (A is a child of B … is a child of A). Cross-cutting — fires when the catalogue is loaded. Warning rather than error because a genuine mutual embedding is unusual but not always a data error. Kind-specific, parallel to `REL-006`; that code is not widened. | | `REL-009` | error | A `requirement_parent` REL has identical `from` and `to`. Applies to the requirement-chain extension. | | `REL-010` | warning | A cycle exists in the active union of inline `REQUIREMENT.parent` and `requirement_parent` REL edges at the as-at date, including an inline self-parent. Cross-cutting; retain every incident cycle edge and terminate traversal. Applies to the requirement-chain extension; does not widen `REL-006` or `REL-008`. | +| `REL-011` | error | A `reports_to` REL resolves both endpoints to the same person, including supported identity aliases. Report the REL ID and resolved person ID. | +| `REL-012` | error | A cycle of admitted `reports_to` edges is simultaneously effective on some date, including 3+ person cycles. Report the ordered actor path, incident REL IDs and witness date/overlap interval (§3.4). | +| `REL-013` | warning | A repository-health scan finds more than one distinct concurrently effective manager for a person. Report identities, contributing REL IDs and witness date/window; duplicate evidence for one manager does not trigger this warning (§3.4). | For the requirement-chain extension, inline `parent`/`serves` and active matching REL records form an additive union. An identical pair is one logical edge with diff --git a/notations/elements/19-actors.md b/notations/elements/19-actors.md index 4a502303..3a6f4ab8 100644 --- a/notations/elements/19-actors.md +++ b/notations/elements/19-actors.md @@ -1,8 +1,8 @@ --- title: "Actors — active-structure identity primitive" -version: "0.1" +version: "0.2" author: "Valerii Korobeinikov" -last_updated: "2026-05-29" +last_updated: "2026-10-12" status: "draft" --- @@ -102,12 +102,17 @@ All of an actor's links are first-class, time-aware `REL` records ([17-relations | Relation `type` | From → To | What it records | |---|---|---| | `unit_parent` | `ACTOR(business_unit)` → `ACTOR(business_unit)` | Org hierarchy — a unit's parent unit. Re-parenting = one ended relation + one new. | +| `reports_to` | `ACTOR(person)` → `ACTOR(person)` | Direct subordinate → manager; concurrent unranked managers are valid with a health warning. See [reporting contract](17-relations.md#34-reports_to--direct-person-reporting). | | `employment` | `ACTOR(person)` → `ACTOR(business_unit)` | Employment window; carries `contract_type` and role assignments (`roles: [ROLE-…]`). | | `candidacy` | `ACTOR(person)` → `ACTOR(business_unit)` | Pre-hire evaluation; carries `stage`, `source`. | | `alumni_membership` | `ACTOR(person)` → `ACTOR(business_unit)` | Former-employee relationship; may reference the prior `employment`. | | `community_membership` | `ACTOR(person)` → `ACTOR(business_unit)` | Membership of a community modelled as a `business_unit` actor. | | `contracting` | `ACTOR(person\|business_unit)` → `ACTOR(business_unit)` | Contracting relationship; carries `contract_terms`. | +Reporting is independent of employment and unit hierarchy; neither implies a manager. +Use a separate REL for each pair/window, preserving recurrence. Do not interpret +free-form `extensions:` as canonical reporting fields or reject their pass-through. + Action ownership references an actor by ID: an action's `owner: ACTOR-…` ([07-action.md](../views/diagrams/07-action.md) §5.6). The Stakeholders notation references an actor for identity (`STAKEHOLDER.actor: ACTOR-…`, REQUIRED) — a stakeholder carries the stake, never the identity. --- @@ -130,7 +135,7 @@ A flat catalogue listing (`*.actors.transitrix.yaml`) is an optional **view** ov |---|---|---| | `ACTOR-001` | error | `id` missing or not matching `ACTOR-[-]` ([IDS_AND_REFERENCES.md](../IDS_AND_REFERENCES.md) §1); or a required field (`notation`, `name`, `type`, `zone`, `admitted_at`, `admitted_by`, `gate_checks`, `valid_from`, `valid_to`) is missing. | | `ACTOR-002` | error | `type` is not one of `person`, `business_unit`, `system`. | -| `ACTOR-003` | error | An engagement / hierarchy field (`employment`, `unit_parent`, `roles`, `owner`, …) is present inline on the actor file — these belong in `REL-…` files (`REL-004`), not on the identity primitive. | +| `ACTOR-003` | error | An engagement / hierarchy field (`employment`, `unit_parent`, `reports_to`, `manager`, `roles`, `owner`, …) is present inline on the actor file — these belong in `REL-…` files (`REL-004`), not on the identity primitive. | The shared header (`HDR-001..004`, [CONTRACT.md](../CONTRACT.md) §2) and primitive-lifecycle (`LIFECYCLE-001..004`, [CONTRACT.md](../CONTRACT.md) §7.3) rules apply to ACTOR files in addition to the ACTOR-* rules above. diff --git a/notations/elements/20-stakeholders.md b/notations/elements/20-stakeholders.md index 8e6c41f2..70c353ec 100644 --- a/notations/elements/20-stakeholders.md +++ b/notations/elements/20-stakeholders.md @@ -111,7 +111,7 @@ The shared header (`HDR-001..004`, [CONTRACT.md](../CONTRACT.md) §2) and primit ## 6. Evolution -- **Concern as a separate primitive.** ArchiMate models a stakeholder's *concern* as its own element. v0.1 inlines `concern` as free text; a `CONCERN` primitive is deferred until needed. +- **Concern as a separate primitive.** Transitrix currently uses free-text `concern`; no canonical `CONCERN` TYPE is established here. ISO/IEC/IEEE 42010:2022's Concern is a separate comparison from ArchiMate's Stakeholder; a shared label does not prove equivalent first-class elements. See [ARC-005](../../docs/standards-review/architecture-evidence.md#nine-architecture-concepts) and [AM-013](../../docs/standards-review/archimate-differences.md) for evidence and limits. A new structured concern model requires its own decision and compatibility review. - **External-organisation reference.** An external stakeholder often *is* an organisation; v0.1 models it as an `ACTOR(business_unit)` with `external_ref`. A dedicated external-org entity is out of scope. - **Action Card stakeholders block.** Once this notation lands, Action Card v0.2 (#97 follow-up) renders a stakeholders panel from the `stakeholding` relations whose target is the action. - DSM formalisation (the `stakeholder.type` enum + `action_stakeholder` join, legacy alias `activity_stakeholder`) is a `proj:transitrix-dsm` track; this spec defines only the methodology side. diff --git a/notations/examples/capability-map/management-cycle.capability-map.transitrix.yaml b/notations/examples/capability-map/management-cycle.capability-map.transitrix.yaml new file mode 100644 index 00000000..3c7ef9f4 --- /dev/null +++ b/notations/examples/capability-map/management-cycle.capability-map.transitrix.yaml @@ -0,0 +1,82 @@ +# Complete canonical sources: tests/fixtures/capability-management-cycle/ +notation: capability-map +spec_version: '0.5' +name: Management cycle and system coverage +capability_map: + id: CAPABILITY_MAP-CYCLE-1 + name: Management cycle and system coverage + assessment_date: '2026-10-23' + capabilities: + - id: CAPABILITY-V1 + name: Order Management + type: domain + valid_from: '2026-01-01' + valid_to: null + children: + - id: CAPABILITY-V1.1 + name: Order strategy + type: domain + valid_from: '2026-01-01' + valid_to: null + management_cycle_stage: Strategic + - id: CAPABILITY-V1.2 + name: Order improvement learning + type: domain + valid_from: '2026-01-01' + valid_to: null + management_cycle_stage: Learning + - id: CAPABILITY-V1.3 + name: Fulfilment planning + type: domain + valid_from: '2026-01-01' + valid_to: null + management_cycle_stage: Planning + children: + - id: CAPABILITY-V1.3.1 + name: Pick and pack + type: domain + valid_from: '2026-01-01' + valid_to: null + management_cycle_stage: Execution + - id: CAPABILITY-H1 + name: Order assurance + type: supporting + valid_from: '2026-01-01' + valid_to: null + management_cycle_stage: Assurance + tags: + - ESG + - MDM + - Support +view_config: + valid_at: null + scenario: null + management_cycle: + group: true + order: + - Strategic + - Learning + - Planning + - Execution + - Assurance + tags: + filter: + - ESG + - MDM + - Support + show: true + display: + depth: 3 + backlog: false + maturity: false + legend: true + systems: + labels: false + coverage: true + selected: + - APPLICATION-OMS-1 + - APPLICATION-GOVERNANCE-1 + highlight: null + shape: angled + rounded: false + overlap: true diff --git a/notations/examples/relations/reports-to/README.md b/notations/examples/relations/reports-to/README.md new file mode 100644 index 00000000..105ff8b0 --- /dev/null +++ b/notations/examples/relations/reports-to/README.md @@ -0,0 +1,177 @@ +# Direct person reporting — synthetic specification example + +This catalogue illustrates [`reports_to`](../../../elements/17-relations.md#34-reports_to--direct-person-reporting). +Every person, admission and relationship is synthetic. Consumers can load the +six YAML records under `canon/` without reconstructing a model from prose. +The oracle below is also the expected-result contract for consumer tests. +The source-checkout command below implements the reporting oracle. This does +not claim released or installed support in other validators, generic listing, +or trace consumers. The existing `7.0.0` manifest pin is unchanged; older +artifacts at that pin can reject the added kind. Record the exact source +revision and consumer version when testing conformance. + +## Run the reporting check and direct queries + +From a source checkout, use Python 3.12 with PyYAML 6.0.1 (the same dependency +used by the repository's Python validation tools): + +```sh +python3 -m pip install PyYAML==6.0.1 +python3 tools/reporting.py --root notations/examples/relations/reports-to +python3 tools/reporting.py --root notations/examples/relations/reports-to --as-at 2026-06-15 --actor ACTOR-SYN-A-1 +python3 tools/reporting.py --root notations/examples/relations/reports-to --as-at 2026-06-15 --actor ACTOR-SYN-B-1 --direction reports +python3 tools/tests/test_reporting.py +``` + +`--root` must identify one declared catalogue with `transitrix.yaml` and both +`canon/elements/` and `canon/relations/` directories (an existing empty directory +is valid). The command recursively reads whole-file YAML mappings (`.yaml` or +`.yml`) in those two directories, including full admission and lifecycle data. +It supports single-catalogue local inputs, not holding-wide aggregation, +remote imports, Markdown front matter, or view-defined elements. Symlinks, +unreadable directories/files, malformed YAML, duplicate YAML keys, unsupported +files, and nested manifests in the scanned input are explicit incomplete +results. Only empty regular `.gitkeep` files are exempt. Other zones and view +files are outside this command's population; keep the repository linter for +their integrity checks. Consumers must supply the complete local population, +not an export of selected relations. + +Every invocation checks file shapes, admission, lifecycle, resolved endpoints, +and **all-history** reporting cycles. With no date it also scans all-history +multi-manager health intervals. `--as-at` limits health warnings and returned +pairs to that explicit date; it does not hide a historical validation error. +`--actor` requires a date. `--direction managers` (default) selects outgoing +pairs; `--direction reports` selects incoming pairs. Without an actor, a dated +invocation returns every direct pair. No inferred or transitive edges are added. + +Output is JSON: `complete`, `valid`, `as_at`, resolved `actor`, `direction`, +`pairs`, and `findings`. Each pair contains `from_actor`, `to_actor`, and every +active contributing REL ID in `relations`. Identities and evidence are sorted. +A valid empty `pairs` array means no relationship recorded at that date; it is +only definitive within the declared input scope. Any error or incomplete input +suppresses **all** pairs. Warnings alone preserve valid matrix results. Exit 0 +means complete and valid (possibly with warnings), 1 means validation errors, +and 2 means incomplete input; argument-usage errors also exit 2. + +Identity lookup uses live IDs then `former_ids` migration bridges; collisions +are errors. Human-readable `aliases` are matching hints and never endpoint IDs. +The command checks endpoint TYPE and subtype for `reports_to`, `employment`, and +`unit_parent`, preserving their different meanings. Other known REL kinds are +recognized but their kind-specific semantics remain with their existing +validators. They never produce reporting edges. `extensions` pass through +without reporting authority. This is a bounded reporting checker, not full +schema certification of every notation or a replacement for `tools/lint.py`. +The separate `scripts/release-obligations.mjs` interface is unchanged. + +### Diagnostic ownership + +`tools/reporting.py` enforces the following rules for this supported input; +repository graph checks require its complete catalogue load. Existing linter +checks remain in place. Findings carry record/field context where applicable; +cycle findings include an ordered actor path, incident edges with REL IDs, +all contributing evidence, and an inclusive interval/witness date. Health +findings carry the actor, distinct manager identities, evidence and interval. +Intervals are split whenever active evidence changes. + +| Code | Severity | Meaning / enforcement layer | +|---|---|---| +| `SCHEMA_INVALID` | error | File field/identity/notation shape, duplicate ID, missing `valid_to`, or invalid query argument. Duplicate IDs also make the population incomplete. | +| `ADMIT-001`–`ADMIT-004` | error | Unknown state, inconsistent proposal metadata, incomplete active admission, or missing rejection metadata; file admission checks. Valid drafts are excluded. | +| `LIFECYCLE-001` | error | Missing/invalid quoted start date; file check. | +| `LIFECYCLE-002` | error | Non-null end is not a valid quoted calendar date; file check. | +| `LIFECYCLE-003` | error | End before start; file check. | +| `REL-001` | error | Missing/unknown relation kind; file check using the shipped vocabulary. | +| `REL-002` | error | Missing/malformed, unresolved/unadmitted or wrong TYPE/subtype endpoint; catalogue check. An endpoint with invalid lifecycle cannot contribute. Also used for an invalid query person. | +| `REL-003` | error | Relation window not contained in either resolved endpoint; catalogue check, never clipping. | +| `REL-004` | error | Canonical inline `manager`/`reports_to` field on ACTOR; author a REL instead. | +| `ELEM-FORMER-ID-001` | error | Migration identity collision; catalogue incomplete. | +| `REL-011` | error | Resolved reporting self-link; catalogue identity check. | +| `REL-012` | error | Simultaneously effective reporting cycle; repository graph check. | +| `REL-013` | warning | Multiple distinct effective managers; repository health check. | +| `CAT-001` | warning | No declared catalogue manifest; result is incomplete and exits 2. | +| `CAT-002` | error | Nested catalogue boundary; result is incomplete. | + +`CATALOGUE_INCOMPLETE` is an error status for command input/load failures, +including unsupported files; the result is incomplete. It is command status, +not a new normative validator rule. + +## Records and dated oracle + +A, B and C abbreviate `ACTOR-SYN-A-1`, `ACTOR-SYN-B-1` and `ACTOR-SYN-C-1`. +R1, R2 and R3 abbreviate `REL-SYN-REPORTING-1`, `REL-SYN-REPORTING-2` and +`REL-SYN-REPORTING-3`. All actors are admitted persons effective from January 1, +2026 with no end. Each relation is independently admitted. + +| REL | Pair | Inclusive window | +|---|---|---| +| R1 | A → B | 2026-01-01 through 2026-06-30 | +| R2 | A → C | 2026-06-01 through unbounded | +| R3 | A → B | 2026-08-01 through unbounded | + +Reproduce each row by selecting admitted, resolved `reports_to` records whose +window contains D and fits both active endpoint lifecycles. Group by resolved +person identity, keep all contributing REL IDs, and sort identities and IDs. +Reverse lookup selects the same records by `to`; it stores no inverse REL. +These are direct queries, with no inferred or transitive management links. + +| D | managers(A), with evidence | directReports(B), with evidence | directReports(C), with evidence | Health | +|---|---|---|---|---| +| 2026-05-31 | B: [R1] | A: [R1] | empty | No reporting warning | +| 2026-06-01 | B: [R1], C: [R2] | A: [R1] | A: [R2] | REL-013 warning | +| 2026-06-15 | B: [R1], C: [R2] | A: [R1] | A: [R2] | REL-013 warning | +| 2026-06-30 | B: [R1], C: [R2] | A: [R1] | A: [R2] | REL-013 warning | +| 2026-07-01 | C: [R2] | empty | A: [R2] | No reporting warning | +| 2026-08-01 | B: [R3], C: [R2] | A: [R3] | A: [R2] | REL-013 warning | + +`managers(B)`, `managers(C)` and `directReports(A)` are empty on these dates. +Empty means no reporting relationship recorded. The matrix remains valid when +REL-013 fires. An all-history health scan finds overlap windows June 1–30 and +August 1 onward. R3 is recurrence, not a duplicate to discard during ingestion. + +For the duplicate-evidence control, copy R1 to a distinct R4 with the same pair +and window. On May 31, managers(A) is B with [R1, R4] and **no REL-013**. On June +15 it is B with [R1, R4] and C with [R2], with REL-013 for two people, not three +records. Reverse evidence agrees. Supported aliases of B still count as B. + +## Acceptance vectors + +Apply each mutation independently to the base catalogue, retaining full +admission and lifecycle records unless the vector explicitly changes them. +Diagnostics retain field/endpoint context; graph failures retain incident +records. These are normative expectations for dependent mechanical tests, +exercised by the source-checkout command and its mechanical tests. + +| Vector | Expected result | +|---|---| +| Base matrix; optionally B→C while A→B and A→C hold | Valid matrix DAG. Multiple managers alone is not a cycle; health emits REL-013 for A. | +| Each endpoint separately changed to an admitted ACTOR(business_unit), ACTOR(system), or ROLE | REL-002 error with REL ID, endpoint field, referenced ID and expected/actual TYPE/subtype. ACTOR ID grammar alone is insufficient. | +| Each endpoint separately unknown or unadmitted | REL-002 error with unresolved/unadmitted reason. No valid pair may use it. | +| Unreadable file or incomplete catalogue | Explicit incomplete result and diagnostics, never clean health or a definitive empty report. Preserve any partial-result qualification. | +| `to: [B, C]` (using full IDs), or another wrong field shape | SCHEMA_INVALID with field context; use separate binary records for a matrix. | +| Missing/malformed `from` or `to`; missing/unknown `type` | REL-002 for endpoint defects; REL-001 for missing/unknown kind. Structural schema errors retain field context. | +| A→A; A→supported alias resolving to A | REL-011 error, naming relation and resolved person. No self-link disguised by aliases. | +| Add B→C and C→A during June | REL-012 error for A→B→C→A, with ordered actor path, incident REL IDs and an effective witness date/window. | +| Isolate A→B ending June 30 and B→A starting July 1 | Valid disjoint history; no REL-012. Historical union alone must not trigger a cycle. | +| Same two edges, second starts June 30 | REL-012 error with June 30 witness. Both boundaries are inclusive. | +| Relation start=end June 15 | Valid one-day link, present June 15 and absent June 14/16. | +| Future start with null end; expired end | Excluded before start or after end; null does not override start. Historical query inside the window includes the link. | +| Missing/invalid start; invalid end; end before start | LIFECYCLE-001/002/003 retain their respective meanings. Missing required `valid_to` produces SCHEMA_INVALID with field context. Equal dates remain valid. | +| Relation starts before either endpoint, ends after either endpoint, or null end with finite endpoint end | REL-003 error identifying endpoint and out-of-bounds interval. No clipping. Repeat for each endpoint independently. | +| Relation bounds exactly equal to both endpoint bounds | Valid containment, including both boundary days. | +| Draft/unadmitted REL between admitted actors | No reporting claim. Endpoint admission does not admit the relation; admission diagnostics remain applicable. | +| Admitted REL to a draft actor; future/expired actor at D | Unadmitted endpoint is REL-002; an inactive endpoint contributes no pair. Containment violations remain REL-003. | +| Same pair in disjoint windows, including R1 and R3 | Preserve both identities and windows. Ingestion must retain recurrence; no evidence from an inactive window contributes at D. | +| Overlapping same-pair evidence, including aliases of one manager | One logical pair with every contributing REL ID; no multi-manager warning from duplicates alone. | +| Canonical inline `manager` or `reports_to` on ACTOR | ACTOR-003/REL-004 with field context and instruction to author a REL. Arbitrary `extensions:` retain EXT-001 pass-through and confer no reporting authority. | +| Existing employment person→unit with roles; unit_parent unit→unit | Existing meaning, validation and temporal queries unchanged; no reporting inferred. Person→person employment and person endpoints on unit_parent remain invalid. | +| No employment, same-unit, or shared-employer record | Valid person→person reporting; these are not prerequisites. | +| Draft, future, expired, malformed or unresolved records in views | No fabricated valid reporting claim. Listing and trace agree at the same date; errors and incomplete populations remain visible. | + +`REL-011` (self-link error), `REL-012` (temporal-cycle error), and `REL-013` +(multi-manager warning) are newly allocated identities. Existing diagnostics +keep their meanings/severities and stored history under +[CONTRACT §18.7](../../../CONTRACT.md#187-versioned-diagnostic-identity). +The additive vocabulary/specification change requires a MINOR release when +packaged; this example does not release, install or certify a consumer. Older +pinned validators may reject `reports_to`; token recognition alone does not +satisfy these acceptance vectors. Core ingestion coverage is unchanged. diff --git a/notations/examples/relations/reports-to/canon/elements/02_business/actors/ACTOR-SYN-A-1.yaml b/notations/examples/relations/reports-to/canon/elements/02_business/actors/ACTOR-SYN-A-1.yaml new file mode 100644 index 00000000..1d7526df --- /dev/null +++ b/notations/examples/relations/reports-to/canon/elements/02_business/actors/ACTOR-SYN-A-1.yaml @@ -0,0 +1,14 @@ +notation: actor +id: ACTOR-SYN-A-1 +name: "Synthetic Person A" +type: person +zone: canon +example: true +admitted_at: "2026-01-01" +admitted_by: synthetic-example +gate_checks: + uniqueness: pass + consistency: pass + completeness: pass +valid_from: "2026-01-01" +valid_to: null diff --git a/notations/examples/relations/reports-to/canon/elements/02_business/actors/ACTOR-SYN-B-1.yaml b/notations/examples/relations/reports-to/canon/elements/02_business/actors/ACTOR-SYN-B-1.yaml new file mode 100644 index 00000000..d6598303 --- /dev/null +++ b/notations/examples/relations/reports-to/canon/elements/02_business/actors/ACTOR-SYN-B-1.yaml @@ -0,0 +1,14 @@ +notation: actor +id: ACTOR-SYN-B-1 +name: "Synthetic Person B" +type: person +zone: canon +example: true +admitted_at: "2026-01-01" +admitted_by: synthetic-example +gate_checks: + uniqueness: pass + consistency: pass + completeness: pass +valid_from: "2026-01-01" +valid_to: null diff --git a/notations/examples/relations/reports-to/canon/elements/02_business/actors/ACTOR-SYN-C-1.yaml b/notations/examples/relations/reports-to/canon/elements/02_business/actors/ACTOR-SYN-C-1.yaml new file mode 100644 index 00000000..a9d2428f --- /dev/null +++ b/notations/examples/relations/reports-to/canon/elements/02_business/actors/ACTOR-SYN-C-1.yaml @@ -0,0 +1,14 @@ +notation: actor +id: ACTOR-SYN-C-1 +name: "Synthetic Person C" +type: person +zone: canon +example: true +admitted_at: "2026-01-01" +admitted_by: synthetic-example +gate_checks: + uniqueness: pass + consistency: pass + completeness: pass +valid_from: "2026-01-01" +valid_to: null diff --git a/notations/examples/relations/reports-to/canon/relations/REL-SYN-REPORTING-1.yaml b/notations/examples/relations/reports-to/canon/relations/REL-SYN-REPORTING-1.yaml new file mode 100644 index 00000000..08e20e60 --- /dev/null +++ b/notations/examples/relations/reports-to/canon/relations/REL-SYN-REPORTING-1.yaml @@ -0,0 +1,15 @@ +notation: relation +id: REL-SYN-REPORTING-1 +type: reports_to +from: ACTOR-SYN-A-1 +to: ACTOR-SYN-B-1 +zone: canon +example: true +admitted_at: "2026-01-01" +admitted_by: synthetic-example +gate_checks: + uniqueness: pass + consistency: pass + completeness: pass +valid_from: "2026-01-01" +valid_to: "2026-06-30" diff --git a/notations/examples/relations/reports-to/canon/relations/REL-SYN-REPORTING-2.yaml b/notations/examples/relations/reports-to/canon/relations/REL-SYN-REPORTING-2.yaml new file mode 100644 index 00000000..f8cfc7e0 --- /dev/null +++ b/notations/examples/relations/reports-to/canon/relations/REL-SYN-REPORTING-2.yaml @@ -0,0 +1,15 @@ +notation: relation +id: REL-SYN-REPORTING-2 +type: reports_to +from: ACTOR-SYN-A-1 +to: ACTOR-SYN-C-1 +zone: canon +example: true +admitted_at: "2026-01-01" +admitted_by: synthetic-example +gate_checks: + uniqueness: pass + consistency: pass + completeness: pass +valid_from: "2026-06-01" +valid_to: null diff --git a/notations/examples/relations/reports-to/canon/relations/REL-SYN-REPORTING-3.yaml b/notations/examples/relations/reports-to/canon/relations/REL-SYN-REPORTING-3.yaml new file mode 100644 index 00000000..ee2f3168 --- /dev/null +++ b/notations/examples/relations/reports-to/canon/relations/REL-SYN-REPORTING-3.yaml @@ -0,0 +1,15 @@ +notation: relation +id: REL-SYN-REPORTING-3 +type: reports_to +from: ACTOR-SYN-A-1 +to: ACTOR-SYN-B-1 +zone: canon +example: true +admitted_at: "2026-01-01" +admitted_by: synthetic-example +gate_checks: + uniqueness: pass + consistency: pass + completeness: pass +valid_from: "2026-08-01" +valid_to: null diff --git a/notations/examples/relations/reports-to/transitrix.yaml b/notations/examples/relations/reports-to/transitrix.yaml new file mode 100644 index 00000000..395a652a --- /dev/null +++ b/notations/examples/relations/reports-to/transitrix.yaml @@ -0,0 +1,6 @@ +# Self-contained synthetic catalogue; see README.md for compatibility limits. +transitrix: 1 +methodology_version: "7.0.0" +notations: [actor, relation] +zones: [canon] +coverage_profile: core diff --git a/notations/examples/requirement-subject-scope/README.md b/notations/examples/requirement-subject-scope/README.md new file mode 100644 index 00000000..572eadb6 --- /dev/null +++ b/notations/examples/requirement-subject-scope/README.md @@ -0,0 +1,112 @@ +# Requirements subject scope — synthetic oracle + +**Normalized records for the accepted `requirement-chain/0.3` contract.** These +cases accompany the [subject-scope contract](../../views/reports/requirement-subject-scope.md). +They extend the [unchanged 0.2 oracle](../requirement-chain/README.md) by explicit +substitution, not by reconstructing its records or introducing a storage format. +Analysts use the exact lists to interpret report scope. These normalized examples +specify consumer behavior; they are not directly loadable catalogue files. Tool +support for the added kinds and values must be declared by the pinned versions. + +## Four independent cases + +Each case starts with **every record, absence, window, finding, expected list and +independent control in the 0.2 oracle**, including its listed R and V records +(abbreviations expand exactly as there). Cases are separate catalogue snapshots; +IDs reused between cases never coexist. Date remains 2026-09-24. All record +admission and lifecycle defaults remain unchanged. Apply these substitutions +simultaneously to every record and expected result, including controls: + +| Case / snapshot | Alpha subject replacing PRODUCT-ALPHA-1 | Beta subject replacing PRODUCT-BETA-1 | Membership and pair kinds | +|---|---|---|---| +| Internal application / subject-app-1 | APPLICATION-ALPHA-1, `type: application`, name Internal planning application | APPLICATION-BETA-1, `type: application` | Replace `product_scope` with `application_scope`; `project_product` with `project_application`. | +| Internal product / subject-internal-1 | PRODUCT-ALPHA-1, `type: service`, name Internal records service | PRODUCT-BETA-1, `type: service` | Keep both existing kinds. | +| Physical product / subject-physical-1 | PRODUCT-ALPHA-1, `type: physical_product`, name Sample sensor | PRODUCT-BETA-1, `type: physical_product` | Keep both existing kinds; use the additive PRODUCT value from P3. | +| SaaS / subject-saas-1 | PRODUCT-ALPHA-1, `type: digital_product`, name Sample hosted planning product | PRODUCT-BETA-1, `type: digital_product` | Keep both existing kinds. | + +Names describe use, not additional authored fields. Release IDs A1–A3/B1–B2, +project IDs and all requirement/verification/source IDs stay unchanged. `of` +follows the substituted subject exactly. All memberships remain explicit. For +SaaS only, also add admitted APPLICATION-SAAS-1 (`type: application`), listed +in Alpha's `supporting_apps`, with `products: [PRODUCT-ALPHA-1]`, and +RELEASE-SAAS-1 with `of: APPLICATION-SAAS-1`, no predecessor and version `1`. +Give these records the oracle's ordinary envelope. No requirement memberships, +assignments or verifications for that application are implied. + +For synthetic REL source identity, use a stable tuple `(kind, from, to)` as the +baseline tables do. An extra duplicate is distinguished by suffix `duplicate-1`. +Materialized REL files must receive ordinary unique REL IDs and preserve that +mapping in provenance. Tuple shorthand never becomes an authored field or TYPE. + +## Exact baseline results for each case + +These expected sets apply separately to all four cases for a consumer implementing +0.3. A consumer that does not support a subject, kind or value must expose unsupported +scope rather than return these numbers or silently reinterpret the records. + +| Population | Exhaustive IDs | +|---|---| +| P | R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R13,R14,R15,R18,R20 | +| L, Alpha 2, no project | R1,R2,R3,R4,R5,R6,R7,R8,R13,R14,R15,R18,R20 | +| S, Alpha project, Alpha 2 | R1,R2,R3,R4,R5,R6,R7,R8,R14,R15,R18,R20 | +| Clean unassigned | R9 | +| Other-release-only | R10 | +| Invalid assignment | R11 | +| Unresolved membership | Empty, given this complete synthetic baseline | +| Inactive | R16,R17 | +| Alpha 1, Alpha project | R1,R18 | +| Alpha 3, Alpha project | R10 | +| Beta 2, Beta project | R12 | + +| Stage in S | Exhaustive IDs | +|---|---| +| Stakeholder | R1,R6 | +| System | R2,R4,R5,R14,R15,R18 | +| Software | R3,R7,R20 | +| Unclassified | R8 | + +| Metric in contract order | Exact IDs for Alpha project / Alpha 2 | +|---|---| +| Broken references | R7,R14,R15,R20 | +| No accepted source path | R5,R8,R14,R15 | +| No valid verification definition | R1,R7,R8,R14,R15 | +| Verification without applicable executed result | R2,R5,R20 | +| Applicable failed verification | R3 | +| No effective release assignment, whole subject | R9 | + +Without project, add R13 to S/System and the third metric only. All Beta 2 / Beta +project metrics are empty. Definition/result stage IDs, the 37-node unfocused +matrix, exact focus selections and all six defective-reference slots remain the +0.2 lists unchanged. R1 inherits at depth 1; R18 selects its depth-0 attachment +while retaining both source relations. V31 pass and V32 fail coexist; V4 is +executed inconclusive; V51/V52 are contextual; R1 has no definition despite R3's +executions. These assertions apply to the application case as well as products. + +## Additional independent controls + +Each row starts afresh from its named case; inherited 0.2 controls also run after +substitution. Unmentioned results are derived by the same contract; the exact +effects below do not license ignoring diagnostics outside the selected scope. + +| Control | Expected result | +|---|---| +| Application: remove R9 application_scope | Known P = baseline P minus R9; unresolved membership = {R9}; known clean-unassigned = {}; its total null, not 0. Known S and first five sets unchanged, with affected completeness exposed. Restoring the relation restores {R9} and complete total 1. | +| Application: duplicate R1 membership, project membership and A1 assignment | P/L/S and all metric IDs unchanged; retain duplicate source identities; R1 still depth 1. Removing duplicates restores baseline provenance without changing counts. | +| Application: select Beta 2 with Alpha subject | Wrong owner; scope unavailable, all six totals null. Selecting Alpha 2 restores baseline. | +| Application: remove Alpha project's project_application to Alpha | Filtered scope unavailable. Unfiltered L remains the listed 13 IDs; no guessed project. Restoring pair restores S. | +| Application: replace R11's missing release target with B2 | Invalid assignment remains {R11}; unassigned remains {R9}; S and six sets unchanged. B2's owner is not R11's membership. Adding explicit R11 membership to Beta makes this a contextual assignment for Alpha; Alpha clean-unassigned becomes {R9,R11}, invalid becomes {}. | +| Application: give R11 an additional A2 assignment, retain missing target | S gains R11; broken gains R11; no-definition gains R11. Invalid remains {R11}, unassigned remains {R9}; no-source, no-result and fail unchanged. | +| Application: set R1 A1 attachment valid_to to query date | R1 remains in L/S on 2026-09-24; at 2026-09-25 it leaves L/S and becomes unassigned alongside R9. R1 leaves no-definition; other first-five IDs unchanged. Restore null to recover baseline. | +| Application: end R18 A2 attachment 2026-09-23 | R18 stays in S through A1 at depth 1. All six metric sets unchanged; V182 still explicitly verifies A2. Ending A1 attachment too removes R18 from S and adds R18 to unassigned. | +| Application: A2 predecessor becomes B1 | Stop before B1; R12 never enters known L. Known L = baseline L minus R1; known S = baseline S minus R1; totals affected by the invalid chain are null. R18 remains direct at depth 0. Restore A1 for complete baseline. | +| Application: R9 assignment has valid_from `not-a-date` | Known clean-unassigned excludes R9; invalid-assignment flag includes R9, window activity unresolved, diagnostic retained, unassigned total null. Do not turn malformed dates into an active or absent obligation. Removing malformed relation restores baseline. | +| Application: add valid V53 verifying R5 on A2 with pass, ordinary execution defaults | No-result becomes {R2,R20}; definition/result nodes gain V53. Changing only verified_on to A1 or removing it restores no-result {R2,R5,R20}; V53 stays contextual. | +| Application: set V32 performed_at to 2026-10-01 | Applicable fail = {}; R3 remains executed via V31; all other metric sets unchanged. Future-date finding retained. Restore 2026-09-21 to recover fail {R3}. | +| SaaS: select APPLICATION-SAAS-1 / RELEASE-SAAS-1 | Proven complete empty application membership gives P=L=S={}, all six empty, complete totals 0. Product support links do not transfer Alpha requirements. A failed membership-file read instead makes scope incomplete and totals null. | +| SaaS: add explicit application_scope R3 → APPLICATION-SAAS-1 and required_for R3 → RELEASE-SAAS-1 | Application P=L=S={R3}, stage Software={R3}. Metrics: broken={}, no-source={}, no-definition={}, no-result={R3}, fail={}, unassigned={}. V31/V32 remain product-release evidence. Parent context R2,R4,R1 and their sources is traversable, never included in S. Product baseline unchanged. | +| Previous SaaS control plus valid V301 verifying R3 on RELEASE-SAAS-1 with pass | Application no-result becomes {}; other five sets unchanged. Product fail remains {R3}; no result crosses subjects. R1 still lacks its own definition. | + +Consumers must expose known contributing IDs alongside null totals when reads, +membership or predecessor validation are incomplete. A loader returning an empty +array after an error fails these controls. Equivalent headless, matrix and release +views must compare IDs and diagnostics, not just cardinalities. diff --git a/notations/packages/documents.md b/notations/packages/documents.md index eca96a28..799bcc39 100644 --- a/notations/packages/documents.md +++ b/notations/packages/documents.md @@ -31,14 +31,15 @@ packages: [documents] ## 2. Object types and ID grammar -### 2.1 The two object kinds +### 2.1 Object kinds -The package's object model has exactly two kinds: +The package carries document definitions and instances, plus stored handoff events: | Kind | What it holds | |---|---| | `document-type` | A template: a name, a list of required fields (key + datatype), and versioning constraints. | | `document` | An issued instance: an id, the type it instantiates, a version, a status, a timestamp, and a `values` map keyed by field name. | +| `issuance-event` | A retained handoff act with issuer, recipient and pointers to evidence (§8). | ### 2.2 ID grammar — disjoint from core @@ -52,13 +53,14 @@ Per [`PACKAGES.md`](../PACKAGES.md) §4.1, a package identifier must never be sh |---|---| | `doct` | `document-type` | | `doc` | `document` | +| `issue` | `issuance-event` | -- `` is one of the two literal tokens above, followed immediately by a hyphen (so `doc-…` and `doct-…` never collide — the token match is exact, not a prefix test). +- `` is one of the literal tokens above, followed immediately by a hyphen (so `doc-…` and `doct-…` never collide — the token match is exact, not a prefix test). - `` is one or more lowercase alphanumeric segments separated by hyphens. - `` is a terminal positive integer ≥ 1, no leading zeros — same terminal-integer rule as the core grammar ([`IDS_AND_REFERENCES.md`](../IDS_AND_REFERENCES.md) §1). ``` -^(doct|doc)-[a-z0-9]+(?:-[a-z0-9]+)*-[1-9][0-9]*$ +^(doct|doc|issue)-[a-z0-9]+(?:-[a-z0-9]+)*-[1-9][0-9]*$ ``` **Examples:** `doct-requirements-1`, `doc-srs-v2-1`, `doct-architecture-decision-1`, `doc-meeting-notes-2`. @@ -69,9 +71,11 @@ Per [`PACKAGES.md`](../PACKAGES.md) §4.1, a package identifier must never be sh documents/ document-types/.yaml documents/.yaml + events/.yaml # retained handoff acts + evidence/ # optional retained run/baseline/token bytes ``` -One object per file, named by its id. Every file carries `package: documents` and `kind: ` — this pair is how the package's own tooling recognises its files; core tooling never reads them (§4.2 of the mechanism doc). +One object per file, named by its id. Every file carries `package: documents` and `kind: ` — this pair is how the package's own tooling recognises its files; core tooling never reads them (§4.2 of the mechanism doc). ### 2.4 `document-type` schema @@ -150,6 +154,7 @@ The package validator checks that a `canon_refs` value is grammar-valid (DOCS-00 ``` /documents/document-types/.yaml /documents/documents/.yaml +/documents/events/.yaml ``` One artefact per file, named by its canonical package id (§2.2). @@ -170,6 +175,8 @@ Run by `@transitrix/documents-cli validate ` (the reference im | `DOCS-006` | error | A `document.issued_at` is not a valid ISO 8601 timestamp, or `document.version` is neither a full SemVer string nor the two-component numeric compatibility form in §2.5. | | `DOCS-007` | error | A `document.status` is not one of: `draft`, `issued`, `superseded`, `archived`. | +Event-specific structural and evidence diagnostics are defined in §8. + No rule here reaches into `canon/`, `field/`, or `codex/` — package-internal integrity only, per [`PACKAGES.md`](../PACKAGES.md) §4.2. --- @@ -205,28 +212,103 @@ This package carries document identity and traceability metadata: versioning, st --- +## 8. Issuance-event register + +An `issuance-event` records an asserted handoff: **what, when, by whom, to whom**. +It does not prove that software submitted, approved or signed anything. Store one +row per act in `documents/events/.yaml`. A later handoff gets a new ID; +`transitrix-documents record` refuses to overwrite an existing row. Retain the +referenced bytes separately; the command never creates or replaces evidence. +Git history and adopter storage controls remain responsible for retention. + +| Field | Contract | +|---|---| +| `package`, `kind` | Exactly `documents`, `issuance-event`. | +| `id` | `issue--`, unique in the package. | +| `document` | Document ID using the existing `doc-…` grammar. A citation, not a new stable-identity schema. The current local document need not exist. | +| `edition` | Nonblank adopter-supplied edition label, e.g. `B`. Independent of the existing document's numeric `version`; no automatic conversion or latest-edition inference. | +| `issued_at` | Real UTC timestamp, second precision (`YYYY-MM-DDTHH:mm:ssZ`), of the asserted act. | +| `issuer`, `recipient` | Nonblank strings supplied by the recorder. No directory, signature or identity verification. | +| `run_record`, `baseline` | Pointers with exactly `uri` and `sha256`. URI is absolute, or a package-relative retained file path. | +| `resource` | Pointer with `uri` and `sha256` to the externally stored output bytes. Absolute URI required, e.g. `resource://documents/rp17/b.pdf`. | +| `issue_hash` | SHA-256 of the canonical act and pointers, as specified below. Computed by `record` if absent; a supplied mismatch fails. | +| `synthetic` | Optional boolean; use `true` for synthetic acts. | +| `timestamp` | Optional external evidence; absent by default. See below. | + +Every pointer hash is `sha256:` followed by 64 lowercase hexadecimal digits, +computed over the exact referenced bytes. A baseline pointer names retained +baseline evidence in the adopter's format; it does not copy the commit into the +row or imply the renderer created a snapshot. Absolute URIs must be parseable, +nonempty and contain no whitespace, backslash or credentials. Relative pointers +use slash-separated ASCII letters, digits, dots, underscores and hyphens; empty, +`.` and `..` segments are forbidden. The CLI reads relative files inside the +package only, refusing symlink escapes. It does not fetch absolute URIs, even +`file:` URIs. An authorized integration can supply bytes using the `inspectEvent` +loader API; URI resolvability outside the package belongs to that integration. + +Unknown event fields are errors: inventories, recipe editions and stale flags +belong in referenced evidence or derived answers, never copied into the act. +Existing `document-type` and `document` records retain their previous validation +and require no event, timestamp, migration or conversion. The event edition label +does not adopt the proposed RP-17 document/form identity or edition schema. + +**Hash contract.** Remove `issue_hash` and `timestamp`; recursively serialize the +remaining JSON value with object keys sorted by JavaScript string order, array +order retained and `JSON.stringify` scalar escaping, with no whitespace or final +newline. Hash those UTF-8 bytes. This is an integrity binding for recorded claims, +not proof of generation, submission or trusted time. `issueHash` in the CLI's +`src/events.mjs` exports the same algorithm. Retain original record and evidence +bytes; validation and reading never rewrite them. + +**Optional RFC 3161 seam.** `timestamp` contains `format: rfc3161`, `issue_hash` +(equal to the row hash), and `token_base64` and/or `reference` (a URI/hash pointer). +The token must be nonempty canonical base64. When both forms are present, its +bytes must match the reference hash. Supplied values are preserved. The validator +accepts only the envelope and association structurally: it does not parse a token's +DER, verify its message imprint, signature, certificate chain or trust policy. +An external RFC 3161 verifier must do those checks before calling it a trusted +timestamp. A synthetic token is test evidence only. No provider is contacted and +no token is minted. Output says `not-verified`, or `not-supplied` when absent. + +**Validation and evidence states.** `DOCS-EVENT`, `DOCS-POINTER`, `DOCS-HASH` and +`DOCS-TIMESTAMP` are structural errors. Duplicate IDs still fail DOCS-002. +`DOCS-EVIDENCE` is an error for conflicting bytes or contradictory run fields, +and a warning for unavailable evidence or unknown run format. Missing evidence +never becomes an invented successful observation. The read/API result is +`invalid`, `conflict`, `incomplete` or `consistent`; conflict takes precedence over +unavailable evidence. A structurally valid row may be created with unavailable +references, visibly `incomplete`. Matching hashes mean only matching supplied +bytes. The baseline format and its semantic agreement with a run are not inferred; +use the provenance checker with independently observed evidence for that comparison. +Register-wide queries are a separate interface (§10). + +Commands and a synthetic authoring example: [documents CLI](../../packages/documents-cli/README.md). + +--- + ## 9. DMS integration contract This package is upstream of document management. An adopter who keeps issued documents in a document management system (DMS) — whether commercial, open-source, or internal — integrates with this package at a defined seam. This section specifies what the module produces, what the adopter DMS provides, and what deliberate non-scope boundaries protect both sides. ### 9.1 What the module produces — the contract's goods -A rendered document run produces three artefacts: +The supported renderer emits a flat run record alongside rendered output. The +following distinguishes that output from adopter-supplied integration evidence: | Artefact | What it holds | Audience | |---|---|---| | **Run record** | Recipe identity (id, version), repository commit, model id, render timestamp, per-slot instructions and their verdicts. | DMS, integration layer, audit trails. | -| **Snapshot manifest** | The model state the render captured: list of element IDs cited in the document, rendered date, methodology version. | Traceability queries, freshness checks, retirement detection. | -| **Document identity** | Issuer, issue timestamp, document hash (content fingerprint), source reference (URI), baseline tag (git reference). | DMS registration, integrity checking, auditability. | +| **Snapshot/baseline evidence** | Supplied and retained by the adopter; not automatically emitted by the renderer. | Traceability and provenance checks. | +| **Issuance event** | Explicitly recorded act and hashed pointers (§8); not automatically emitted on render. | DMS integration and audit trails. | -**Format:** each is emitted as JSON by the reference implementation. A non-reference renderer may emit another format provided it carries the same semantic content and is documented per §9.6. +**Format:** the renderer serializes its run record as JSON. The optional register stores YAML (the creation command writes JSON, a YAML subset). No automatic snapshot or identity envelope is required or claimed. ### 9.2 What the adopter DMS provides — the contract's consumers | Consumer layer | Role | |---|---| | **Document store** | URI-addressable storage for the PDF (or other output format) — e.g. `resource://documents/srs-2026-q3/issue-1`. The URI is a reference, never dictated by the module. | -| **Metadata intake** | An endpoint or queue where the module deposits run record, snapshot manifest, and document identity on every render. | +| **Metadata intake** | Adopter-owned ingestion of retained run records, baseline evidence and explicit handoff events. The module has no delivery endpoint or webhook. | | **Query surface** | An API exposing facts the adopter needs — e.g. "which documents cite this capability", "which documents may be stale because an element changed". These queries are application-specific; the module provides the data, not the queries. | | **Retention and lifecycle** | Retention schedules, approval workflows, signature capture, records classifications, any regulatory regime the adopter runs. None of this is the module's concern. | @@ -247,107 +329,63 @@ The module carries document **identity and traceability**. It does not carry doc The module answers the question "what model was rendered into this document?" — not "who may see it" or "when must it be deleted." -### 9.4 Data exchange format — run record schema +### 9.4 Data exchange format — actual run record -The run record is the primary interchange artefact. Its structure is governed by [`document-renderer/README.md`](../../packages/document-renderer/README.md), emitted as JSON following this schema: +[`buildRunRecord`](../../packages/document-renderer/src/run-record.mjs) emits flat +fields, not the formerly illustrated nested `recipe` / `repository` / `model` +envelope. A synthetic output with no instruction slots is: ```json { - "recipe": { - "id": "product.srs", - "version": "1.0" - }, - "repository": { - "commit": "a1b2c3d4…", - "baseline_tag": "release-2026-q3" - }, - "model": { - "id": null, - "methodology_version": "5.1.0" - }, - "rendered_at": "2026-09-02T14:30:00Z", - "profile": "strict", - "slots": [ - { - "slot_id": "market-size", - "question": "How large is the addressable market?", - "inputs": ["CAP-1", "REQ-14"], - "sufficient": true, - "verdict": "sufficient", - "produced_text": "The addressable market is $5B growing at 15% CAGR.", - "attributions": ["CAP-1"] - } - ], - "suspicion": { - "computed": false, - "reason": "not-computed-by-this-pass" - } -} -``` - -**Snapshot manifest** (extracted from the run record and document, for efficiency in queries): - -```json -{ - "document_id": "doc-srs-v2-1", - "document_hash": "sha256:a1b2c3…", - "rendered_at": "2026-09-02T14:30:00Z", - "recipe_id": "product.srs", + "recipe_id": "rp17", "recipe_version": "1.0", - "baseline_commit": "a1b2c3d4…", - "methodology_version": "5.1.0", - "elements_cited": [ - "CAPABILITY-V2", - "REQUIREMENT-sched-auth-1", - "CONSTRAINT-4" - ] -} -``` - -**Document identity** (metadata bound to the issued artefact): - -```json -{ - "id": "doc-srs-v2-1", - "type": "doct-requirements-1", - "version": "2.0", - "status": "issued", - "issued_at": "2026-09-02T14:30:00Z", - "issuer": "release-automation@example.com", - "content_hash": "sha256:a1b2c3…", - "source_uri": "resource://documents/srs-2026-q3/issue-1", - "baseline_tag": "release-2026-q3" + "repository_commit": "synthetic-base-b", + "model_id": null, + "run_timestamp": "2026-07-10T09:00:00Z", + "render_date": "2026-07-10", + "profile": "strict", + "slots": [] } ``` -All timestamps are ISO 8601 UTC, second-precision. Hashes use SHA256. A non-reference renderer must emit JSON carrying these fields; schema variations are acceptable if approved by the consuming DMS. - -### 9.5 Integration example — how a DMS consumes the data - -**Scenario:** The adopter runs Studio to render a recipe, capturing the run record and snapshot manifest. A webhook delivers them to the DMS integration layer. - -``` -1. Studio renders recipe -> PDF + run record + document identity -2. Metadata integration layer receives all three -3. DMS: - - Stores the PDF at the URI named in document identity - - Ingests snapshot manifest for traceability queries - - Logs the run record for audit trail - - Marks the document as "ready for review" (its own workflow) -4. On later model change (element modified/deleted): - - Snapshot query: "which documents cite this element?" - - Result: [doc-srs-v2-1] - - DMS flags document as "stale, re-render recommended" - - Adopter decides: re-render, or retire the document -``` - -The module provides the data. The adopter DMS provides the **decision**, the **action**, and the **workflow**. +Each slot carries `slot_id`, `question`, `inputs`, `sufficient`, `verdict`, +`reason`, `produced_text`, and `attributions`. `repository_commit` and `model_id` +may be null; the builder defaults `run_timestamp` to an ISO timestamp with +milliseconds. Do not confuse that render time with the event's second-precision +handoff time. The renderer does not emit `baseline_tag`, `methodology_version`, +`elements_cited`, `suspicion` or document identity. A run's recorded attribution +is not proof of complete input closure or actual generation from a baseline. + +The event points at the exact run bytes; it copies none of those fields. The +reader recognizes a flat run by string `recipe_id`, `recipe_version` and array +`slots`. For retained compatibility it also recognizes the old illustrative +nested `recipe.id`, `recipe.version` and `slots`; no conversion is performed. +When both representations exist, disagreeing recipe identity/version or +`repository_commit` versus `repository.commit` is a conflict. Other legacy or +partial formats remain unknown/unavailable, even if their byte hash matches. +Unknown fields in run evidence are preserved; they are not inferred as supported +claims. This compatibility does not promise that a legacy renderer emitted the +old illustrative snapshot/identity objects. + +### 9.5 Integration example — explicit handoff + +1. Render the recipe; retain output and the actual flat run record. +2. Retain baseline evidence through the adopter's existing process, and keep the + output at its external URI. Compute the pointer hashes from retained bytes. +3. Record the asserted act with issuer, recipient, edition and time using §8. + Rendering alone creates no issuance event. +4. Read and validate the event. An unavailable external store remains unavailable; + an authorized adapter may supply its bytes for comparison. Subsequent handoffs + create new rows and do not rewrite the historical act or referenced evidence. + +The adopter DMS supplies storage, decisions and workflow. The package has no +automatic submission, signing or timestamp-provider integration. ### 9.6 Out-of-scope list — what the adopter DMS must guarantee - **The adopter is responsible for:** - Storing the document bytes at the URI the module names - - Verifying the content hash matches what the module emitted + - Verifying the retained bytes match their recorded hashes - Implementing access control (who may read/download) - Enforcing retention schedules and lifecycle - Capturing and verifying signatures if regulations require them @@ -367,196 +405,81 @@ The module provides the data. The adopter DMS provides the **decision**, the **a ## 10. Traceability queries — bidirectional document-model linkage -The DMS integration produces three derived queries that enable computable traceability between issued documents and the model elements they cite. These queries run on demand against run records and snapshot manifests, with no persistent storage or index beyond what those two artefacts provide (§10.5). - -### 10.1 Query 1: Documents citing an element - -**Purpose:** Given a model state (git commit) and an element ID, find all issued documents that cite that element. - -**Signature:** -``` -documents_citing_element(commit: string, element_id: string) - -> List[{document_id, document_version, rendered_at, recipe_id}] -``` - -**Inputs:** -- `commit`: Git commit hash at which to query the model state (e.g. `a1b2c3d4…`). -- `element_id`: A core element ID in grammar-valid form per [`IDS_AND_REFERENCES.md`](../IDS_AND_REFERENCES.md) §1 (e.g. `CAPABILITY-V2`, `REQUIREMENT-sched-auth-1`). - -**Output:** An array of document records, each carrying: -- `document_id`: The document's package id (`doc-…` per §2.2). -- `document_version`: SemVer version of that document instance. -- `rendered_at`: ISO 8601 UTC timestamp when the document was issued. -- `recipe_id`: The recipe that rendered this document. -- `recipe_version`: Version of the recipe. - -**Evaluation:** -1. Enumerate all run records where `repository.commit` is `commit` or an ancestor thereof (within the canonical rendering workflow's lookback window; see §10.5). -2. For each run record, inspect its `slots[].attributions[]` to identify which elements are cited. -3. For each document rendered by that run, check its snapshot manifest: if `elements_cited` contains `element_id`, include the document in the result. - -**Example:** -``` -documents_citing_element( - commit="release-2026-q3", - element_id="CAPABILITY-V2" -) --> [ - { - document_id: "doc-srs-v2-1", - document_version: "2.0", - rendered_at: "2026-09-02T14:30:00Z", - recipe_id: "product.srs", - recipe_version: "1.0" - } -] -``` - -**Called from:** Adopter dashboards, internal audit tools, downstream DMS traceability queries (e.g. "which documents cite this capability?"). - -### 10.2 Query 2: Documents affected by a model change - -**Purpose:** Given an element ID that was deleted or moved, find all issued documents that are now potentially stale because they cited the old element state. - -**Signature:** -``` -stale_documents_for_change(element_id: string, change_type: enum["deleted", "moved"]) - -> List[{document_id, document_version, last_rendered_at, stale_since}] -``` - -**Inputs:** -- `element_id`: The core element ID that changed (e.g. `REQUIREMENT-auth-1`). -- `change_type`: The nature of the change — `"deleted"` if the element no longer exists in `canon/`, or `"moved"` if it was renamed or reclassified. - -**Output:** An array of stale-document records, each carrying: -- `document_id`: The document's package id. -- `document_version`: SemVer version of the document instance. -- `last_rendered_at`: ISO 8601 UTC timestamp when the document was last issued. -- `stale_since`: ISO 8601 UTC timestamp of the commit that deleted/moved the element. -- `recommendation`: One of `"re-render"`, `"retire"`, or `"review"` (based on time elapsed since render, per DMS policy). - -**Evaluation:** -1. Query git history to find the commit where `element_id` was deleted or moved. -2. Enumerate all run records where `repository.commit` is before that deletion commit. -3. For each run record, check all documents it rendered: if the snapshot manifest's `elements_cited` contains `element_id`, the document is stale. -4. Return all stale documents, sorted by `last_rendered_at` (oldest first). - -**Example:** -``` -stale_documents_for_change( - element_id="REQUIREMENT-auth-1", - change_type="deleted" -) --> [ - { - document_id: "doc-srs-v2-1", - document_version: "2.0", - last_rendered_at: "2026-09-01T10:00:00Z", - stale_since: "2026-09-02T08:45:00Z", - recommendation: "re-render" - } -] -``` - -**Called from:** Adopter DMS on model change events, CI/CD workflows that flag stale documents, change-impact dashboards. - -### 10.3 Query 3: Document provenance and elements - -**Purpose:** Given an issued document ID, retrieve the model state it was rendered from, its render metadata, and the complete list of elements it cites. - -**Signature:** -``` -document_provenance(document_id: string) - -> { - document_version, - rendered_at, - recipe_id, - recipe_version, - baseline_commit, - methodology_version, - elements_cited: List[string], - run_record: object - } -``` - -**Inputs:** -- `document_id`: The document's package id (`doc-…` per §2.2). - -**Output:** A single document-provenance record carrying: -- `document_version`: SemVer version of the document. -- `rendered_at`: ISO 8601 UTC timestamp when rendered. -- `recipe_id`: The recipe that produced this document. -- `recipe_version`: Version of the recipe. -- `baseline_commit`: Git commit hash of the model state that was rendered. -- `baseline_tag`: Git tag or reference name if the render was tagged (e.g. `release-2026-q3`). -- `methodology_version`: The Transitrix methodology version the render used. -- `elements_cited`: Array of core element IDs in `elements_cited` from the snapshot manifest. -- `run_record`: The full run record JSON (for audit trails and detailed inspection). - -**Evaluation:** -1. Look up the snapshot manifest for `document_id` in the DMS metadata store. -2. Retrieve the corresponding run record from the same store. -3. Return the full provenance object. - -**Example:** -``` -document_provenance("doc-srs-v2-1") --> { - document_version: "2.0", - rendered_at: "2026-09-02T14:30:00Z", - recipe_id: "product.srs", - recipe_version: "1.0", - baseline_commit: "a1b2c3d4…", - baseline_tag: "release-2026-q3", - methodology_version: "7.0.0", - elements_cited: ["CAPABILITY-V2", "REQUIREMENT-sched-auth-1"], - run_record: { … } -} -``` - -**Called from:** DMS UI (document details pane), adopter integration tools, audit and compliance workflows, document versioning dashboards. - -### 10.4 Calling convention and error handling - -All three queries are **stateless and demand-computed**. They run synchronously on invocation, with no caching or warming phase. - -| Error case | Behavior | -|---|---| -| `element_id` not found in any run record | Return empty list (Query 1, 2) or `null` (Query 3). | -| `commit` not in git history | Return empty list (Query 1). | -| `document_id` not found in DMS | Return `null` (Query 3). | -| Run record or snapshot manifest corrupted | Raise `DataIntegrityError` with the affected document id. | -| Git history unavailable | Raise `GitHistoryError` — queries are offline and fail gracefully if the repository is not accessible. | - -### 10.5 Implementation location and performance - -**Where they run:** -- **Primary:** Studio's document-render workflow, after rendering completes and before metadata is handed to the DMS. -- **Secondary:** The adopter's own integration layer or DMS plugin, querying via a REST API the module exposes (see §10.6). -- **Offline:** An adopter's internal dashboard or audit tool that has read access to run records and git history but not the DMS. - -**Performance characteristics:** -- Query 1 (documents citing element): O(R × S), where R = number of run records in the lookback window, S = average snapshot size. Typical: < 500ms for 10 years of renders. -- Query 2 (stale documents): O(R × S × G), where G = git-history depth (worst case: full repo walk to find the deletion commit). Typical: < 2s for 10 years of renders. Mitigation: cache the deletion commit once found. -- Query 3 (document provenance): O(1) — direct lookup in DMS metadata store. - -**No persistent index.** Queries derive results from run records and git history on demand. This trades latency for simplicity: no index to keep in sync, no storage beyond what the DMS already holds, and every result is guaranteed current (never stale cached data). - -**Lookback window:** Queries enumerate run records back to the earliest document still in-scope under the adopter's retention policy (see §9.6). The module does not enforce a limit; it is the adopter DMS's responsibility to bound the window (e.g. "only documents from the last 7 years" or "only documents marked 'active'"). - -### 10.6 API surface — how callers invoke the queries - -Each query is a callable function in the module's integration layer, exposed as: -- **Studio plugin:** `@transitrix/documents-dms-queries` package, imported as `{ documentsForElement, staleDocuments, documentProvenance } from '@transitrix/documents-dms-queries'`. -- **REST API:** `POST /query/` on the adopter's integration endpoint, with JSON body carrying the query inputs. -- **Python CLI:** `@transitrix/documents-cli query ` (reference implementation). - -Each invocation logs (to the DMS audit trail): -- Query name -- Inputs (commit, element id, or document id) -- Timestamp -- Caller identity (if available from the calling context) -- Result count +The optional documents package exposes `queryIssuedDocuments` from +`@transitrix/documents-cli/src/queries.mjs`. It enumerates retained issuance events +(§8), loads their exact flat run records (§9.4), checks explicit baseline bindings +and reads historical Git objects. It reuses the renderer's +[`checkDocumentProvenance`](../../packages/document-renderer/PROVENANCE.md). +See the [query interface and adapter contract](../../packages/documents-cli/README.md#querying-retained-issuance-events) +for installation, baseline JSON, authorization and complete arguments. + +### 10.1 Element → issued documents + +`query: { kind: 'element', id: elementId }` examines every retained event in the +selected register. Matching events name their exact document and edition, run +and baseline pointers, recipe and observed input closure. Multiple handoffs are +returned separately. It does not infer issuance from a render or choose the latest +edition by date. Run `slots[].attributions` are reported separately from complete +input closure: a matching input need not be quoted verbatim in the output. + +### 10.2 Changed element → review of issued documents + +`query: { kind: 'review', id: elementId, target: exactCommit }` compares each +issued baseline with an explicit full target commit. Changes include **content +modifications**, additions, deletions and moves; changed element IDs are read from +both Git trees. Path dependencies include directory membership, so a retained +observer can account for dynamic selections. Moves conservatively require review. + +Within a complete independently observed closure, intersection yields +`review-needed`; nonintersection yields `no-relevant-change`. The selected element +must itself have changed for the event to appear in `matches`; the per-event review +result considers every input in its closure. Missing history, closure, retained +bytes or binding yields `unknown`. No dates, wall-clock stale-since value or +persistent stale flag is computed. A review result describes Git evidence, not +proof that an edition is invalid or permission to regenerate it. + +### 10.3 Issued document → model and elements + +`query: { kind: 'document', id: documentId }` returns **all** retained handoffs for +that document, preserving the explicitly recorded edition and release association. +It reports the repository identity, exact baseline commit, run attributions and +observed input closure. The generated-prose `model_id` is not the model repository +identity. No current checkout, latest review, edition label or timestamp substitutes +for a historical binding. A/B retention, independent unchanged reviews without C, +and explicit release/B association remain as illustrated by +[RP-17](../examples/packages/rp17.md); proposed semantic validators remain proposed. + +### 10.4 Unknown and conflict semantics + +Results contain `status`, `matches`, per-event `records` and enumeration `failures`. +Malformed/unreadable rows cannot silently become nonmatches. A missing register, +unknown document, unavailable baseline/history or absent closure returns +`incomplete`, never an empty successful result. Contradictory document, run, +baseline, output or release bindings remain `inconsistent` even if an individual +hash or review check passes. `match` and `review` retain explicit unknown states. +Matching hashes and associations never establish actual generation, so a known +review result can coexist with incomplete overall provenance. + +### 10.5 Retention and execution boundary + +Queries read an adopter-selected immutable register snapshot, retained evidence +and explicit committed Git states. They do not write source files, event rows, +run records, outputs, indexes, element inventories, stale flags or audit logs. +They enumerate the complete selected register without an implicit lookback window. +The adopter owns retention and authorization; no result claims completeness for +records outside that selected retained scope. Reads and tree comparisons occur +on demand; no performance promise or persistent cache is part of the contract. + +### 10.6 Supported surface + +The shipped surface is the asynchronous Node.js API in `@transitrix/documents-cli`, +with `@transitrix/document-renderer` installed as its optional query peer. The +record/read/validate CLI remains available (§8). There is no shipped query REST +endpoint, Studio DMS plugin, Python query command or automatic audit logging. +Adapters own authorized external byte access and independent observer evidence; +missing adapters produce unknown results, not fabricated observations. Storage, +workflow, approval, signing, scheduling and provider integration remain outside +this package. --- diff --git a/notations/schemas/README.md b/notations/schemas/README.md new file mode 100644 index 00000000..9bf22cc9 --- /dev/null +++ b/notations/schemas/README.md @@ -0,0 +1,22 @@ +# Capability-map additive schemas + +`capability-map-contract.schema.json` is JSON Schema draft-07. Validate a +canonical CAPABILITY fragment against `#/$defs/capabilityFields`, a canonical +APPLICATION (or applications catalogue entry) against `#/$defs/applicationFields`, +and a capability-map `view_config` against `#/$defs/viewConfig`. + +These are additive field contracts. Element admission, primitive lifecycle, +identity and the rest of each notation remain governed by their existing +specifications. Additional source element fields are accepted; unknown keys in +the newly defined view settings and technical inventory entries are rejected. +Schema `default` annotations describe render defaults and do not mutate sources. +Enable date format assertion in the schema consumer. + +The single-file `tools/lint.py` carries an equivalent embedded contract for +onboarding compatibility. Regression tests require exact parity with this +schema and the controlled vocabulary. The linter additionally checks local-key +uniqueness, canonical mapping references, view references and explicit lifetime +bounds. No external schema library is needed to run the reference linter. + +Use the complete synthetic model in `tests/fixtures/capability-management-cycle/` +for integration checks. See capability-map §16.4 for consumer compatibility. diff --git a/notations/schemas/capability-map-contract.schema.json b/notations/schemas/capability-map-contract.schema.json new file mode 100644 index 00000000..b9732dfc --- /dev/null +++ b/notations/schemas/capability-map-contract.schema.json @@ -0,0 +1,225 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Capability-map core additive field contracts", + "$comment": "Additive field contracts, not a complete model schema. Select a $defs entry. Referential integrity, local-key uniqueness and lifetime checks require tools/lint.py. Other fields retain their existing specifications.", + "$defs": { + "capabilityFields": { + "type": "object", + "properties": { + "management_cycle_stage": { + "enum": [ + null, + "Strategic", + "Learning", + "Planning", + "Execution", + "Assurance" + ] + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "pattern": "\\S" + } + } + }, + "additionalProperties": true + }, + "applicationFields": { + "type": "object", + "properties": { + "technical_capabilities": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "minLength": 1, + "pattern": "\\S" + }, + "name": { + "type": "string", + "minLength": 1, + "pattern": "\\S" + }, + "capabilities": { + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "pattern": "\\S" + }, + "uniqueItems": true + }, + "valid_from": { + "type": [ + "string", + "null" + ], + "format": "date" + }, + "valid_to": { + "type": [ + "string", + "null" + ], + "format": "date" + } + }, + "additionalProperties": false, + "required": [ + "key", + "name" + ] + } + } + }, + "additionalProperties": true + }, + "viewConfig": { + "type": "object", + "properties": { + "valid_at": { + "type": [ + "string", + "null" + ], + "format": "date", + "default": null + }, + "scenario": { + "type": [ + "string", + "null" + ], + "minLength": 1, + "default": null + }, + "management_cycle": { + "type": "object", + "properties": { + "group": { + "type": "boolean", + "default": false + }, + "order": { + "const": [ + "Strategic", + "Learning", + "Planning", + "Execution", + "Assurance" + ], + "default": [ + "Strategic", + "Learning", + "Planning", + "Execution", + "Assurance" + ] + } + }, + "additionalProperties": false + }, + "tags": { + "type": "object", + "properties": { + "filter": { + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "pattern": "\\S" + }, + "uniqueItems": true, + "default": [] + }, + "show": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, + "display": { + "type": "object", + "properties": { + "depth": { + "type": "integer", + "enum": [ + 1, + 2, + 3 + ], + "default": 3 + }, + "backlog": { + "type": "boolean", + "default": false + }, + "maturity": { + "type": "boolean", + "default": false + }, + "legend": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, + "systems": { + "type": "object", + "properties": { + "highlight": { + "type": [ + "string", + "null" + ], + "minLength": 1, + "default": null + }, + "selected": { + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "pattern": "\\S" + }, + "uniqueItems": true, + "default": [] + }, + "shape": { + "enum": [ + "angled", + "rectangular" + ], + "default": "angled" + }, + "labels": { + "type": "boolean", + "default": false + }, + "coverage": { + "type": "boolean", + "default": false + }, + "rounded": { + "type": "boolean", + "default": false + }, + "overlap": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + } +} diff --git a/notations/views/diagrams/05-capability-map.md b/notations/views/diagrams/05-capability-map.md index 1540de3b..150e29ea 100644 --- a/notations/views/diagrams/05-capability-map.md +++ b/notations/views/diagrams/05-capability-map.md @@ -1,21 +1,21 @@ --- notation: "Capabilities Map" -version: "0.4" +version: "0.5" author: "Valerii Korobeinikov" -last_updated: "2026-09-26" +last_updated: "2026-10-23" status: "documented" file_extension: "*.capability-map.transitrix.yaml" -dsm_status: "implemented — Capabilities page, Editor (C), BCM tab" +dsm_status: "core grid implemented; management-cycle and coverage changes not verified in consumers" --- # Capabilities Map Notation — Reference -**Version:** 0.3 -**Date:** 2026-05-19 -**Status:** Implemented in Transitrix DSM +**Version:** 0.5 +**Date:** 2026-10-23 +**Status:** Core notation documented; management-cycle and coverage correction prepared for review (§16.4) **File extension:** `*.capability-map.transitrix.yaml` **Scope:** Capability hierarchy with CMMI V2.0 maturity assessment, addressing system, V/H orientation, lifecycle. Aligned to roles, processes, and applications. -**Renderer:** Transitrix DSM — Capabilities table, Editor (C), BCM tab; Transitrix Studio (planned) +**Renderer:** Existing core grid: Transitrix DSM — Capabilities table, Editor (C), BCM tab. The added stage, coverage and view-config contracts have no verified native consumer support; see §16.4. --- @@ -160,6 +160,59 @@ set_name . b . o . L1 . L2 . L3 --- +## 6a. Management-cycle stage and tags + +A capability MAY carry `management_cycle_stage`, an optional classification +independent of architectural `layer`, decomposition, V/H orientation, maturity +and application mappings. It belongs on the canonical capability element, not +inside view configuration or an `extensions` bag. Canonical `layer` remains +`business`. Omitted or null means not classified; it does not imply an absent +ability or an incomplete domain. + +The controlled values and display order are: + +| Value | PDCA + Learn correspondence | Capability contribution | +| --- | --- | --- | +| `Strategic` | Act and strategic Plan | Choose direction, strategic goals, priorities and significant organisational improvements; strategic planning | +| `Learning` | Learn, the explicit addition to PDCA | Research, reflection, knowledge capture and sharing, learning and competence development | +| `Planning` | Tactical and operational Plan | Budgets, capacity, resources, scheduling and executable operational plans | +| `Execution` | Do | Perform the domain's work, including operational master-data maintenance | +| `Assurance` | Check | Monitor outcomes, quality, deviations, controls and compliance | + +Strategic planning belongs to Strategic; tactical/operational planning belongs +to Planning. Classify by decision scope and represented ability, not the word +"planning" or a time horizon alone. The order is a layout convention, not a +process sequence. Local improvement can occur in every domain. A composite L1 +can remain unclassified while its children occupy several stages. + +Stages MUST NOT inherit from parents, tags, names, maturity or orientation. +Changing a stage requires an explicit source-model change. Dated views must not +apply a later classification retroactively when no historical source is supplied. +This field does not by itself introduce a new sidecar series. + +`tags` remains the common free-form classifier array. ESG, MDM and Support are +tag values, never management stages. ESG/MDM describe subject affiliation; +Support describes a supporting role and does not automatically change the +capability's `type`. A tag does not create, remove or imply an H capability or +intersection. Actual horizontal capabilities retain their identity, hierarchy, +maturity and explicit application mappings. Tags MUST NOT inherit. + +```yaml +# Fragment of a capability element; admission/lifecycle omitted. +notation: capability +id: CAPABILITY-H1.2.1 +name: Customer data quality control +layer: business +management_cycle_stage: Assurance +tags: [MDM, Support] +``` + +A layer or tag is a source fact; whether/how to show it is view configuration +(§16). Missing classification remains visible as Not specified when grouping; +it is not silently assigned a stage. Unknown authored stage values are invalid. + +--- + ## 7. Lifecycle states Each capability has **Start Date** and **End Date** attributes reflecting the period during which it is valid: @@ -264,6 +317,8 @@ capability_map: | `owner_role` | No | Reference to BusinessRole element ID. **Time-varying** — sidecar, not inline. | | `business_process` | No | Reference to BusinessProcess element ID. Stays inline in v1 (relations are Wave 3 territory). | | `applications` | No | List of ApplicationComponent element IDs. Stays inline in v1 (relations are Wave 3 territory). | +| `management_cycle_stage` | No | One of the five values in §6a, or null; canonical capability attribute, no inheritance. | +| `tags` | No | Common element tags; ESG/MDM/Support are independent classifier values, not stages (§6a). | | `children` | No | List of child capabilities. | --- @@ -357,3 +412,137 @@ Migration: adopters with existing inline values move each value into a single-en Schema shape/type failures follow [CONTRACT.md](../../CONTRACT.md) §18.6. Positive/rejecting cases and version compatibility are in the [diagnostic migration contract](../../../migrations/6.0-to-7.0/). + +--- + +## 16. System coverage, dated views and presentation defaults + +### 16.1 Explicit coverage + +An application's direct `capabilities` list and its technical inventory's +explicit capability lists ([applications catalogue §6a](10-applications.md#6a-technical-capabilities-and-business-coverage)) +are separate evidence paths to business capabilities. A projection MUST declare +its direct-link source and retain both paths in provenance. Conflicting inverse +lists require reconciliation, not union by assumption. Parent/child, tag and +stage classifications do not imply support. Missing mappings mean not specified, +not unsupported, absent or zero coverage. Several links from one application +count once when collecting that application's target set. + +A system polygon encloses its selected visible targets. Connecting empty space, +shape and area do not add mappings or express a coverage percentage. Colored +polygons may mask unrelated boxes. Shape is either an axis-aligned bounding +rectangle or an angled enclosing hull; rounding is independent. Small margins +must not create decorative overlap between neighboring domains. + +Red overlap outlines the boundary of the region inside **at least two selected +outer system polygons**: `R = union over i < j of (P_i intersection P_j)`. +Use the selected rounded/rectangular/angled shape. Ignore box cut-out masks for +this boundary; they must not introduce steps around nested capability boxes. +A triple overlap has no internal pairwise seams; disjoint components have +separate closed contours. Point/edge contact with zero area is not a region. +This is a geometric diagnostic, not proof of equivalent functions, unnecessary +duplication, measured adequacy or a recommendation to retire a system. + +### 16.2 State on a date + +Keep selected model-validity date, evidence/snapshot date, source revision and +observed-versus-planned intent distinct. Resolve capability/parent lifetimes and +current/target maturity from the canonical lifecycle, relation and sidecar +contracts; do not replace them with a renderer's date conventions. A target +state is planned composition, never an observed outcome because its date passed. + +A renderer using full snapshot inputs must identify them as projections and +preserve source revision and evidence date. Dated snapshot windows must have +explicit boundaries; overlapping alternatives require separate scenario +selection. Gaps mean unknown/no supplied state and must not retain a stale map +for export. Missing history cannot be reconstructed by interpolation or copying +current support into a future target. If a source has no dated coverage history, +disclose snapshot-based coverage instead of asserting historical accuracy. + +The standalone HTML adapter uses exclusive snapshot-period ends and inclusive +record lifetime ends. An adapter MUST state and test its conversion from the +source contract; no universal reinterpretation of canonical `valid_to` is made. +Future targets, snapshot projections and date gaps must remain visible in the +rendered context. A descriptive horizon is never parsed into a calendar date. + +### 16.3 view_config defaults + +These keys are declared by this notation under the shared view-config contract. +They contain presentation choices only; all stages, tags, mappings and dated +assessments stay in source elements/relations/sidecars. + +```yaml +view_config: + valid_at: null # use capability_map.assessment_date + scenario: null # optional explicit TARGET_STATE reference; null is no target selection + management_cycle: + group: false + order: [Strategic, Learning, Planning, Execution, Assurance] + tags: + filter: [] # all tags; nonempty values select direct matches (OR) + show: true + display: + depth: 3 # 1, 2 or 3 + backlog: false + maturity: false + legend: true + systems: + highlight: null # optional APPLICATION reference + labels: false + coverage: false + selected: [] # explicit APPLICATION references; empty means no polygons + shape: angled # angled or rectangular + rounded: false + overlap: false # effective only with coverage and two selected systems +``` + +Stage order is fixed to §6a. Tag filters retain direct matches and the muted +parent/domain/lane context required to read them; context does not inherit tags. +Grouping creates only occupied stage zones behind elements, plus missing-value +diagnostics. It must preserve L1/L2/L3 containment and explicit H/V intersections. +Visibility of a layer never depends on the existence of an H capability. + +The maturity legend uses samples matching actual rendered box styles and the +canonical 1–5 scale in CONTRACT §9.4. A legacy adapter may additionally show an +explicit 0 No capability absence diagnostic, clearly distinguished from the +canonical scale; missing maturity is not 0. Hiding Maturity or Legend removes +that key and its reserved space. A general legend explains only enabled modes. +SVG exports the exact selected view, its legend and provenance. Zoom and hiding +controls affect the HTML viewport, not the model or native SVG coordinates. +Display filters are not access controls or redaction. + +### 16.4 Compatibility and implementation status + +The §6a/§16 additions and APPLICATION technical inventory are a core-methodology +correction prepared for review, not an optional extension profile. Existing +architectural layer, common tags, lifecycle and maturity contracts are retained. +No new globally addressable technical-capability TYPE is introduced. + +The standalone renderer currently consumes adapter JSON, not canonical YAML. +It maps management_cycle_stage to its legacy JSON layer field. Its HTML pilot +selection and direct-SVG backlog/all-system defaults must be overridden when +projecting the canonical defaults above. Its bounded ESG/MDM/Support tag menu +is a subset of the common free-form tags, which must remain in the source. + +The machine-readable [additive field schema](../../schemas/capability-map-contract.schema.json) +exposes `capabilityFields`, `applicationFields` and `viewConfig` definitions; +it does not replace the full element/view envelope. `tools/lint.py` implements +these structural checks without a new runtime dependency, application-local key +uniqueness, technical mapping references/lifetimes and view selection references. +It checks canonical elements and native files under `views/`, preserving the +single-file onboarding installation. It does not resolve assessments/history, +render coverage geometry or prove evidence truth. Existing direct APPLICATION +mapping checks remain the consuming validator's responsibility; the new +technical inventory cannot use that legacy boundary to skip its own references. + +Released CLI, DSM and Studio adoption and a methodology release must still be +verified separately before claiming product support. The [compatibility check](../../../guides/capability-map-compatibility.md) records +which fields the released CLI actually checks; acceptance with skipped checks +is not evidence of adoption. Until that adoption, a +consumer must report unsupported fields/settings rather than silently dropping +them. Existing `extensions.management_cycle_stage` proposals migrate explicitly +to the defined field; conflicting values require reconciliation, and history is +preserved. Core view keys are no longer to be documented as arbitrary extension +keys. The methodology version pin changes only through the release procedure. + +--- diff --git a/notations/views/diagrams/10-applications.md b/notations/views/diagrams/10-applications.md index 73ba801b..4e183323 100644 --- a/notations/views/diagrams/10-applications.md +++ b/notations/views/diagrams/10-applications.md @@ -1,8 +1,8 @@ --- notation: "Applications Catalogue" -version: "0.2" +version: "0.3" author: "Valerii Korobeinikov" -last_updated: "2026-09-26" +last_updated: "2026-10-23" status: "draft" file_extension: "*.applications.transitrix.yaml" --- @@ -152,6 +152,7 @@ applications_catalogue: | `applications[].maturity` | No | CMM level ([CONTRACT.md](../../CONTRACT.md) §9.4 shared CMMI V2.0 scale). **Time-varying** — sidecar, not inline. | | `applications[].description` | No | Short description of the application's purpose. | | `applications[].capabilities` | No | List of capability IDs this application enables. Stays inline in v1 (relations are Wave 3 territory). | +| `applications[].technical_capabilities` | No | Application-owned technical inventory with explicit business-capability mappings (§6a). Canonical by containment; not an extensions entry or a new global TYPE. | | `applications[].products` | No | List of Product element IDs this application supports. Stays inline in v1 (relations are Wave 3 territory). | | `applications[].integrations` | No | List of outbound integration descriptors. Stays inline (a relation list scoped to the parent application). | | `integrations[].target` | No | Target application element ID | @@ -253,6 +254,67 @@ ArchiMate → formal model of application layer elements and rel --- +## 6a. Technical capabilities and business coverage + +An APPLICATION MAY contain `technical_capabilities`, the named technical +abilities it supplies to support business capabilities. The inventory belongs +on the canonical application element. Its evidence and admission are owned by +the application, not authored only inside a capability-map view. + +Each entry is canonical by containment, with an application-local identity. +It is not a new standalone TYPE or REL kind and must not masquerade as an +independently admitted global element. Identify an entry in its owning application projection by application ID +and local key together. This does not grant independent cross-model reference +semantics or bypass the common promotion rule. Separate technical systems do not share a local key's +identity, even if the text matches. + +| Entry field | Required | Meaning | +| --- | --- | --- | +| `key` | yes | Nonempty string unique within the application | +| `name` | yes | Source-evidenced technical ability | +| `capabilities` | no | Distinct canonical business CAPABILITY references; default empty means not specified | +| `valid_from`, `valid_to` | no | Optional explicit lifetime using the shared primitive lifecycle boundary semantics; omitted bounds are open within the owning application's lifecycle | + +```yaml +# Fragment of an APPLICATION element; common envelope omitted. +id: APPLICATION-CRM-1 +capabilities: [CAPABILITY-V2] +technical_capabilities: + - key: customer-data-validation + name: Customer data validation + capabilities: [CAPABILITY-H1.2.1] + valid_from: "2026-10-01" + valid_to: null +``` + +Direct application mappings and technical-entry mappings retain their separate +provenance. Their union is the application's business target set for a coverage +view; no parent/child inheritance is implied. All references must resolve before +view filtering. Duplicate keys, duplicate targets, missing required names/keys +and unknown targets are invalid. Missing inventory or an empty mapping does not +prove absent technical ability or unsupported business capability. + +An entry's effective lifetime is the intersection of its open/explicit bounds +and the application's lifecycle. Explicit bounds outside the owner lifetime or +an end before its start are invalid; a missing bound does not require inventing +an earlier history. + +A dated coverage view includes only explicitly active applications and inventory +entries. It does not recover mapping histories from today's lists. Source +snapshot/scenario intent and missing history must be disclosed as required by +[capability-map §16](05-capability-map.md#16-system-coverage-dated-views-and-presentation-defaults). +Changes to existing direct-list history remain subject to the existing relation +migration contract; this field does not silently create a new temporal REL kind. +The standalone JSON renderer maps each local key to technical entry `id`; source +`valid_from`/`valid_to` require an explicit endpoint conversion to its inclusive +`start_date`/`end_date`. The defined source field is not an `extensions` field. + +The additive schema and whole-model reference checks ship with the methodology +([capability-map §16.4](05-capability-map.md#164-compatibility-and-implementation-status)). +Released CLI/DSM/Studio adoption must still be verified independently. + +--- + ## 7. References - Application elements: `elements/03_application/*.yaml` diff --git a/notations/views/reports/requirement-subject-scope.md b/notations/views/reports/requirement-subject-scope.md new file mode 100644 index 00000000..22405117 --- /dev/null +++ b/notations/views/reports/requirement-subject-scope.md @@ -0,0 +1,156 @@ +--- +title: "PRODUCT and APPLICATION requirements scope" +version: "0.3" +last_updated: "2026-10-02" +status: "accepted" +--- + +# PRODUCT and APPLICATION requirements scope + +**Accepted consumer contract: `requirement-chain/0.3`.** This document defines +application scope without manufacturing a PRODUCT. It extends +[requirement-chain/0.2](requirement-chain.md), whose contract and +[worked oracle](../../examples/requirement-chain/README.md) remain unchanged. +The [subject cases](../../examples/requirement-subject-scope/README.md) specify +the exact expected IDs for this contract. Contract acceptance does not establish +support in a tool version: author the added kinds and values only when the pinned +methodology vocabulary, schema and consumer versions declare support. + +## Compatibility and accepted extensions + +The source baseline is Methodology commit +`f2f1cfba08b1377ae5c770a56e92aba702afdcdb`. The retained requirement-chain/0.2 +contract and oracle originate at `97c9d41819011ead8fe192c266cba32707eae82f`. +Source support, projection implementation, contract acceptance and publication +are separate claims. + +| Concern | Source contract at the baseline | Accepted extension / support boundary | +|---|---|---| +| Subject identity | [Primitives §§7.6–7.7](../../ELEMENT_PRIMITIVES.md) define distinct PRODUCT and APPLICATION. Neither has an internal/external usage discriminator. | Select either TYPE explicitly. Internal use, sale and software/physical form do not choose the subject TYPE. No usage field is needed. | +| Physical product | PRODUCT `type` is required: `digital_product`, `service`, `platform`, `bundle`; [Products §5](../diagrams/09-products.md) repeats it. | A standalone physical product has no general type value. P3 below supplies the additive value; do not disguise it as software or a bundle. | +| Release ownership | Primitives §7.29 already admits PRODUCT or APPLICATION in `RELEASE.of`; predecessor must have the same owner. | No endpoint widening needed. Validate exact owner identity, not merely TYPE. | +| Requirement membership | [Relations §3](../../elements/17-relations.md) admits `product_scope`: REQUIREMENT → PRODUCT. `required_for` points to RELEASE. | Independent application membership is missing. P1 adds `application_scope`: REQUIREMENT → APPLICATION. Never infer membership from release assignment. | +| Project selection | `project_scope`: REQUIREMENT → ACTION(Project); `project_product`: ACTION(Project) → PRODUCT. | Keep `project_scope`; P2 adds `project_application`: ACTION(Project) → APPLICATION. No inferred project from implementation links. | +| Product/application connection | PRODUCT `supporting_apps` and APPLICATION `products` describe support. | Context only; neither conveys requirement membership, assignment nor verification. | +| Trace graph and metrics | requirement-chain/0.2 §§5–7 define trace direction, direct verification and six metrics. | Reuse unchanged, substituting explicit subject membership for product membership. Cross-subject trace context never changes counts. | +| Obligation inheritance | Relations §3.2 and [reference query](../../../scripts/release-obligations.mjs) retain active requirements and nearest predecessor attachment. | Same-owner validation and completeness must surround the query; its scalar loader and cycle-safe walk are not a complete report validator. | +| Validation | [Contract §8](../../CONTRACT.md) specifies RELEASE-001–005 and REL endpoint/window rules; requirement-chain/0.2 §9 adds consumer obligations. | Tables are not proof of runtime support. New kinds require coordinated vocabulary, schema, endpoint validation and consumer capability changes before a consumer declares support. | + +The accepted extensions are: + +- **P1:** add only `application_scope`, REQUIREMENT → APPLICATION, using the + ordinary admitted REL envelope, one endpoint pair per record, inclusive window, + M:N membership and existing endpoint/lifecycle validation. Preserve + `product_scope` without widening its endpoints or migrating existing records. +- **P2:** add only `project_application`, ACTION with `type: Project` → APPLICATION, + on the same REL machinery. Keep PRODUCT pairing unchanged. A pair admits a + selection; it does not confer requirement membership on either endpoint. +- **P3:** add `physical_product` to the PRODUCT `type` vocabulary in the primitive, + product view and corresponding consumer schemas. It classifies a product form, + not its audience. This is an additive value; it introduces no new physical TYPE + or internal/external enum. +- **P4:** version the expanded consumer interface as `requirement-chain/0.3`. + Accept an explicit `{subject: {id, type}, release, project?, + as_at, catalogue_boundary, snapshot}`. Preserve 0.2 product calls through an + explicit adapter and reject conflicting product/subject selectors. Do not + silently advertise 0.3 from a picker change or unknown-field tolerance. + +These choices minimize changes to existing product consumers. Generalizing +`product_scope` to accept APPLICATION would contradict its published endpoint +and require a different compatibility contract. + +## Population contract + +Let `P` be the selected subject's active requirements with an active valid explicit +membership: `product_scope` for PRODUCT, `application_scope` for +APPLICATION. Keep the existing `P` output name for compatibility; label it +**subject population**. A requirement may explicitly belong to both subjects, +but the subjects remain distinct. Missing, malformed or unreadable membership +is unresolved, not evidence of exclusion, assignment, or a zero population. +Expose the catalogue's unresolved membership IDs separately; absent membership +cannot tell which subject they would belong to. + +Validate release `of == subject.id` before calculating release totals. Follow +only same-owner predecessors; stop on wrong-owner, dangling, malformed or cyclic +links with an incomplete-scope diagnostic. Never use version sorting. The release +record's lifecycle is not an extra report-date filter. Apply requirement and +relation lifecycle windows inclusively, requiring valid dates; a malformed window +cannot become an unbounded active relation. + +`L = releaseObligations(selected release, as_at) ∩ P`. Deduplicate requirements, +retain every contributing attachment identity, select the nearest surviving +attachment, and use REL ID for same-depth display ties. Ending a newer attachment +does not cancel an active ancestor attachment. Predecessors carry obligations, +never execution results. + +With no project selected, `S = L`. With project `J`, validate the appropriate +explicit project/subject pair and use `S = L ∩ project_scope(J)`. Missing pairing +makes that filtered scope unavailable. Missing project membership exposes known +IDs with incomplete filtered totals. Never infer project membership from a parent, +an ACTION ancestor, product support, or implementation work. + +For every member of `P`, inspect all modelled releases owned by that subject, +including branches, at the same date: + +| Classification | Exact condition | +|---|---| +| Assigned here | Member of `L`, whether direct or inherited. | +| Other-release-only | Effective assignment to another same-owner release, absent from `L`. | +| Clean unassigned | No effective same-owner assignment, with complete data and no active invalid assignment. | +| Invalid assignment | Active malformed/dangling `required_for`, or target release owner belongs to none of the requirement's valid explicit subject memberships. Retain any valid assignments too; this flag can overlap assigned here. | +| Contextual assignment | Assignment to a different explicitly declared subject; does not assign this subject's release. | +| Unresolved membership | Insufficient membership/catalogue data; retain known IDs and diagnostics, total unknown. | + +Retired and future requirements are outside active populations. Expired invalid +relations remain history rather than active assignment blockers. Missing input, +missing selection, wrong TYPE, invalid ownership and a proven empty set are +separate states. Known empty IDs under incomplete data have `total: null`, not 0. + +## Trace and evidence contract + +Use exactly the trace kinds and independent upstream/downstream walks from 0.2 +§5. A cross-subject requirement reached by an explicit source/decomposition edge +may appear as labelled context. Do not walk sideways through a shared ancestor. +Membership, supporting applications, release assignment, `depends_on`, project +pairing and assembly links do not expand trace traversal or add members to `S`. +The unfocused graph includes only necessary upstream context and direct +verification records, not every requirement of a related subject. + +Definitions attach directly to their `verifies` requirement. Execution requires +`verified_on` equal to the selected release, a valid definition and active valid +execution fields under 0.2 §6. Other-release and unqualified evidence remain +context. A child pass never covers its parent; no predecessor, product/application +support link or shared protocol text transfers a result. Active pass and fail +coexist; inconclusive is executed, and `not_yet_run` is not. Preserve malformed, +historical and future execution findings and their source navigation. + +## Six metrics and consumer result + +Let `V(r)` and `E(r)` retain the 0.2 definitions. No Phase 2 metric or overall +quality score is added. Each metric is a distinct requirement-ID set: + +| Metric | Population and predicate | +|---|---| +| Broken references | `r ∈ S`, with a defective reference attributed under 0.2 §7; retain reference-slot and unattributable inventories separately. | +| No accepted source path | `r ∈ S`, no valid upstream path to NEED, DRIVER, permitted codex or descriptor-bearing Field document. | +| No valid verification definition | `r ∈ S`, `V(r)` empty. | +| Verification without applicable executed result | `r ∈ S`, `V(r)` nonempty and `E(r)` empty. | +| Applicable failed verification | `r ∈ S`, at least one fail in `E(r)`. | +| No effective release assignment | Clean unassigned subset of whole `P`, across all same-owner releases, independent of project filter. | + +The result retains scope and immutable source provenance, sorted distinct +`P/L/S`, assignment/stage/metric IDs, all contributing edges and attachment +identities, context reasons, and attributable/unattributable diagnostics. Each +set carries completeness and a nullable total. Broken population inputs do not +fabricate complete metric totals. A valid empty population can have six zero +counts; an unavailable population cannot. + +Both reports, exports and a supported headless interface must consume one +projection. Focus, full/adjacent-pair mode, scrolling and navigation operate on +that graph and never recalculate populations. Cache keys include explicit subject +TYPE/ID, release, optional project, date, catalogue and content provenance. Refresh +publishes one new projection atomically; failed reads retain an explicitly stale +snapshot or unavailable state. Consumer support requires exact contract/oracle +revision binding and automated positive/negative evidence against all four subject +cases and their independent controls. A consumer must declare its supported +contract version separately from the version of this document. diff --git a/notations/vocabulary.yaml b/notations/vocabulary.yaml index 06e20f1e..10f2220a 100644 --- a/notations/vocabulary.yaml +++ b/notations/vocabulary.yaml @@ -317,6 +317,11 @@ relation_types: from_subtype: [business_unit] to: [ACTOR] to_subtype: [business_unit] + reports_to: + from: [ACTOR] + from_subtype: [person] + to: [ACTOR] + to_subtype: [person] employment: from: [ACTOR] from_subtype: [person] @@ -446,6 +451,11 @@ deprecated_rule_codes: # --------------------------------------------------------------------------- value_vocabularies: + CAPABILITY.management_cycle_stage: + values: [Strategic, Learning, Planning, Execution, Assurance] + spec: notations/views/diagrams/05-capability-map.md + rule: null + # REQUIREMENT — elements/15-requirement.md REQUIREMENT.origin: values: [legislative, process-product, project-product] @@ -1391,6 +1401,15 @@ rule_codes: REL-010: severity: warning spec: notations/elements/17-relations.md + REL-011: + severity: error + spec: notations/elements/17-relations.md + REL-012: + severity: error + spec: notations/elements/17-relations.md + REL-013: + severity: warning + spec: notations/elements/17-relations.md REQ-PARENT-001: severity: error spec: notations/elements/15-requirement.md diff --git a/packages/document-renderer/README.md b/packages/document-renderer/README.md index d1b95a80..a1a9c66a 100644 --- a/packages/document-renderer/README.md +++ b/packages/document-renderer/README.md @@ -497,7 +497,8 @@ The package has two PDF rendering paths: - Running footers (issuer, date, identity, page number) - Landscape pages for wide diagrams - Page breaks and typography rules -- First-page suppression (no footer on title page) +- Every-page identity for issued documents, including the first portrait or landscape page +- First-page suppression retained for non-issued content (no `issued_at`) **Usage:** @@ -514,6 +515,24 @@ const html = wrapHtmlForPrintRendering('

Title

Content...

', { // Pass html to Vivliostyle or another CSS Paged Media renderer ``` +Supplying `issued_at` selects the issued-document footer behavior; a one-page +issued document receives the same issuer, issue date, identity, optional commit +and page counters as subsequent pages. Callers supply the existing identity +fields; this helper does not create or validate an issue identity. + +Issue dates (`issued_at`) and snapshot caption dates (`generated_at`) use the +`en-US` locale and **UTC**, independent of the host timezone. Supply ISO 8601 +timestamps with `Z` or an explicit numeric offset (or a date-only `YYYY-MM-DD`); +timezone-less date-time strings are not stable inputs across hosts. +Snapshot captions use only captured-at `generated_at`, never valid-at +`renderDate`, the issue date, or the wall clock. `renderDate` remains the separate +pass-1 input that selects model validity. Missing snapshot dates leave captions +unchanged; invalid dates produce `Unknown date`. Callers remain responsible for +snapshot binding before issuing a document. + +These helpers prepare HTML/CSS; their tests do not establish footer visibility, +landscape geometry, diagram embedding or reproducibility in a final PDF. + **Specification:** [`PDF_RENDERING_ENGINE.md`](./PDF_RENDERING_ENGINE.md) **Engine reference:** Vivliostyle (option 2), caller-supplied supported (option 3) **Feature matrix:** Named pages, landscape pages, break rules, running elements, counters diff --git a/packages/document-renderer/src/render-vivliostyle.mjs b/packages/document-renderer/src/render-vivliostyle.mjs index faa0fc56..29282036 100644 --- a/packages/document-renderer/src/render-vivliostyle.mjs +++ b/packages/document-renderer/src/render-vivliostyle.mjs @@ -31,7 +31,8 @@ function escapeHtml(text) { * * @param {object} metadata - Document metadata * @param {string} metadata.issuer - Who created the document - * @param {string} metadata.issued_at - ISO 8601 timestamp + * @param {string} metadata.issued_at - Issue timestamp with explicit offset; formatted in UTC. + * When present, retains the footer on every page, including the first. * @param {string} metadata.document_identity - Recipe ID or document identifier * @param {string} [metadata.repository_commit] - Git commit hash * @param {array} [metadata.views] - View specifications with width/height @@ -52,6 +53,7 @@ export function generatePagedMediaCss(metadata = {}) { year: 'numeric', month: 'short', day: 'numeric', + timeZone: 'UTC', }); } catch { // ignore invalid date @@ -98,11 +100,11 @@ export function generatePagedMediaCss(metadata = {}) { } } -@page :first { +${metadata.issued_at ? '' : `@page :first { @bottom-center { content: ""; } -} +}`} @page :left { margin-right: 20mm; @@ -238,7 +240,8 @@ ${wideViewsCss} /** * Format figure captions to include snapshot build dates. * Finds all
elements with data-snapshot-id attributes and appends - * the snapshot's generated_at timestamp to the caption. + * the snapshot's captured-at generated_at timestamp to the caption, formatted in UTC. + * Supply timestamps with explicit offsets; renderDate (valid-at) is not a fallback. * * @param {string} html - HTML content with figure elements * @param {object} snapshots - Map of snapshot IDs to snapshot objects with generated_at @@ -265,6 +268,7 @@ export function formatFigureCaptions(html, snapshots = {}) { year: 'numeric', month: 'short', day: 'numeric', + timeZone: 'UTC', }); } } catch { diff --git a/packages/document-renderer/tests/test_paged_media_css.mjs b/packages/document-renderer/tests/test_paged_media_css.mjs index 8854075e..0c0b572d 100644 --- a/packages/document-renderer/tests/test_paged_media_css.mjs +++ b/packages/document-renderer/tests/test_paged_media_css.mjs @@ -61,11 +61,47 @@ function check(condition, message) { check(!hasUnescapedAmpersand, 'No unescaped ampersands in content string'); } -// Test 5: First page omits footer +// Test 5: Issued identity survives on every page, including a one-page document. { + const metadata = { + issuer: 'Test Corp', + issued_at: '2026-09-02T00:30:00Z', + document_identity: 'SPEC-v2.0', + repository_commit: 'a1b2c3d4e5f6', + }; + for (const content of ['

One page

', '
Wide view
']) { + const html = wrapHtmlForPrintRendering(content, metadata); + const css = html.match(/'+''.join(zones)+''.join(out)+overlay+'' + try:ET.fromstring(svg) + except ET.ParseError as error:raise ValueError(f'Model text cannot be represented as SVG XML: {error}') from error + return svg + +LEGEND_LABELS={ + 'layers':'Bands: management-cycle stages', + 'context':'Muted boxes: parent/domain context', + 'labels':'System labels: direct mappings only', + 'outline':'Outline: direct mapping to ', + 'coverage':'Coverage: ', + 'shared':'Overlap: explicit shared mappings; area is not a percentage', + 'functional_overlap':'Red contour: intersection of 2+ system coverage polygons', + 'maturity':'Maturity:' +} + +MATURITY_LEGEND=[{'level':i,'name':name,'description':description} for i,(name,description) in enumerate(zip(LEVELS,[ + 'Capability absent','Ad hoc, unpredictable','Planned and tracked','Standardized practices','Measured and controlled','Continuous improvement']))] + + +def add_maturity_legend(group,width,y): + import math,xml.etree.ElementTree as ET + ns='{'+SVGNS+'}';tilewidth=min(216,width-48);columns=max(1,int((width-48+12)//(tilewidth+12))) + header=ET.SubElement(group,ns+'text',{'x':'24.0','y':f'{y+10:.1f}','font-size':'12','fill':'#475569','text-anchor':'start'}) + header.text=LEGEND_LABELS['maturity'] + for i,item in enumerate(MATURITY_LEGEND): + x=24+(i%columns)*(tilewidth+12);top=y+22+(i//columns)*52 + tile=ET.SubElement(group,ns+'g',{'class':'maturity-legend-item','data-maturity-level':str(item['level'])}) + ET.SubElement(tile,ns+'rect',{'class':f'maturity-legend-swatch caprect m{item["level"]}','x':f'{x:.1f}','y':f'{top:.1f}','width':'36','height':'26','rx':'6','fill':'#c9d5f2','stroke':'#c9d5f2','stroke-width':'3'}) + for text,tx,ty,size,fill,anchor in [(str(item['level']),x+18,top+17,'11','#0f172a','middle'),(item['name'],x+48,top+9,'11','#334155','start'),(item['description'],x+48,top+25,'10','#64748b','start')]: + ET.SubElement(tile,ns+'text',{'x':f'{tx:.1f}','y':f'{ty:.1f}','font-size':size,'fill':fill,'text-anchor':anchor}).text=text + return y+22+math.ceil(len(MATURITY_LEGEND)/columns)*52+6 + + +def update_legend(root,state,selection): + import xml.etree.ElementTree as ET + import textwrap + ns='{'+SVGNS+'}';group=root.find(ns+"g[@class='legend']") + if group is None:return + group.clear();group.set('class','legend') + bottom=float(root.get('data-content-bottom'));width=float(root.get('width')) + maturity_key=False + items=[];visible=[g for g in root.iter(ns+'g') if g.get('data-id') is not None and int(g.get('data-depth','1'))<=selection['depth']] + apps={str(a['id']):a for a in state['applications']} + if selection['legend'] and visible: + if selection['sort_layers'] and root.findall(ns+"rect[@class='layer-zone']"):items.append((LEGEND_LABELS['layers'],None)) + if selection['tag_filter'] and any(g.get('data-tag-match')=='context' for g in visible):items.append((LEGEND_LABELS['context'],None)) + if selection['system_labels'] and any(g.find(ns+"text[@class='system-label']") is not None for g in visible):items.append((LEGEND_LABELS['labels'],None)) + if selection['system_id'] and any(g.get('data-support')=='supported' for g in visible):items.append((LEGEND_LABELS['outline']+apps[selection['system_id']]['name'],'#00a6a6')) + active=[g for g in root.findall(ns+"g[@class='coverage-overlay']") if g.get('data-coverage-visible')=='yes'] + colors=json.loads(root.find(ns+'metadata').text)['coverage_colors'] + for overlay in active: + aid=overlay.get('data-coverage-system');items.append((LEGEND_LABELS['coverage']+apps[aid]['name'],colors[aid])) + if active:items.append((LEGEND_LABELS['shared'],None)) + if root.find(ns+"g[@class='functional-overlap']") is not None:items.append((LEGEND_LABELS['functional_overlap'],'#dc2626')) + if selection['maturity'] and any(g.find(ns+"text[@class='maturity-label']") is not None for g in visible):maturity_key=True + x=24.;baseline=bottom+18;rowheight=14. + for label,color in items: + label=' '.join(label.split()) + prefix=16 if color else 0 + lines=textwrap.wrap(label,width=max(4,int((width-48-prefix)/(11*.62))),break_long_words=True,break_on_hyphens=False) + itemwidth=max(len(line) for line in lines)*11*.62+prefix + if x>24 and x+itemwidth>width-24:x=24.;baseline+=rowheight+6;rowheight=14. + if color:ET.SubElement(group,ns+'rect',{'x':f'{x:.1f}','y':f'{baseline-9:.1f}','width':'10','height':'10','rx':'2','fill':color}) + node=ET.SubElement(group,ns+'text',{'x':f'{x+prefix:.1f}','y':f'{baseline:.1f}','font-size':'11','fill':'#475569','text-anchor':'start'}) + for i,line in enumerate(lines):ET.SubElement(node,ns+'tspan',{'x':f'{x+prefix:.1f}','dy':'14' if i else '0'}).text=line + rowheight=max(rowheight,14*len(lines));x+=itemwidth+18 + height=baseline+rowheight+6 if items else bottom+20 + if maturity_key:height=add_maturity_legend(group,width,baseline+rowheight+14 if items else bottom+12) + group.set('style','display:inline' if items or maturity_key else 'display:none') + root.set('height',f'{height:g}');root.set('viewBox',f'0 0 {width:g} {height:g}') + + +def coverage_shape_points(hull,shape='angled',rounded=False): + """Choose an enclosing rectangle or the original hull; round convex corners inward.""" + import math + if shape not in ('angled','rectangular'):raise ValueError('Unknown coverage shape') + points=list(hull) + if shape=='rectangular': + xmin=min(x for x,y in points);xmax=max(x for x,y in points);ymin=min(y for x,y in points);ymax=max(y for x,y in points) + points=[(xmin,ymin),(xmax,ymin),(xmax,ymax),(xmin,ymax)] + if not rounded:return points + result=[] + for i,corner in enumerate(points): + previous=points[i-1];following=points[(i+1)%len(points)] + before=math.hypot(previous[0]-corner[0],previous[1]-corner[1]);after=math.hypot(following[0]-corner[0],following[1]-corner[1]) + radius=min(10,before/2,after/2) + start=tuple(corner[k]+(previous[k]-corner[k])*radius/before for k in (0,1)) + end=tuple(corner[k]+(following[k]-corner[k])*radius/after for k in (0,1)) + for step in range(9): + t=step/8 + result.append(tuple(math.floor(((1-t)**2*start[k]+2*(1-t)*t*corner[k]+t*t*end[k])*10000+.5)/10000 for k in (0,1))) + return result + + +def apply_coverage_shape(root,shape='angled',rounded=False): + ns='{'+SVGNS+'}' + if shape not in ('angled','rectangular'):raise ValueError('Unknown coverage shape') + for group in root.findall(ns+"g[@class='coverage-overlay']"): + polygon=group.find(ns+"polygon[@class='coverage-polygon']") + original=polygon.get('data-coverage-hull',polygon.get('points')) + hull=[tuple(map(float,p.split(','))) for p in original.split()] + points=' '.join(f'{x:.4f},{y:.4f}' for x,y in coverage_shape_points(hull,shape,rounded)) + polygon.set('points',points) + group.find(ns+'defs/'+ns+'mask/'+ns+'polygon').set('points',points) + root.set('data-coverage-shape',shape);root.set('data-coverage-rounded','yes' if rounded else 'no') + + +def polygon_intersection(subject,clip): + """Intersect convex coverage hulls; touching edges have no area.""" + def cross(a,b,p):return (b[0]-a[0])*(p[1]-a[1])-(b[1]-a[1])*(p[0]-a[0]) + output=list(subject) + for a,b in zip(clip,clip[1:]+clip[:1]): + source=output;output=[] + if not source:break + previous=source[-1];dp=cross(a,b,previous) + for current in source: + dc=cross(a,b,current) + if (dc>=-1e-8)!=(dp>=-1e-8): + t=dp/(dp-dc);output.append((previous[0]+t*(current[0]-previous[0]),previous[1]+t*(current[1]-previous[1]))) + if dc>=-1e-8:output.append(current) + previous=current;dp=dc + area=abs(sum(a[0]*b[1]-b[0]*a[1] for a,b in zip(output,output[1:]+output[:1])))/2 + return output if area>1e-6 else [] + + +def update_functional_overlap(root,state,enabled): + """Outline the union of pairwise outer-hull intersections, independent of box cut-outs.""" + import xml.etree.ElementTree as ET + ns='{'+SVGNS+'}' + for old in root.findall(ns+"g[@class='functional-overlap']"):root.remove(old) + if not enabled:return [] + active=root.findall(ns+"g[@class='coverage-overlay'][@data-coverage-visible='yes']") + regions=[] + for i,left in enumerate(active): + for right in active[i+1:]: + polygons=[g.find(ns+"polygon[@class='coverage-polygon']") for g in (left,right)] + points=[[tuple(map(float,p.split(','))) for p in poly.get('points').split()] for poly in polygons] + intersection=polygon_intersection(*points) + if intersection:regions.append((sorted([left.get('data-coverage-system'),right.get('data-coverage-system')]),intersection)) + if not regions:return [] + group=ET.SubElement(root,ns+'g',{'class':'functional-overlap','pointer-events':'none'}) + defs=ET.SubElement(group,ns+'defs') + attrs={'id':'functional-overlap-edge','filterUnits':'userSpaceOnUse','x':'0','y':'0','width':root.get('width'),'height':root.get('data-content-bottom'),'color-interpolation-filters':'sRGB'} + edge=ET.SubElement(defs,ns+'filter',attrs) + for tag,attrs in [('feMorphology',{'in':'SourceAlpha','operator':'dilate','radius':'1.5','result':'outer'}),('feMorphology',{'in':'SourceAlpha','operator':'erode','radius':'1.5','result':'inner'}),('feComposite',{'in':'outer','in2':'inner','operator':'out','result':'edge'}),('feFlood',{'flood-color':'#dc2626','result':'red'}),('feComposite',{'in':'red','in2':'edge','operator':'in'})]:ET.SubElement(edge,ns+tag,attrs) + boundary=ET.SubElement(group,ns+'g',{'class':'functional-overlap-outline','filter':'url(#functional-overlap-edge)'}) + pairs=[] + for ids,points in regions: + pair=ET.SubElement(boundary,ns+'g',{'class':'functional-overlap-region','data-overlap-systems':json.dumps(ids,ensure_ascii=False,separators=(',',':'))}) + ET.SubElement(pair,ns+'polygon',{'points':' '.join(f'{x:.4f},{y:.4f}' for x,y in points),'fill':'white'}) + pairs.append(ids) + return pairs + + +def apply_view(svg,state,system='',depth=3,labels=False,show_maturity=False,legend=True,coverage=False,coverage_systems=None,functional_overlap=False,coverage_shape='angled',round_coverage=False): + import xml.etree.ElementTree as ET + ET.register_namespace('',SVGNS);root=ET.fromstring(svg) + apply_coverage_shape(root,coverage_shape,round_coverage) + apps={str(a['id']):a for a in state['applications']} + if system and system not in apps:raise ValueError('Selected system is not in selected state') + if depth not in (1,2,3):raise ValueError('Depth must be 1, 2 or 3') + root.attrib.update({'data-max-depth':str(depth),'data-system-labels':'on' if labels else 'off','data-maturity':'on' if show_maturity else 'off','data-legend':'on' if legend else 'off','data-system-selected':'yes' if system else 'no'}) + pilot=json.loads(root.find('{'+SVGNS+'}metadata').text).get('coverage_system_id') + if coverage_systems is not None: + if not isinstance(coverage_systems,(list,tuple)) or any(not isinstance(a,str) for a in coverage_systems):raise ValueError('coverage_systems must be a list of system IDs') + if len(set(coverage_systems))!=len(coverage_systems):raise ValueError('Duplicate selected coverage system') + if set(coverage_systems)-apps.keys():raise ValueError('Selected coverage system is not in selected state') + selected=sorted(coverage_systems if coverage_systems is not None else ([pilot] if pilot in apps else [] if pilot else apps)) if coverage else [] + for group in root.findall("{*}g[@class='coverage-overlay']"): + visible=group.get('data-coverage-system') in selected and int(group.get('data-coverage-depth'))==depth + group.set('data-coverage-visible','yes' if visible else 'no') + group.set('style','display:inline' if visible else 'display:none') + for g in root.iter('{'+SVGNS+'}g'): + if 'data-id' in g.attrib:g.set('data-support','supported' if system and system in json.loads(g.get('data-applications','[]')) else 'not-specified') + overlaps_enabled=bool(functional_overlap and coverage and len(selected)>=2) + overlaps=update_functional_overlap(root,state,overlaps_enabled) + selection={'coverage_shape':coverage_shape,'round_coverage':bool(round_coverage),'functional_overlap':overlaps_enabled,'functional_overlap_system_pairs':overlaps,'view_date':json.loads(root.find('{'+SVGNS+'}metadata').text).get('view_date'),'system_id':system or None,'depth':depth,'system_labels':labels,'maturity':show_maturity,'legend':legend,'sort_layers':json.loads(root.find('{'+SVGNS+'}metadata').text)['layout_mode']=='layers','show_backlog':json.loads(root.find('{'+SVGNS+'}metadata').text)['show_backlog'],'tag_filter':json.loads(root.find('{'+SVGNS+'}metadata').text)['tag_filter'],'coverage':bool(coverage),'coverage_system_id':selected[0] if len(selected)==1 else None,'coverage_system_ids':selected} + meta=root.find('{'+SVGNS+'}metadata');md=json.loads(meta.text);md['view']=selection;meta.text=json.dumps(md,ensure_ascii=False) + update_legend(root,state,selection) + textnode=next(e for e in root.iter('{'+SVGNS+'}text') if e.get('class')=='view-selection') + caption=f'Layout: {"Layers" if selection["sort_layers"] else "Classic"} · Backlog: {"on" if selection["show_backlog"] else "off"} · Tag: {selection["tag_filter"] or "All"} · System: {apps[system]["name"] if system else "All"} · Depth: {depth} · System labels: {"on" if labels else "off"} · Maturity: {"on" if show_maturity else "off"} · Legend: {"on" if legend else "off"} · Coverage: {", ".join(apps[a]["name"] for a in selected) if coverage and selected else "none" if coverage else "off"}' + import textwrap + for child in list(textnode):textnode.remove(child) + for i,line in enumerate(textwrap.wrap(caption,width=max(20,int((float(root.get('width'))-48)/7)),break_long_words=True)): + child=ET.SubElement(textnode,'{'+SVGNS+'}tspan',{'x':textnode.get('x'),'dy':'0' if i==0 else '14'});child.text=line + return ET.tostring(root,encoding='unicode') + +def prune_export(svg): + """Keep the selected visible content and reproducibility metadata, not hidden model detail.""" + import xml.etree.ElementTree as ET + ET.register_namespace('',SVGNS);root=ET.fromstring(svg) + depth=int(root.get('data-max-depth','3')) + hidden=set() + if root.get('data-system-labels')=='off':hidden.add('system-label') + if root.get('data-maturity')=='off':hidden.add('maturity-label') + if root.get('data-legend')=='off':hidden.add('legend') + def walk(parent): + for element in list(parent): + classes=set(element.get('class','').split()) + if element.get('data-coverage-visible')=='no' or (element.get('data-depth') and int(element.get('data-depth'))>depth) or classes & hidden or (element.tag=='{'+SVGNS+'}desc' and parent.get('data-id') is not None): + parent.remove(element);continue + element.attrib.pop('data-applications',None) + walk(element) + walk(root) + return ET.tostring(root,encoding='unicode') + +HTML_JS=r''' +const payload=JSON.parse(document.getElementById('model-data').textContent); +const stateInput=document.getElementById('state'),systemInput=document.getElementById('system'); +const coverageChoices=document.getElementById('coverage-systems'); +const allCoverage=new Map(payload.coverage_applications.map(a=>[String(a.id),a.name])); +Array.from(allCoverage).sort((a,b)=>a[0].localeCompare(b[0],'en')).forEach(([id,name])=>{const label=document.createElement('label'),input=document.createElement('input'),swatch=document.createElement('span'),title=document.createElement('span');input.type='checkbox';input.value=id;input.checked=payload.coverage_default_ids.includes(id);input.addEventListener('change',updateView);swatch.className='coverage-swatch';swatch.style.background=payload.coverage_colors[id];title.className='coverage-system-label';title.textContent=name;label.append(input,swatch,title);coverageChoices.append(label)}); +function selectedCoverage(){return Array.from(coverageChoices.querySelectorAll('input:checked:not(:disabled)')).map(i=>i.value).sort()} +const dateInput=document.getElementById('view-date'),dateStatus=document.getElementById('date-status'); +const timeSlider=document.getElementById('time-slider'),timeValue=document.getElementById('time-value'); +const dayNumber=value=>Math.floor(Date.parse(value+'T00:00:00Z')/86400000); +const dayDate=value=>new Date(Number(value)*86400000).toISOString().slice(0,10); +let timelineMin=payload.frames.length?dayNumber(payload.frames[0].frame_from):0; +const lastFrame=payload.frames[payload.frames.length-1]; +let timelineMax=lastFrame?(lastFrame.frame_to?dayNumber(lastFrame.frame_to)-1:Math.min(dayNumber('9999-12-31'),Math.max(dayNumber(lastFrame.frame_from),dayNumber(payload.initial_date||localToday()))+365)):0; +let pendingScrub=null,renderedState=null,renderedKey=''; +function syncSlider(){const when=dateInput.value;timeSlider.disabled=!payload.frames.length;if(!payload.frames.length){timeValue.textContent='No dated timeline';return}if(when){const day=dayNumber(when);timelineMin=Math.min(timelineMin,day);timelineMax=Math.max(timelineMax,day);timeSlider.min=String(timelineMin);timeSlider.max=String(timelineMax);timeSlider.value=String(day);timeSlider.setAttribute('aria-valuetext',when);timeValue.textContent=when}else{timeValue.textContent='Snapshot mode';timeSlider.setAttribute('aria-valuetext','Snapshot mode; move to select a date')}document.getElementById('time-first').textContent=dayDate(timelineMin);document.getElementById('time-last').textContent=dayDate(timelineMax)} +function scrubTime(){dateInput.value=dayDate(timeSlider.value);timeValue.textContent=dateInput.value;timeSlider.setAttribute('aria-valuetext',dateInput.value);if(pendingScrub===null)pendingScrub=requestAnimationFrame(()=>{pendingScrub=null;loadDate()})} +timeSlider.addEventListener('input',scrubTime);timeSlider.addEventListener('change',()=>{if(pendingScrub!==null){cancelAnimationFrame(pendingScrub);pendingScrub=null}dateInput.value=dayDate(timeSlider.value);loadDate()}); +payload.frames.forEach(frame=>{const tick=document.createElement('option');tick.value=String(dayNumber(frame.frame_from));tick.label=frame.frame_from;document.getElementById('time-events').append(tick)}); +function currentState(){const when=dateInput.value;return when?payload.frames.find(s=>s.frame_from<=when&&(!s.frame_to||whens.id===stateInput.value)} +function localToday(){const d=new Date();return `${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,'0')}-${String(d.getDate()).padStart(2,'0')}`} +function dateCaption(state){return `Date: ${dateInput.value} · Snapshot basis: ${state.snapshot_as_of||'not specified'} · ${state.kind==='target'?'Planned scenario; not an observed outcome':'Recorded snapshot basis; no implied daily observation'}`} +function wrapText(node,caption,svg){node.replaceChildren();const limit=Math.max(4,Math.floor((Number(svg.getAttribute('width'))-48)/(Number(node.getAttribute('font-size'))*.62)));const words=caption.split(/\s+/);let lines=[''];words.forEach(word=>{while(word.length>limit){if(lines[lines.length-1])lines.push('');lines[lines.length-1]=word.slice(0,limit);word=word.slice(limit);lines.push('')}if((lines[lines.length-1]+' '+word).trim().length>limit)lines.push(word);else lines[lines.length-1]=(lines[lines.length-1]+' '+word).trim()});lines.forEach((line,i)=>{const t=document.createElementNS('http://www.w3.org/2000/svg','tspan');t.setAttribute('x',node.getAttribute('x'));t.setAttribute('dy',i?String(Number(node.getAttribute('font-size'))+3):'0');t.textContent=line;node.appendChild(t)})} +function loadDate(){if(pendingScrub!==null){cancelAnimationFrame(pendingScrub);pendingScrub=null}syncSlider();const state=currentState();if(dateInput.value)stateInput.value=state?state.id:'';loadState()} +function loadState(){const state=currentState(),old=systemInput.value;systemInput.replaceChildren(new Option('All systems',''));if(state)state.applications.forEach(a=>systemInput.add(new Option(a.name,String(a.id))));systemInput.value=state&&state.applications.some(a=>String(a.id)===old)?old:'';loadLayout()} +function loadLayout(){syncSlider();const state=currentState(),when=dateInput.value;const key=['sort-layers','show-backlog','system-labels','maturity'].map(id=>document.getElementById(id).checked?'1':'0').join(':');const map=document.getElementById('map');document.getElementById('export-svg').disabled=!state;document.getElementById('print').disabled=!state;document.getElementById('date-prev').disabled=!payload.frames.some(s=>s.frame_froms.frame_from>when); +if(state){const layoutKey=key+':'+document.getElementById('tag-filter').value;if(state!==renderedState||layoutKey!==renderedKey||!map.querySelector('svg')){map.innerHTML='
'+state.layouts[layoutKey]+'
';renderedState=state;renderedKey=layoutKey}dateStatus.textContent=when?`${when} · ${state.label} · ${state.effective_from} ≤ date ${state.effective_to?'< '+state.effective_to:'(open end)'} · ${state.kind==='target'?'Planned scenario':'Snapshot-based view'}`:'Snapshot mode — no date selected. '+state.label}else{renderedState=null;renderedKey='';map.replaceChildren();const message=document.createElement('p');message.textContent=when?`No state data for date ${when}. Choose a date within a supplied period or select a snapshot.`:'Choose a date or select a snapshot.';map.append(message);dateStatus.textContent=message.textContent;document.getElementById('technical-details').replaceChildren();applyViewport()} +coverageChoices.querySelectorAll('input').forEach(i=>{const app=state&&state.applications.find(a=>String(a.id)===i.value);i.disabled=!app;i.parentElement.querySelector('.coverage-system-label').textContent=app?app.name:allCoverage.get(i.value);i.parentElement.title=i.disabled?'Not available in this state':''});document.getElementById('coverage').disabled=!state||!state.applications.length;if(!state)document.getElementById('functional-overlap').disabled=true;document.getElementById('coverage-count').textContent=`${selectedCoverage().length} selected`;if(state)updateView()} +function coverageShapePoints(hull,shape,rounded){let points=hull;if(shape==='rectangular'){const xs=hull.map(p=>p[0]),ys=hull.map(p=>p[1]),xmin=Math.min(...xs),xmax=Math.max(...xs),ymin=Math.min(...ys),ymax=Math.max(...ys);points=[[xmin,ymin],[xmax,ymin],[xmax,ymax],[xmin,ymax]]}if(!rounded)return points;const result=[];points.forEach((corner,i)=>{const previous=points[(i+points.length-1)%points.length],following=points[(i+1)%points.length],before=Math.hypot(previous[0]-corner[0],previous[1]-corner[1]),after=Math.hypot(following[0]-corner[0],following[1]-corner[1]),radius=Math.min(10,before/2,after/2),start=corner.map((v,k)=>v+(previous[k]-v)*radius/before),end=corner.map((v,k)=>v+(following[k]-v)*radius/after);for(let step=0;step<=8;step++){const t=step/8;result.push(corner.map((v,k)=>Math.round(((1-t)**2*start[k]+2*(1-t)*t*v+t*t*end[k])*10000)/10000))}});return result} +function applyCoverageShape(svg,shape,rounded){svg.querySelectorAll('.coverage-overlay').forEach(group=>{const polygon=group.querySelector('.coverage-polygon'),hull=polygon.getAttribute('data-coverage-hull').split(/\s+/).map(p=>p.split(',').map(Number)),points=coverageShapePoints(hull,shape,rounded).map(([x,y])=>`${x.toFixed(4)},${y.toFixed(4)}`).join(' ');polygon.setAttribute('points',points);group.querySelector('defs mask polygon').setAttribute('points',points)});svg.setAttribute('data-coverage-shape',shape);svg.setAttribute('data-coverage-rounded',rounded?'yes':'no')} +function polygonIntersection(subject,clip){const cross=(a,b,p)=>(b[0]-a[0])*(p[1]-a[1])-(b[1]-a[1])*(p[0]-a[0]);let output=subject;for(let i=0;i=-1e-8)!==(dp>=-1e-8)){const t=dp/(dp-dc);output.push([previous[0]+t*(current[0]-previous[0]),previous[1]+t*(current[1]-previous[1])])}if(dc>=-1e-8)output.push(current);previous=current;dp=dc}}const area=Math.abs(output.reduce((sum,a,i)=>{const b=output[(i+1)%output.length];return sum+a[0]*b[1]-b[0]*a[1]},0))/2;return area>1e-6?output:[]} +function updateFunctionalOverlap(svg,state,enabled){svg.querySelectorAll('g.functional-overlap').forEach(g=>g.remove());if(!enabled)return [];const active=Array.from(svg.querySelectorAll('.coverage-overlay[data-coverage-visible="yes"]')),regions=[];for(let i=0;ig.querySelector('.coverage-polygon')),points=polygons.map(p=>p.getAttribute('points').trim().split(/\s+/).map(p=>p.split(',').map(Number))),intersection=polygonIntersection(...points);if(intersection.length)regions.push({ids:[left,right].map(g=>g.getAttribute('data-coverage-system')).sort(),points:intersection})}if(!regions.length)return [];const ns='http://www.w3.org/2000/svg',add=(parent,tag,attrs)=>{const e=document.createElementNS(ns,tag);Object.entries(attrs).forEach(([k,v])=>e.setAttribute(k,v));parent.append(e);return e},group=add(svg,'g',{class:'functional-overlap','pointer-events':'none'}),defs=add(group,'defs',{}),edge=add(defs,'filter',{id:'functional-overlap-edge',filterUnits:'userSpaceOnUse',x:'0',y:'0',width:svg.getAttribute('width'),height:svg.getAttribute('data-content-bottom'),'color-interpolation-filters':'sRGB'});for(const [tag,attrs] of [['feMorphology',{in:'SourceAlpha',operator:'dilate',radius:'1.5',result:'outer'}],['feMorphology',{in:'SourceAlpha',operator:'erode',radius:'1.5',result:'inner'}],['feComposite',{in:'outer',in2:'inner',operator:'out',result:'edge'}],['feFlood',{'flood-color':'#dc2626',result:'red'}],['feComposite',{in:'red',in2:'edge',operator:'in'}]])add(edge,tag,attrs);const boundary=add(group,'g',{class:'functional-overlap-outline',filter:'url(#functional-overlap-edge)'});for(const {ids,points} of regions){const pair=add(boundary,'g',{class:'functional-overlap-region','data-overlap-systems':JSON.stringify(ids)});add(pair,'polygon',{points:points.map(([x,y])=>`${x.toFixed(4)},${y.toFixed(4)}`).join(' '),fill:'white'})}return regions.map(r=>r.ids)} +function addMaturityLegend(group,width,y){const ns='http://www.w3.org/2000/svg',add=(parent,tag,attrs,text)=>{const e=document.createElementNS(ns,tag);Object.entries(attrs).forEach(([k,v])=>e.setAttribute(k,v));if(text!==undefined)e.textContent=text;parent.append(e);return e},tilewidth=Math.min(216,width-48),columns=Math.max(1,Math.floor((width-48+12)/(tilewidth+12)));add(group,'text',{x:'24.0',y:(y+10).toFixed(1),'font-size':'12',fill:'#475569','text-anchor':'start'},payload.legend_labels.maturity);payload.maturity_legend.forEach((item,i)=>{const x=24+(i%columns)*(tilewidth+12),top=y+22+Math.floor(i/columns)*52,tile=add(group,'g',{class:'maturity-legend-item','data-maturity-level':String(item.level)});add(tile,'rect',{class:`maturity-legend-swatch caprect m${item.level}`,x:x.toFixed(1),y:top.toFixed(1),width:'36',height:'26',rx:'6',fill:'#c9d5f2',stroke:'#c9d5f2','stroke-width':'3'});for(const [text,tx,ty,size,fill,anchor] of [[String(item.level),x+18,top+17,'11','#0f172a','middle'],[item.name,x+48,top+9,'11','#334155','start'],[item.description,x+48,top+25,'10','#64748b','start']])add(tile,'text',{x:tx.toFixed(1),y:ty.toFixed(1),'font-size':size,fill,'text-anchor':anchor},text)});return y+22+Math.ceil(payload.maturity_legend.length/columns)*52+6} +function updateLegend(svg,state,view){const ns='http://www.w3.org/2000/svg',group=svg.querySelector('g.legend');if(!group)return;group.replaceChildren();const width=Number(svg.getAttribute('width')),bottom=Number(svg.getAttribute('data-content-bottom')),items=[],words=payload.legend_labels;const visible=Array.from(svg.querySelectorAll('g[data-id]')).filter(g=>Number(g.getAttribute('data-depth'))<=view.depth); +let maturityKey=false;if(view.legend&&visible.length){if(view.sort_layers&&svg.querySelector('.layer-zone'))items.push([words.layers,null]);if(view.tag_filter&&visible.some(g=>g.getAttribute('data-tag-match')==='context'))items.push([words.context,null]);if(view.system_labels&&visible.some(g=>Array.from(g.children).some(n=>n.classList.contains('system-label'))))items.push([words.labels,null]);if(view.system_id&&visible.some(g=>g.getAttribute('data-support')==='supported'))items.push([words.outline+state.applications.find(a=>String(a.id)===view.system_id).name,'#00a6a6']);const active=Array.from(svg.querySelectorAll('.coverage-overlay[data-coverage-visible="yes"]'));active.forEach(g=>{const id=g.getAttribute('data-coverage-system');items.push([words.coverage+state.applications.find(a=>String(a.id)===id).name,payload.coverage_colors[id]])});if(active.length)items.push([words.shared,null]);if(svg.querySelector('g.functional-overlap'))items.push([words.functional_overlap,'#dc2626']);if(view.maturity&&visible.some(g=>Array.from(g.children).some(n=>n.classList.contains('maturity-label'))))maturityKey=true} +let x=24,baseline=bottom+18,rowheight=14;for(const [label,color] of items){const prefix=color?16:0,limit=Math.max(4,Math.floor((width-48-prefix)/(11*.62)));let lines=[''];label.split(/\s+/).forEach(word=>{while(word.length>limit){if(lines[lines.length-1])lines.push('');lines[lines.length-1]=word.slice(0,limit);word=word.slice(limit);lines.push('')}if((lines[lines.length-1]+' '+word).trim().length>limit)lines.push(word);else lines[lines.length-1]=(lines[lines.length-1]+' '+word).trim()});const itemwidth=Math.max(...lines.map(line=>line.length))*11*.62+prefix;if(x>24&&x+itemwidth>width-24){x=24;baseline+=rowheight+6;rowheight=14}if(color){const rect=document.createElementNS(ns,'rect');Object.entries({x,y:baseline-9,width:10,height:10,rx:2,fill:color}).forEach(([k,v])=>rect.setAttribute(k,k==='x'||k==='y'?Number(v).toFixed(1):String(v)));group.append(rect)}const text=document.createElementNS(ns,'text');Object.entries({x:x+prefix,y:baseline,'font-size':11,fill:'#475569','text-anchor':'start'}).forEach(([k,v])=>text.setAttribute(k,k==='x'||k==='y'?Number(v).toFixed(1):String(v)));lines.forEach((line,i)=>{const span=document.createElementNS(ns,'tspan');span.setAttribute('x',(x+prefix).toFixed(1));span.setAttribute('dy',i?'14':'0');span.textContent=line;text.append(span)});group.append(text);rowheight=Math.max(rowheight,14*lines.length);x+=itemwidth+18}let height=items.length?baseline+rowheight+6:bottom+20;if(maturityKey)height=addMaturityLegend(group,width,items.length?baseline+rowheight+14:bottom+12);group.style.display=items.length||maturityKey?'inline':'none';svg.setAttribute('height',String(height));svg.setAttribute('viewBox',`0 0 ${width} ${height}`)} +function updateTechnicalNotes(md){const details=document.getElementById('technical-details');details.replaceChildren();for(const [label,value] of [['Model revision',md.model_revision],['Methodology contract',md.methodology_revision],['Reviewed baseline',md.methodology_baseline_revision],['Contract status',md.methodology_contract_status],['Adapter',md.adapter_version],['Renderer',md.renderer_version],['State',md.state_id],['View date',md.view_date],['Snapshot basis',md.snapshot_as_of],['View contract',md.view_contract],['Mapping semantics',md.mapping_semantics],['Functional overlap',md.functional_overlap_semantics]]){const term=document.createElement('dt'),description=document.createElement('dd');term.textContent=label;description.textContent=value||'Not specified';details.append(term,description)}} +let zoomScale=1,fitActive=false,viewportFrame=null; +const mapViewport=document.getElementById('map'),zoomRange=document.getElementById('zoom-range'); +function applyViewport(reset=false){const svg=mapViewport.querySelector('svg'),stage=document.getElementById('map-stage'),content=document.getElementById('map-content');for(const id of ['zoom-in','zoom-out','zoom-reset','zoom-range','fit-map'])document.getElementById(id).disabled=!svg;if(!svg||!stage)return;const width=Number(svg.getAttribute('width')),height=Number(svg.getAttribute('height'));if(fitActive)zoomScale=Math.min(1,Math.max(1,mapViewport.clientWidth-25)/width,Math.max(1,mapViewport.clientHeight-25)/height);stage.style.width=`${width*zoomScale}px`;stage.style.height=`${height*zoomScale}px`;content.style.width=`${width}px`;content.style.height=`${height}px`;content.style.transform=`scale(${zoomScale})`;const percentage=zoomScale*100;zoomRange.min=String(Math.min(1,Math.floor(percentage)));zoomRange.value=String(Math.round(percentage));zoomRange.setAttribute('aria-valuetext',`${percentage.toFixed(1)}%`);document.getElementById('zoom-value').textContent=`${Number(percentage.toFixed(1))}%`;document.getElementById('fit-map').setAttribute('aria-pressed',String(fitActive));if(reset){mapViewport.scrollLeft=0;mapViewport.scrollTop=0}} +function scheduleViewport(){if(viewportFrame===null)viewportFrame=requestAnimationFrame(()=>{viewportFrame=null;applyViewport()})} +function setZoom(scale){const stage=document.getElementById('map-stage');if(!stage)return;const centerX=(mapViewport.scrollLeft+mapViewport.clientWidth/2-stage.offsetLeft)/zoomScale,centerY=(mapViewport.scrollTop+mapViewport.clientHeight/2-stage.offsetTop)/zoomScale;fitActive=false;zoomScale=Math.max(.01,Math.min(3,scale));applyViewport();mapViewport.scrollLeft=stage.offsetLeft+centerX*zoomScale-mapViewport.clientWidth/2;mapViewport.scrollTop=stage.offsetTop+centerY*zoomScale-mapViewport.clientHeight/2} +function fitMap(){fitActive=true;applyViewport(true)} +document.getElementById('fit-map').addEventListener('click',fitMap);document.getElementById('zoom-in').addEventListener('click',()=>setZoom(zoomScale*1.25));document.getElementById('zoom-out').addEventListener('click',()=>setZoom(zoomScale/1.25));document.getElementById('zoom-reset').addEventListener('click',()=>setZoom(1));zoomRange.addEventListener('input',()=>setZoom(Number(zoomRange.value)/100));window.addEventListener('resize',scheduleViewport);if(typeof ResizeObserver!=='undefined')new ResizeObserver(scheduleViewport).observe(mapViewport); +function setDiagramOnly(on){document.getElementById('diagram-only').checked=on;document.body.classList.toggle('diagram-only',on);const toggle=document.getElementById('show-controls');toggle.textContent=on?'Show controls':'Hide controls';toggle.setAttribute('aria-expanded',String(!on));if(on){fitMap();document.getElementById('show-controls').focus()}else{applyViewport();document.getElementById('diagram-only').focus()}} +document.getElementById('diagram-only').addEventListener('change',event=>setDiagramOnly(event.target.checked));document.getElementById('show-controls').addEventListener('click',()=>setDiagramOnly(!document.body.classList.contains('diagram-only')));document.addEventListener('keydown',event=>{if(event.key==='Escape'&&document.body.classList.contains('diagram-only'))setDiagramOnly(false)}); +function updateView(){const svg=document.querySelector('#map svg'),state=currentState(),system=systemInput.value;if(!svg||!state)return;const depth=document.getElementById('depth').value;const labels=document.getElementById('system-labels').checked,maturity=document.getElementById('maturity').checked,legend=document.getElementById('legend').checked,coverage=document.getElementById('coverage').checked&&!document.getElementById('coverage').disabled;const selected=coverage?selectedCoverage():[];document.getElementById('coverage-count').textContent=`${selectedCoverage().length} selected`;svg.querySelectorAll('.coverage-overlay').forEach(g=>{const visible=selected.includes(g.getAttribute('data-coverage-system'))&&Number(g.getAttribute('data-coverage-depth'))===Number(depth);g.setAttribute('data-coverage-visible',visible?'yes':'no');g.style.display=visible?'inline':'none'}); +svg.setAttribute('data-max-depth',depth);svg.setAttribute('data-system-labels',labels?'on':'off');svg.setAttribute('data-maturity',maturity?'on':'off');svg.setAttribute('data-legend',legend?'on':'off');svg.setAttribute('data-system-selected',system?'yes':'no');svg.querySelectorAll('g[data-id]').forEach(g=>g.setAttribute('data-support',system&&JSON.parse(g.getAttribute('data-applications')).includes(system)?'supported':'not-specified')); +const coverageShape=document.getElementById('coverage-shape').value,roundCoverage=document.getElementById('round-coverage').checked;applyCoverageShape(svg,coverageShape,roundCoverage);const overlapInput=document.getElementById('functional-overlap');overlapInput.disabled=!coverage||selected.length<2;const overlapEnabled=overlapInput.checked&&!overlapInput.disabled;const overlapIds=updateFunctionalOverlap(svg,state,overlapEnabled); +const meta=svg.querySelector('metadata');const md=JSON.parse(meta.textContent);if(dateInput.value){md.as_of=dateInput.value;md.view_date=dateInput.value;const node=svg.querySelector('.date-context');if(node)wrapText(node,dateCaption(state),svg)}md.view={coverage_shape:coverageShape,round_coverage:roundCoverage,functional_overlap:overlapEnabled,functional_overlap_system_pairs:overlapIds,view_date:md.view_date,system_id:system||null,depth:Number(depth),system_labels:labels,maturity,legend,sort_layers:document.getElementById('sort-layers').checked,show_backlog:document.getElementById('show-backlog').checked,tag_filter:document.getElementById('tag-filter').value||null,coverage,coverage_system_id:selected.length===1?selected[0]:null,coverage_system_ids:selected};meta.textContent=JSON.stringify(md);updateLegend(svg,state,md.view);updateTechnicalNotes(md); +const name=system?state.applications.find(a=>String(a.id)===system).name:'All';const caption=`Layout: ${md.view.sort_layers?'Layers':'Classic'} · Backlog: ${md.view.show_backlog?'on':'off'} · Tag: ${md.view.tag_filter||'All'} · System: ${name} · Depth: ${depth} · System labels: ${labels?'on':'off'} · Maturity: ${maturity?'on':'off'} · Legend: ${legend?'on':'off'} · Coverage: ${coverage?(selected.map(id=>state.applications.find(a=>String(a.id)===id).name).join(', ')||'none'):'off'}`;const target=svg.querySelector('.view-selection');target.replaceChildren();const limit=Math.max(20,Math.floor((Number(svg.getAttribute('width'))-48)/7));const words=caption.split(/\s+/);let lines=[''];words.forEach(word=>{while(word.length>limit){if(lines[lines.length-1])lines.push('');lines[lines.length-1]=word.slice(0,limit);word=word.slice(limit);lines.push('')}if((lines[lines.length-1]+' '+word).trim().length>limit)lines.push(word);else lines[lines.length-1]=(lines[lines.length-1]+' '+word).trim()});lines.forEach((line,i)=>{const t=document.createElementNS('http://www.w3.org/2000/svg','tspan');t.setAttribute('x',target.getAttribute('x'));t.setAttribute('dy',i?'14':'0');t.textContent=line;target.appendChild(t)});applyViewport()} +stateInput.addEventListener('change',()=>{const state=payload.states.find(s=>s.id===stateInput.value);dateInput.value=state&&state.effective_from?(state.snapshot_as_of&&state.snapshot_as_of>=state.effective_from&&(!state.effective_to||state.snapshot_as_of{dateInput.value=localToday();loadDate()}); +for(const [id,next] of [['date-prev',false],['date-next',true]])document.getElementById(id).addEventListener('click',()=>{const dates=payload.frames.map(s=>s.frame_from).filter(d=>next?d>dateInput.value:ddocument.getElementById(id).addEventListener('change',loadLayout));['system','depth','legend','coverage','functional-overlap','coverage-shape','round-coverage'].forEach(id=>document.getElementById(id).addEventListener('change',updateView)); +document.getElementById('export-svg').addEventListener('click',()=>{const current=document.querySelector('#map svg');const clone=current.cloneNode(true);const depth=Number(clone.getAttribute('data-max-depth'));clone.querySelectorAll('.coverage-overlay[data-coverage-visible="no"]').forEach(g=>g.remove());clone.querySelectorAll('g[data-depth]').forEach(g=>{if(Number(g.getAttribute('data-depth'))>depth)g.remove()});if(clone.getAttribute('data-system-labels')==='off')clone.querySelectorAll('.system-label').forEach(e=>e.remove());if(clone.getAttribute('data-maturity')==='off')clone.querySelectorAll('.maturity-label').forEach(e=>e.remove());if(clone.getAttribute('data-legend')==='off')clone.querySelectorAll('.legend').forEach(e=>e.remove());clone.querySelectorAll('g[data-id]').forEach(g=>{g.removeAttribute('data-applications');Array.from(g.children).filter(e=>e.localName==='desc').forEach(e=>e.remove())});const xml=new XMLSerializer().serializeToString(clone);const url=URL.createObjectURL(new Blob([xml],{type:'image/svg+xml;charset=utf-8'}));const a=document.createElement('a');a.href=url;a.download='capability-map.svg';document.body.appendChild(a);a.click();a.remove();setTimeout(()=>URL.revokeObjectURL(url),1000)});document.getElementById('print').addEventListener('click',()=>window.print());dateInput.disabled=!payload.frames.length;document.getElementById('date-today').disabled=!payload.frames.length;dateInput.value=payload.frames.length?(payload.initial_date||localToday()):'';loadDate(); +''' + +def render(data, as_of=None, view_date=None): + model=normalize(data,as_of) + colors=coverage_colors(model) + if view_date and not any(s['effective_from'] for s in model['states']):raise ValueError('--date requires dated state periods') + def embed(state): + return {'id':state['id'],'label':state['label'],'kind':state['kind'], + 'snapshot_as_of':state['snapshot_as_of'].isoformat() if state.get('snapshot_as_of') else None, + 'effective_from':state['effective_from'].isoformat() if state.get('effective_from') else None, + 'effective_to':state['effective_to'].isoformat() if state.get('effective_to') else None, + 'frame_from':state['frame_from'].isoformat() if state.get('frame_from') else None, + 'frame_to':state['frame_to'].isoformat() if state.get('frame_to') else None, + 'applications':state['applications'],'layouts':{ + f'{int(layers)}:{int(backlog)}:{int(labels)}:{int(maturity)}:{tag}':build_svg(model,state,layers,backlog,labels,maturity,tag) + for layers in (False,True) for backlog in (False,True) + for labels in (False,True) for maturity in (False,True) for tag in ('',*TAGS)}} + payload={'maturity_legend':MATURITY_LEGEND,'legend_labels':LEGEND_LABELS,'coverage_colors':colors,'coverage_default_ids':[model['coverage_system_id']] if model.get('coverage_system_id') else [], + 'initial_date':(date(view_date) or model['view_date']).isoformat() if date(view_date) or model['view_date'] else None, + 'coverage_applications':[{'id':aid,'name':next(a['name'] for s in model['states'] for a in s['all_applications'] if str(a['id'])==aid)} for aid in colors], + 'states':[embed(s) for s in model['states']], 'frames':[embed(s) for s in timeline_frames(model)]} + encoded=json.dumps(payload,ensure_ascii=True).replace('<','\\u003c').replace('>','\\u003e').replace('&','\\u0026') + options=''.join(f'' for s in model['states']) + return f''' +{esc(model['title'])} +
+
Time +
+
+

+
Capability view
+ + + +
+
Systems & coverage
+
+
Coverage systems —
+
Export
+
Diagram notes

Classic DSM Report adaptation. Explicit dated snapshots and planned scenarios; no interpolation or forecast. Date gaps show no data. A missing system mapping means not specified, never unsupported. Five management layers; ESG, MDM and Support are box tags. Tag filters keep direct matches and muted parent/domain context; tags and system mappings do not inherit. Unclassified stages stay Not specified. Hiding backlog removes its column and unplaced assignments. System labels are off by default. Boxes resize to fit visible labels; Coverage polygons are off by default. Select one or more systems above; colors overlap where explicit mappings share a capability. Direct and explicit technical mappings; area is not a percentage. SVG exports this exact view.

+
100%
''' + +def render_svg(data,as_of=None,show_maturity=False,state_id=None,system='',depth=3,labels=False,legend=True,sort_layers=False,show_backlog=True,tag_filter='',coverage=False,coverage_systems=None,view_date=None,functional_overlap=False,coverage_shape='angled',round_coverage=False): + model=normalize(data,as_of);state=next((s for s in model['states'] if s['id']==state_id),None) if state_id else model['states'][0] + if state is None:raise ValueError('Unknown state ID') + requested=date(view_date) or (model['view_date'] if not state_id else None) + if requested:state=state_on(model,requested,state_id) + return prune_export(apply_view(build_svg(model,state,sort_layers,show_backlog,labels,show_maturity,tag_filter),state,system,depth,labels,show_maturity,legend,coverage,coverage_systems,functional_overlap,coverage_shape,round_coverage)) + +def main(): + p=argparse.ArgumentParser(description=__doc__);p.add_argument('input');p.add_argument('output');p.add_argument('--as-of');p.add_argument('--date',dest='view_date',help='Select the explicit state period and evaluate lifetimes/maturity on YYYY-MM-DD');p.add_argument('--maturity',action='store_true');p.add_argument('--state');p.add_argument('--system',default='');p.add_argument('--depth',type=int,choices=(1,2,3),default=3);labels_group=p.add_mutually_exclusive_group();labels_group.add_argument('--system-labels',dest='system_labels',action='store_true');labels_group.add_argument('--no-system-labels',dest='system_labels',action='store_false');p.set_defaults(system_labels=False);p.add_argument('--no-legend',action='store_true');p.add_argument('--coverage',action='store_true',help='Show coverage polygons; defaults to legacy pilot, or all systems without one (SVG output)');p.add_argument('--coverage-system',action='append',dest='coverage_systems',help='Select a coverage system ID; repeat for multiple systems; requires --coverage (SVG output)');p.add_argument('--coverage-shape',choices=('angled','rectangular'),default='angled',help='Coverage outline form (SVG output)');p.add_argument('--round-coverage',action='store_true',help='Round coverage polygon corners (SVG output)');p.add_argument('--functional-overlap',action='store_true',help='Outline intersections of 2+ selected system coverage polygons in red (SVG output)');p.add_argument('--tag',default='',choices=('',*TAGS),help='Keep direct tag matches and parent/domain context (SVG output)');p.add_argument('--sort-layers',action='store_true',help='Group explicit management stages into horizontal bands (SVG output)');p.add_argument('--no-backlog',action='store_true',help='Omit backlog column and unplaced assignments (SVG output)');a=p.parse_args() + if a.functional_overlap and not a.coverage:p.error('--functional-overlap requires --coverage') + if a.coverage_systems and not a.coverage:p.error('--coverage-system requires --coverage') + try: + data=json.loads(pathlib.Path(a.input).read_text(encoding='utf-8'));as_of=date(a.as_of) + content=render_svg(data,as_of,a.maturity,a.state,a.system,a.depth,a.system_labels,not a.no_legend,a.sort_layers,not a.no_backlog,a.tag,a.coverage,a.coverage_systems,a.view_date,a.functional_overlap,a.coverage_shape,a.round_coverage) if pathlib.Path(a.output).suffix.lower()=='.svg' else render(data,as_of,a.view_date) + pathlib.Path(a.output).write_text(content,encoding='utf-8') + except (ValueError,KeyError,TypeError,OSError) as e:p.exit(2,f'Invalid model: {e}\n') +if __name__=='__main__':main() diff --git a/transitrix/skills/render-dsm-capabilities-html/scripts/test_package.py b/transitrix/skills/render-dsm-capabilities-html/scripts/test_package.py new file mode 100644 index 00000000..ae0e4474 --- /dev/null +++ b/transitrix/skills/render-dsm-capabilities-html/scripts/test_package.py @@ -0,0 +1,41 @@ +"""Exercise portable archive extraction, reproducibility and refusing writes.""" +import hashlib +import importlib.util +from pathlib import Path +import subprocess +import sys +import tempfile +import unittest +import zipfile + +ROOT = Path(__file__).resolve().parents[1] +spec = importlib.util.spec_from_file_location('skill_package', ROOT / 'scripts/package.py') +package = importlib.util.module_from_spec(spec) +spec.loader.exec_module(package) + +class PortablePackage(unittest.TestCase): + def test_archive_reproducible_and_renderable_after_extraction(self): + with tempfile.TemporaryDirectory() as work: + work = Path(work) + first, second = work / 'first.zip', work / 'second.zip' + package.build(first) + package.build(second) + self.assertEqual(hashlib.sha256(first.read_bytes()).digest(), hashlib.sha256(second.read_bytes()).digest()) + with zipfile.ZipFile(first) as archive: + names = archive.namelist() + self.assertIn(ROOT.name + '/SKILL.md', names) + self.assertIn(ROOT.name + '/README.md', names) + self.assertFalse(any('__pycache__' in p or p.endswith('.pyc') for p in names)) + archive.extractall(work / 'unpacked') + folder = work / 'unpacked' / ROOT.name + subprocess.run([sys.executable, str(folder / 'scripts/render.py'), str(folder / 'assets/example.json'), str(work / 'map.svg'), '--no-backlog'], check=True, capture_output=True) + self.assertIn(' governance and cross-functional coordination ' * 5 + gs = groups(render.render_svg(data)) + self.assertGreaterEqual(float(rect(gs['sales'])['width']), 500) + self.assertGreater(float(rect(gs['risk'])['width']), float(rect(gs['risk'])['height'])) + title = gs['risk'].find("s:text[@class='horizontal-title']", NS) + self.assertGreater(len(title), 1) + last_baseline = float(title.get('y')) + 15*(len(title)-1) + # The long title wraps in the left gutter beside the intersection. + label_right=max(float(t.get('x'))+len(t.text or '')*12*.62 for t in title) + self.assertLess(label_right,float(rect(gs['sales'])['x'])) + self.assertLess(float(rect(gs['customer-risk'])['y']),last_baseline) + self.assertLess(last_baseline,float(rect(gs['risk'])['y'])+float(rect(gs['risk'])['height'])) + + def test_horizontal_labels_leave_domain_lanes_free(self): + for layers in (False,True): + gs=groups(render.render_svg(EXAMPLE,sort_layers=layers,show_backlog=False)) + first_column=float(rect(gs['sales'])['x']) + for ident in ('risk','data'): + for label in gs[ident].findall('s:text',NS): + if label.get('class')=='unassigned-label':continue + self.assertEqual(label.get('text-anchor'),'start') + size=float(label.get('font-size')) + for line in label: + self.assertLess(float(line.get('x'))+len(line.text or '')*size*.62,first_column) + for ident in ('customer-risk','checks','delivery-risk','quality'): + for label in gs[ident].findall('s:text',NS): + self.assertEqual(label.get('text-anchor'),'start') + + def test_views_preserve_geometry_and_exact_export(self): + for state in ('current', 'target'): + base = geometry(render.render_svg(EXAMPLE, state_id=state, labels=False, show_maturity=True)) + for depth in (1, 2, 3): + svg = render.render_svg(EXAMPLE, state_id=state, system='app-crm', depth=depth, labels=False, legend=False, show_maturity=True) + gs = groups(svg) + self.assertEqual(geometry(svg), {k: base[k] for k in gs}) + self.assertTrue(all(int(g.get('data-depth')) <= depth for g in gs.values())) + self.assertNotIn('data-applications=', svg) + root = ET.fromstring(svg) + self.assertFalse(root.findall(".//s:text[@class='system-label']", NS)) + self.assertFalse(root.findall(".//s:g[@class='legend']", NS)) + self.assertEqual(gs['risk'].get('data-support'), 'not-specified') + if depth >= 2: + self.assertEqual(gs['customer-risk'].get('data-support'), 'supported' if state=='target' else 'not-specified') + md = json.loads(root.find('s:metadata', NS).text) + self.assertEqual(md['state_id'], state) + self.assertEqual(md['horizon_label'], 'end of 2027' if state=='target' else '') + + def test_html_uses_same_svg_builder(self): + html = render.render(EXAMPLE) + payload = json.loads(re.search(r'', html).group(1)) + model = render.normalize(EXAMPLE, None) + for embedded, state in zip(payload['states'], model['states']): + for layers,backlog,labels,maturity in itertools.product((False,True),repeat=4): + key=':'.join(str(int(x)) for x in (layers,backlog,labels,maturity))+':' + self.assertEqual(embedded['layouts'][key],render.build_svg(model,state,layers,backlog,labels,maturity)) + +class CompactLabels(unittest.TestCase): + def test_defaults_and_empty_lines(self): + svg=render.render_svg(EXAMPLE) + root=ET.fromstring(svg) + self.assertFalse(root.findall(".//s:text[@class='system-label']",NS)) + self.assertFalse(root.findall(".//s:text[@class='maturity-label']",NS)) + self.assertFalse(json.loads(root.find('s:metadata',NS).text)['view']['system_labels']) + html=render.render(EXAMPLE) + checkbox=re.search(r']*>',html).group() + self.assertNotIn('checked',checkbox) + shown=ET.fromstring(render.render_svg(EXAMPLE,labels=True,show_maturity=True)) + for text in shown.findall('.//s:text',NS): + self.assertTrue(''.join(text.itertext()).strip()) + visible=' '.join(''.join(t.itertext()) for t in shown.findall('.//s:text',NS)) + self.assertNotIn('Systems: not specified',visible) + self.assertNotIn('Not assessed',visible) + + def test_show_systems_grows_boxes_and_restore_compacts(self): + for layers in (False,True): + hidden=render.render_svg(EXAMPLE,sort_layers=layers) + shown=render.render_svg(EXAMPLE,sort_layers=layers,labels=True) + off,on=groups(hidden),groups(shown) + for ident in ('acquire','quality'): + a,b=rect(off[ident]),rect(on[ident]) + self.assertGreater(float(b['width'])*float(b['height']),float(a['width'])*float(a['height'])) + self.assertIsNone(off[ident].find("s:text[@class='system-label']",NS)) + self.assertIsNotNone(on[ident].find("s:text[@class='system-label']",NS)) + self.assertIsNone(on['unknown-risk'].find("s:text[@class='system-label']",NS)) + self.assertEqual(hidden,render.render_svg(EXAMPLE,sort_layers=layers,labels=False)) + # Maturity is another optional line stack; hiding it leaves no slot. + mature=groups(render.render_svg(EXAMPLE,sort_layers=layers,show_maturity=True)) + self.assertGreater(float(rect(mature['quality'])['height']),float(rect(off['quality'])['height'])) + + def test_cli_system_labels_opt_in(self): + script=Path(render.__file__) + source=script.parents[1]/'assets/synthetic-regression.json' + with tempfile.TemporaryDirectory() as tmp: + for enabled in (False,True): + output=Path(tmp)/('shown.svg' if enabled else 'hidden.svg') + args=[sys.executable,str(script),str(source),str(output)] + if enabled:args.append('--system-labels') + subprocess.run(args,check=True,capture_output=True) + root=ET.fromstring(output.read_text()) + self.assertEqual(bool(root.findall(".//s:text[@class='system-label']",NS)),enabled) + +class BacklogVisibility(unittest.TestCase): + def test_hide_restore_both_layouts_and_snapshots(self): + before=copy.deepcopy(EXAMPLE) + for state,layers,depth in itertools.product(('current','target'),(False,True),(1,2,3)): + full=render.render_svg(EXAMPLE,state_id=state,sort_layers=layers,depth=depth) + hidden=render.render_svg(EXAMPLE,state_id=state,sort_layers=layers,depth=depth, + show_backlog=False,system='app-crm',labels=False) + gs=groups(hidden);root=ET.fromstring(hidden) + excluded={'backlog','idea','unknown-risk'} + self.assertEqual(set(gs),set(groups(full))-excluded) + self.assertLess(float(root.get('width')),float(ET.fromstring(full).get('width'))) + md=json.loads(root.find('s:metadata',NS).text) + self.assertFalse(md['show_backlog']);self.assertFalse(md['view']['show_backlog']) + self.assertEqual(md['view']['sort_layers'],layers) + self.assertEqual(md['view']['system_id'],'app-crm') + if depth>=2: + c,d=rect(gs['customer-risk']),rect(gs['sales']) + self.assertAlmostEqual(float(c['x'])+float(c['width'])/2,float(d['x'])+float(d['width'])/2) + self.assertEqual(full,render.render_svg(EXAMPLE,state_id=state,sort_layers=layers,depth=depth)) + self.assertEqual(EXAMPLE,before) + + def test_only_backlog_and_no_backlog(self): + for layers in (False,True): + data=copy.deepcopy(EXAMPLE);data['states']=data['states'][:1] + state=data['states'][0];state['applications']=[] + state['capabilities']=[r for r in state['capabilities'] if r['id'] in ('backlog','idea')] + hidden=render.render_svg(data,sort_layers=layers,show_backlog=False) + self.assertEqual(groups(hidden),{}) + self.assertNotIn('Unplaced / backlog',hidden) + # A placed capability called Backlog must not be hidden by name. + state['capabilities']=[dict(id='placed',name='Backlog',layout='vertical',first_level=1, + second_level=0,third_level=0,lane=0,property='Support')] + self.assertEqual(set(groups(render.render_svg(data,sort_layers=layers,show_backlog=False))),{'placed'}) + +class OrientationGeometry(unittest.TestCase): + def check_orientation(self,data): + for state,layers,backlog,depth in itertools.product(data['states'],(False,True),(False,True),(1,2,3)): + svg=render.render_svg(data,state_id=state['id'],sort_layers=layers,show_backlog=backlog,depth=depth) + byid={r['id']:r for r in state['capabilities']} + for ident,g in groups(svg).items(): + record=byid[ident];box=rect(g);w,h=float(box['width']),float(box['height']) + self.assertEqual(g.get('data-orientation'),record['layout']) + if record['layout']=='vertical': + if not record['second_level']:self.assertGreaterEqual(h+.1,1.25*w) + else:self.assertGreaterEqual(w+.1,1.6*h) + address=next(g.iter('{'+render.SVGNS+'}tspan')).text + self.assertTrue(address.startswith('v.' if record['layout']=='vertical' else 'h.')) + + def test_v_columns_h_rectangles_at_all_depths(self): + self.check_orientation(EXAMPLE) + + def test_descendant_widths_follow_parent_and_names_wrap_at_words(self): + data=json.loads((Path(__file__).resolve().parents[1]/'assets/example.json').read_text()) + for state,layers,backlog,labels,maturity,tag in itertools.product(data['states'],(False,True),(False,True),(False,True),(False,True),('',*render.TAGS)): + gs=groups(render.render_svg(data,state_id=state['id'],sort_layers=layers,show_backlog=backlog,labels=labels,show_maturity=maturity,tag_filter=tag)) + coords={(r['layout'],r['first_level'],r['second_level'],r['third_level']):r['id'] for r in state['capabilities']} + for record in state['capabilities']: + if record['layout']!='vertical' or not record['second_level'] or record['id'] not in gs:continue + parent=coords[('vertical',record['first_level'],record['second_level'] if record['third_level'] else 0,0)] + c,p=rect(gs[record['id']]),rect(gs[parent]);ratio=.9 if record['third_level'] else .8 + self.assertAlmostEqual(float(c['width']),float(p['width'])*ratio,delta=.11) + self.assertAlmostEqual(float(c['x'])+float(c['width'])/2,float(p['x'])+float(p['width'])/2,delta=.11) + # Ordinary example names must wrap between words, never as + # fragments such as "Custome" / "r" or "reconcili" / "ation". + name=gs[record['id']].findall('s:text',NS)[1] + lines=[t.text or '' for t in name.findall('s:tspan',NS)] + self.assertEqual(' '.join(lines),record['name']) + + def test_horizontal_content_expands_without_becoming_portrait(self): + data=copy.deepcopy(EXAMPLE);data['states']=data['states'][:1] + state=data['states'][0] + next(r for r in state['capabilities'] if r['id']=='customer-risk')['name']='Long horizontal capability label with explicit domain assignment ' * 8 + source=next(r for r in state['capabilities'] if r['id']=='checks') + for number in range(2,8): + child=copy.deepcopy(source);child.update(id=f'check-{number}',third_level=number) + state['capabilities'].append(child) + unplaced=copy.deepcopy(source) + unplaced.update(id='unplaced-check',name='Unplaced horizontal detail',second_level=3,third_level=1,lane=0) + state['capabilities'].append(unplaced) + before=copy.deepcopy(data) + self.check_orientation(data) + self.assertEqual(data,before) + +class LayerSorting(unittest.TestCase): + def setUp(self): + self.data=copy.deepcopy(EXAMPLE) + # Deliberately differ across hierarchy, orientation and snapshots. + properties={'sales':'Execution','acquire':'Planning','lead':'Strategic', + 'risk':'Support','customer-risk':'Learning','checks':'Execution', + 'data':'MDM','quality':'Assurance','idea':'Future category'} + for state in self.data['states']: + for record in state['capabilities']: + record.pop('property',None) + if record['id'] in properties:record['property']=properties[record['id']] + self.data['states'][1]['capabilities'][0]['property']='Strategic' + + def test_bands_explicit_values_and_lanes(self): + svg=render.render_svg(self.data,sort_layers=True) + root=ET.fromstring(svg);gs=groups(svg) + self.assertEqual(set(gs),{str(r['id']) for r in self.data['states'][0]['capabilities']}) + headings=root.findall("s:text[@class='layer-heading']",NS) + zones=root.findall("s:rect[@class='layer-zone']",NS) + self.assertEqual({''.join(h.itertext()) for h in headings},set((*render.LAYERS,'Not specified','Unknown property'))) + # Stage order restarts within each horizontal L1 context. + scopes={z.get('data-layer-scope') for z in zones} + order=[*render.LAYERS,'Not specified','Unknown property'] + for scope in scopes: + categories=[z.get('data-layer-zone') for z in zones if z.get('data-layer-scope')==scope] + self.assertEqual(categories,sorted(categories,key=order.index)) + y=[float(h.get('y')) for h in headings] + for r in self.data['states'][0]['capabilities']: + g=gs[r['id']];category=render.layer(r) + self.assertEqual(g.get('data-layer'),category) + if r['layout']=='vertical' and r['second_level']==0: + self.assertEqual(g.get('class'),'domain-column') + self.assertLess(float(rect(g)['y']),min(y)) + self.assertEqual(rect(g)['fill'],'none') + if render.layer_value(r):self.assertIn('Layer: '+render.layer_value(r),''.join(g.itertext())) + else:self.assertFalse(g.findall("s:text[@class='property-label']",NS)) + continue + if not r['second_level']:continue + # A stage label must stay inside a zone of its own category and + # domain context; a parent frame can span several cycle stages. + label_y=float(g.find('s:text',NS).get('y')) + scope='vertical-domains' if r['layout']=='vertical' else next(v['id'] for v in self.data['states'][0]['capabilities'] if v['layout']=='horizontal' and v['first_level']==r['first_level'] and not v['second_level']) + self.assertTrue(any(z.get('data-layer-zone')==category and z.get('data-layer-scope')==scope and + float(z.get('y'))=2: + expected='supported' if system=='app-crm' and state['id']=='target' else 'not-specified' + self.assertEqual(gs['customer-risk'].get('data-support'),expected) + self.assertEqual(self.data,before) + classic=render.render_svg(self.data) + self.assertIsNotNone(groups(classic)['acquire'].find("s:g[@data-id='lead']",NS)) + self.assertFalse(json.loads(ET.fromstring(classic).find('s:metadata',NS).text)['view']['sort_layers']) + + def test_source_parent_containment_in_all_views(self): + acme=json.loads((Path(__file__).resolve().parents[1]/'assets/example.json').read_text()) + for data in (self.data,acme): + for state,layers,backlog,labels,maturity,depth in itertools.product( + data['states'],(False,True),(False,True),(False,True),(False,True),(1,2,3)): + svg=render.render_svg(data,state_id=state['id'],sort_layers=layers, + show_backlog=backlog,labels=labels,show_maturity=maturity,depth=depth) + gs=groups(svg) + self.assertEqual(len(ET.fromstring(svg).findall('.//s:g[@data-id]',NS)),len(gs)) + records={str(r['id']):r for r in state['capabilities']} + coords={(r['layout'],r['first_level'],r['second_level'],r['third_level']):str(r['id']) for r in records.values()} + for ident,g in gs.items(): + r=records[ident] + if not r['second_level']:continue + parent=coords[(r['layout'],r['first_level'],r['second_level'] if r['third_level'] else 0,0)] + c,p=rect(g),rect(gs[parent]) + for axis,extent in [('x','width'),('y','height')]: + self.assertGreater(float(c[axis]),float(p[axis]),(ident,parent,layers,axis)) + self.assertLess(float(c[axis])+float(c[extent]),float(p[axis])+float(p[extent]),(ident,parent,layers,axis)) + # H branches and V-L3 must also retain DOM containment, so + # depth filters and exports cannot detach children. + if r['layout']=='horizontal' or r['third_level']: + self.assertIsNotNone(gs[parent].find(f"s:g[@data-id='{ident}']",NS)) + + def test_property_validation_and_missing(self): + for value in (42,True,[],{}): + data=copy.deepcopy(self.data);data['states'][0]['capabilities'][0]['property']=value + with self.assertRaisesRegex(ValueError,'property must be text'): + render.render_svg(data,sort_layers=True) + for value in (None,''): + data=copy.deepcopy(self.data);data['states'][0]['capabilities'][0]['property']=value + self.assertEqual(groups(render.render_svg(data,sort_layers=True))['sales'].get('data-layer'),'Not specified') + +class CycleLayersAndTags(unittest.TestCase): + def setUp(self): + self.data=copy.deepcopy(EXAMPLE) + for state in self.data['states']: + for r in state['capabilities']: + r.pop('property',None);r['layer']=None;r['tags']=[] + for ident,stage,labels in [('acquire','Planning',[]),('lead','Assurance',['MDM','Support']), + ('customer-risk','Execution',['ESG']),('checks','Assurance',['MDM'])]: + next(r for r in state['capabilities'] if r['id']==ident).update(layer=stage,tags=labels) + + def test_legacy_mapping_and_explicit_precedence_without_mutation(self): + data=copy.deepcopy(self.data);rows=data['states'][0]['capabilities'] + root=next(r for r in rows if r['id']=='sales');root.pop('layer');root['property']='MDM' + child=next(r for r in rows if r['id']=='acquire');child.update(property='Execution',layer='Planning') + before=copy.deepcopy(data);svg=render.render_svg(data,sort_layers=True);gs=groups(svg) + self.assertEqual(gs['sales'].get('data-layer'),'Not specified') + self.assertEqual(json.loads(gs['sales'].get('data-tags')),['MDM']) + self.assertEqual(gs['acquire'].get('data-layer'),'Planning') + self.assertEqual(json.loads(gs['acquire'].get('data-tags')),[]) + self.assertEqual(data,before) + self.assertFalse(ET.fromstring(svg).findall("s:rect[@data-layer-zone='MDM']",NS)) + self.assertIn('MDM',''.join(gs['sales'].find("s:text[@class='tag-label']",NS).itertext())) + + def test_filter_keeps_only_matches_ancestors_and_lane_context(self): + for state,layers,backlog,depth,tag in itertools.product(self.data['states'],(False,True),(False,True),(1,2,3),render.TAGS): + svg=render.render_svg(self.data,state_id=state['id'],sort_layers=layers,show_backlog=backlog,depth=depth,tag_filter=tag) + gs=groups(svg);expected={'MDM':{'lead','acquire','sales','checks','customer-risk','risk'}, + 'Support':{'lead','acquire','sales'},'ESG':{'customer-risk','sales','risk'}}[tag] + records={r['id']:r for r in state['capabilities']} + expected={i for i in expected if (3 if records[i]['third_level'] else 2 if records[i]['second_level'] else 1)<=depth} + self.assertEqual(set(gs),expected) + for ident,g in gs.items(): + self.assertEqual(g.get('data-tag-match'),'match' if tag in records[ident]['tags'] else 'context') + md=json.loads(ET.fromstring(svg).find('s:metadata',NS).text) + self.assertEqual(md['view']['tag_filter'],tag) + self.assertEqual(md['layer_vocabulary'],list(render.LAYERS)) + self.assertNotIn('data-applications=',svg) + # Tagging a root never makes its untagged descendants match. + next(r for r in self.data['states'][0]['capabilities'] if r['id']=='sales')['tags']=['Support'] + self.assertEqual(set(groups(render.render_svg(self.data,tag_filter='Support'))),{'lead','acquire','sales'}) + + def test_validation_positive_and_negative_and_empty_results(self): + for field,value,error in [('layer','MDM','layer'),('layer',42,'layer'),('tags','MDM','tags'), + ('tags',['other'],'tags'),('tags',[None],'tags'),('tags',['ESG','ESG'],'Duplicate')]: + data=copy.deepcopy(self.data);data['states'][0]['capabilities'][0][field]=value + with self.assertRaisesRegex(ValueError,error):render.render_svg(data) + for stage in render.LAYERS: + data=copy.deepcopy(self.data);data['states'][0]['capabilities'][0]['layer']=stage + self.assertEqual(groups(render.render_svg(data))['sales'].get('data-layer'),stage) + for state in self.data['states']: + for r in state['capabilities']:r['tags']=[] + svg=render.render_svg(self.data,sort_layers=True,tag_filter='MDM') + self.assertFalse(groups(svg));self.assertIn('No capabilities match tag MDM.',svg) + with self.assertRaisesRegex(ValueError,'Unknown tag filter'):render.render_svg(self.data,tag_filter='other') + + def test_acme_stages_tags_and_context_across_views(self): + data=json.loads((Path(__file__).resolve().parents[1]/'assets/example.json').read_text()) + self.assertEqual({r['layer'] for r in data['states'][0]['capabilities'] if r.get('layer')},set(render.LAYERS)) + for state,layers,backlog,depth,tag,labels,maturity in itertools.product(data['states'],(False,True),(False,True),(1,2,3),('',*render.TAGS),(False,True),(False,True)): + svg=render.render_svg(data,state_id=state['id'],sort_layers=layers,show_backlog=backlog,depth=depth,tag_filter=tag,labels=labels,show_maturity=maturity,legend=False) + root=ET.fromstring(svg);gs=groups(svg) + self.assertEqual(len(root.findall('.//s:g[@data-id]',NS)),len(gs)) + candidates=[r for r in state['capabilities'] if backlog or not + (r['layout']=='vertical' and not r['first_level'] or r['layout']=='horizontal' and r['second_level'] and not r['lane'])] + coords={(r['layout'],r['first_level'],r['second_level'],r['third_level']):r for r in candidates} + matches={r['id'] for r in candidates if not tag or tag in r.get('tags',[])} + expected=set(matches) + for r in candidates: + if r['id'] not in matches:continue + if r['second_level']:expected.add(coords[(r['layout'],r['first_level'],0,0)]['id']) + if r['third_level']:expected.add(coords[(r['layout'],r['first_level'],r['second_level'],0)]['id']) + if r['layout']=='horizontal' and r['second_level'] and r['lane']: + expected.add(coords[('vertical',r['lane'],0,0)]['id']) + expected={r['id'] for r in candidates if r['id'] in expected and (3 if r['third_level'] else 2 if r['second_level'] else 1)<=depth} + self.assertEqual(set(gs),expected) + for r in candidates: + if r['id'] not in gs:continue + g=gs[r['id']] + self.assertEqual(json.loads(g.get('data-tags')),r.get('tags',[])) + self.assertEqual(bool(g.find("s:text[@class='tag-label']",NS) is not None),bool(r.get('tags'))) + self.assertEqual(g.get('data-tag-match'),'match' if r['id'] in matches else 'context') + if not r['second_level']:continue + parent=coords[(r['layout'],r['first_level'],r['second_level'] if r['third_level'] else 0,0)] + c,p=rect(g),rect(gs[parent['id']]) + for axis,extent in [('x','width'),('y','height')]: + self.assertGreater(float(c[axis]),float(p[axis])) + self.assertLess(float(c[axis])+float(c[extent]),float(p[axis])+float(p[extent])) + self.assertFalse({z.get('data-layer-zone') for z in root.findall("s:rect[@class='layer-zone']",NS)}&set(render.TAGS)) + hroots=[rect(gs[r['id']]) for r in candidates if r['layout']=='horizontal' and not r['second_level'] and r['id'] in gs] + for first,second in zip(hroots,hroots[1:]): + self.assertLess(float(first['y'])+float(first['height']),float(second['y'])) + self.assertNotIn('data-applications=',svg) + + def test_all_html_tag_variants_equal_direct_builder_and_cli(self): + model=render.normalize(self.data,None);doc=render.render(self.data) + payload=json.loads(re.search(r'',doc).group(1)) + for embedded,state in zip(payload['states'],model['states']): + self.assertEqual(len(embedded['layouts']),64) + for layers,backlog,labels,maturity,tag in itertools.product((False,True),(False,True),(False,True),(False,True),('',*render.TAGS)): + key=':'.join(str(int(x)) for x in (layers,backlog,labels,maturity))+':'+tag + self.assertEqual(embedded['layouts'][key],render.build_svg(model,state,layers,backlog,labels,maturity,tag)) + with tempfile.TemporaryDirectory() as directory: + source=Path(directory)/'model.json';target=Path(directory)/'map.svg';source.write_text(json.dumps(self.data)) + result=subprocess.run([sys.executable,str(Path(render.__file__)),str(source),str(target),'--sort-layers','--tag','MDM'],capture_output=True,text=True) + self.assertEqual(result.returncode,0,result.stderr) + self.assertEqual(target.read_text(),render.render_svg(self.data,sort_layers=True,tag_filter='MDM')) + +class SystemCoverage(unittest.TestCase): + def setUp(self): + self.data=copy.deepcopy(EXAMPLE) + self.data['coverage_system_id']='app-crm' + for state in self.data['states']: + app=next(a for a in state['applications'] if a['id']=='app-crm') + app['capabilities']=['acquire'] + app['technical_capabilities']=[{'id':'tech-leads','name':'Lead intake','capabilities':['lead']}] + + def test_explicit_direct_and_technical_geometry_and_cutouts(self): + before=copy.deepcopy(self.data) + for layers,depth in itertools.product((False,True),(1,2,3)): + plain=render.render_svg(self.data,sort_layers=layers,depth=depth) + covered=render.render_svg(self.data,sort_layers=layers,depth=depth,coverage=True) + self.assertEqual(geometry(plain),geometry(covered)) + root=ET.fromstring(covered);overlays=root.findall("s:g[@class='coverage-overlay']",NS) + self.assertEqual(len(overlays),0 if depth==1 else 1) + if not overlays:continue + overlay=overlays[0] + self.assertEqual(overlay.get('data-coverage-depth'),str(depth)) + ids=json.loads(overlay.get('data-covered-capabilities')) + self.assertEqual(set(ids),{'acquire','lead'} if depth==3 else {'acquire'}) + sources=json.loads(overlay.get('data-coverage-sources')) + self.assertEqual(sources['direct_application'],['acquire']) + self.assertEqual(sources['technical_capabilities'],{'tech-leads':['lead']} if depth==3 else {}) + self.assertEqual(overlay.find("s:text[@class='coverage-system-name']",NS).text,'CRM') + polygon=overlay.find("s:polygon[@class='coverage-polygon']",NS) + points=[tuple(map(float,point.split(','))) for point in polygon.get('points').split()] + self.assertGreaterEqual(len(points),4) + self.assertLess(float(polygon.get('fill-opacity')),1) + self.assertEqual(overlay.get('pointer-events'),'none') + cutouts={r.get('data-excluded-capability') for r in overlay.findall('.//s:rect',NS)} + self.assertTrue(set(groups(covered))-set(ids)<=cutouts) + self.assertFalse(set(ids)&cutouts) + self.assertNotIn('data-applications=',covered) + self.assertEqual(self.data,before) + # Root mapping does not make unrelated children covered. + next(a for a in self.data['states'][0]['applications'] if a['id']=='app-crm')['capabilities']=['sales'] + svg=render.render_svg(self.data,coverage=True) + overlay=ET.fromstring(svg).find("s:g[@class='coverage-overlay']",NS) + ids=json.loads(overlay.get('data-covered-capabilities')) + self.assertEqual(set(ids),{'sales','lead'}) + self.assertNotIn('acquire',ids) + direct=groups(render.render_svg(self.data,coverage=True,system='app-crm')) + self.assertEqual(direct['lead'].get('data-support'),'not-specified') + self.assertEqual(direct['sales'].get('data-support'),'supported') + + def test_unlinked_box_inside_hull_is_cut_out(self): + records=[dict(id='root',name='Domain',layout='vertical',first_level=1,second_level=0,third_level=0,lane=0)] + for i in (1,2,3):records.append(dict(id=f'box-{i}',name=f'Ability {i}',layout='vertical',first_level=1,second_level=i,third_level=0,lane=0)) + data={'coverage_system_id':'system','capabilities':records,'applications':[{'id':'system','name':'System','capabilities':['box-1','box-3']}]} + svg=render.render_svg(data,coverage=True);root=ET.fromstring(svg);gs=groups(svg) + overlay=root.find("s:g[@class='coverage-overlay']",NS) + polygon=overlay.find("s:polygon[@class='coverage-polygon']",NS) + points=[tuple(map(float,p.split(','))) for p in polygon.get('points').split()] + b=rect(gs['box-2']);x=float(b['x'])+float(b['width'])/2;y=float(b['y'])+float(b['height'])/2 + self.assertTrue(all((v[0]-u[0])*(y-u[1])-(v[1]-u[1])*(x-u[0])>=-.1 for u,v in zip(points,points[1:]+points[:1]))) + hole=overlay.find(".//s:rect[@data-excluded-capability='box-2']",NS) + self.assertEqual(hole.get('fill'),'black') + self.assertLess(float(hole.get('x')),x);self.assertGreater(float(hole.get('x'))+float(hole.get('width')),x) + self.assertLess(float(hole.get('y')),y);self.assertGreater(float(hole.get('y'))+float(hole.get('height')),y) + self.assertNotIn('box-2',json.loads(overlay.get('data-covered-capabilities'))) + + def test_no_mapping_off_and_filtered_results(self): + for state in self.data['states']: + app=next(a for a in state['applications'] if a['id']=='app-crm') + app['capabilities']=[];app['technical_capabilities']=[] + root=ET.fromstring(render.render_svg(self.data,coverage=True)) + self.assertFalse(root.findall("s:g[@class='coverage-overlay']",NS)) + self.assertTrue(json.loads(root.find('s:metadata',NS).text)['view']['coverage']) + self.assertFalse(ET.fromstring(render.render_svg(self.data)).findall("s:g[@class='coverage-overlay']",NS)) + data=copy.deepcopy(EXAMPLE) + root=ET.fromstring(render.render_svg(data,coverage=True)) + self.assertEqual(json.loads(root.find('s:metadata',NS).text)['view']['coverage_system_ids'],sorted(str(a['id']) for a in data['states'][0]['applications'])) + + def test_invalid_pilot_and_technical_mappings(self): + data=copy.deepcopy(self.data);data['coverage_system_id']='missing' + with self.assertRaisesRegex(ValueError,'coverage_system_id'):render.render_svg(data) + for value in ({},[{}],[{'id':'x','name':'X','capabilities':['missing']}], + [{'id':'x','name':'X','capabilities':['lead','lead']}], + [{'id':'x','name':'X','capabilities':[]},{'id':'x','name':'X','capabilities':[]}]): + data=copy.deepcopy(self.data) + next(a for a in data['states'][0]['applications'] if a['id']=='app-crm')['technical_capabilities']=value + with self.assertRaises(ValueError):render.render_svg(data) + + def test_acme_coverage_across_filters_and_states(self): + data=json.loads((Path(__file__).resolve().parents[1]/'assets/example.json').read_text()) + for state,layers,depth,tag,backlog,labels in itertools.product(data['states'],(False,True),(1,2,3),('',*render.TAGS),(False,True),(False,True)): + svg=render.render_svg(data,state_id=state['id'],sort_layers=layers,depth=depth,tag_filter=tag,show_backlog=backlog,labels=labels,coverage=True) + gs=groups(svg);app=next(a for a in state['applications'] if a['id']==data['coverage_system_id']) + expected=(set(app['capabilities'])|{i for t in app['technical_capabilities'] for i in t['capabilities']})&gs.keys() + root=ET.fromstring(svg);overlays=root.findall("s:g[@class='coverage-overlay']",NS) + self.assertEqual(len(overlays),int(bool(expected))) + if expected: + overlay=overlays[0] + self.assertEqual(set(json.loads(overlay.get('data-covered-capabilities'))),expected) + self.assertEqual(overlay.get('data-coverage-system'),data['coverage_system_id']) + # An unlinked inventory-master-data card must be cut out in + # Current, even if its geometry is near the hull boundary. + excluded={r.get('data-excluded-capability') for r in overlay.findall('.//s:rect',NS)} + self.assertEqual(set(gs)-expected,excluded) + md=json.loads(root.find('s:metadata',NS).text) + self.assertTrue(md['view']['coverage']) + self.assertEqual(md['view']['coverage_system_id'],data['coverage_system_id']) + + +class MultiSystemCoverage(unittest.TestCase): + def setUp(self): + self.data=json.loads((Path(render.__file__).parent.parent/'assets/example.json').read_text()) + self.ids=['DEMO-APPLICATION-DATA','DEMO-APPLICATION-GOVERNANCE','DEMO-APPLICATION-WAREHOUSE'] + + def test_selection_overlap_colors_masks_and_geometry(self): + for state,layers in itertools.product(self.data['states'],(False,True)): + model=render.normalize(self.data,None);st=next(s for s in model['states'] if s['id']==state['id']) + base=render.build_svg(model,st,layers,tag_filter='MDM') + plain=render.prune_export(render.apply_view(base,st)) + for depth,selected in itertools.product((1,2,3),([],self.ids[:1],self.ids[:2],self.ids)): + svg=render.prune_export(render.apply_view(base,st,depth=depth,coverage=True,coverage_systems=selected)) + root=ET.fromstring(svg);overlays=root.findall("s:g[@class='coverage-overlay']",NS) + gs=groups(svg);md=json.loads(root.find('s:metadata',NS).text) + self.assertEqual(md['view']['coverage_system_ids'],sorted(selected)) + self.assertEqual(geometry(svg),{k:v for k,v in geometry(plain).items() if int(groups(plain)[k].get('data-depth'))<=depth}) + masks=[m.get('id') for m in root.findall('.//s:mask',NS)] + self.assertEqual(len(masks),len(set(masks))) + colors=[] + for overlay in overlays: + aid=overlay.get('data-coverage-system');self.assertIn(aid,selected) + app=next(a for a in state['applications'] if str(a['id'])==aid) + expected=(set(app.get('capabilities',[]))|{i for t in app.get('technical_capabilities',[]) for i in t['capabilities']}) & gs.keys() + self.assertEqual(set(json.loads(overlay.get('data-covered-capabilities'))),expected) + poly=overlay.find("s:polygon[@class='coverage-polygon']",NS);color=poly.get('fill');colors.append(color) + self.assertEqual(color,md['coverage_colors'][aid]) + self.assertIn(poly.get('mask')[5:-1],masks) + self.assertEqual(len(colors),len(set(colors))) + if depth==3 and len(selected)==3 and state['kind']!='historical': + self.assertEqual(len(overlays),3) + shared=set.intersection(*(set(json.loads(g.get('data-covered-capabilities'))) for g in overlays)) + self.assertIn('DEMO-CAPABILITY-H3.2.1',shared) + self.assertIn('DEMO-CAPABILITY-H3.1',shared) + + def test_invalid_and_empty_selections_and_master_switch(self): + for selected in ('bad',['missing'],[self.ids[0],self.ids[0]],[1]): + with self.assertRaises(ValueError):render.render_svg(self.data,coverage=True,coverage_systems=selected) + for on,selected in ((True,[]),(False,self.ids)): + root=ET.fromstring(render.render_svg(self.data,coverage=on,coverage_systems=selected)) + self.assertFalse(root.findall("s:g[@class='coverage-overlay']",NS)) + root=ET.fromstring(render.render_svg(self.data,coverage=True,coverage_systems=['DEMO-APPLICATION-ESG'])) + self.assertFalse(root.findall("s:g[@class='coverage-overlay']",NS)) + colors=render.coverage_colors(render.normalize(self.data,None)) + self.assertEqual(len(colors),len(set(colors.values()))) + + def test_cli_repeated_system_selection(self): + with tempfile.TemporaryDirectory() as directory: + source=Path(directory)/'model.json';target=Path(directory)/'map.svg';source.write_text(json.dumps(self.data)) + command=[sys.executable,str(Path(render.__file__)),str(source),str(target)] + failed=subprocess.run(command+['--coverage-system',self.ids[0]],capture_output=True,text=True) + self.assertNotEqual(failed.returncode,0) + good=subprocess.run(command+['--coverage','--coverage-system',self.ids[0],'--coverage-system',self.ids[1]],capture_output=True,text=True) + self.assertEqual(good.returncode,0,good.stderr) + root=ET.fromstring(target.read_text()) + self.assertEqual({g.get('data-coverage-system') for g in root.findall("s:g[@class='coverage-overlay']",NS)},set(self.ids[:2])) + + +class DateTimeline(unittest.TestCase): + def setUp(self): + self.data={'states':[{'id':'year','label':'Recorded year','kind':'current','as_of':'2026-06-15', + 'effective_from':'2026-01-01','effective_to':'2027-01-01', + 'capabilities':[ + {'id':'root','name':'Domain','layout':'vertical','first_level':1,'second_level':0,'third_level':0,'lane':0,'maturity':[{'change_date':'2026-01-01','level':1},{'change_date':'2026-03-01','level':2}]}, + {'id':'child','name':'Business ability','layout':'vertical','first_level':1,'second_level':1,'third_level':0,'lane':0,'start_date':'2026-04-01','end_date':'2026-06-30'}, + {'id':'leaf','name':'Nested ability','layout':'vertical','first_level':1,'second_level':1,'third_level':1,'lane':0,'start_date':'2026-05-01','end_date':'2026-06-30'}], + 'applications':[{'id':'app','name':'System','start_date':'2026-03-01','end_date':'2026-10-31','capabilities':['child'], + 'technical_capabilities':[{'id':'tech','name':'Technical ability','start_date':'2026-05-01','end_date':'2026-05-31','capabilities':['leaf']}]}]}]} + + def test_date_boundaries_lifetimes_maturity_and_coverage(self): + for when,expected,covered,level in [ + ('2026-01-01',{'root'},set(),'Initial'),('2026-03-31',{'root'},set(),'Managed'), + ('2026-04-01',{'root','child'},{'child'},'Managed'), + ('2026-05-15',{'root','child','leaf'},{'child','leaf'},'Managed'), + ('2026-06-01',{'root','child','leaf'},{'child'},'Managed'), + ('2026-06-30',{'root','child','leaf'},{'child'},'Managed'), + ('2026-07-01',{'root'},set(),'Managed'),('2026-12-31',{'root'},set(),'Managed')]: + for layers in (False,True): + svg=render.render_svg(self.data,view_date=when,coverage=True,show_maturity=True,sort_layers=layers) + self.assertEqual(set(groups(svg)),expected) + root=ET.fromstring(svg);md=json.loads(root.find('s:metadata',NS).text) + self.assertEqual(md['view_date'],when);self.assertEqual(md['as_of'],when) + self.assertEqual(md['view']['view_date'],when) + self.assertEqual(md['snapshot_as_of'],'2026-06-15') + overlays=root.findall("s:g[@class='coverage-overlay']",NS) + self.assertEqual(set().union(*(set(json.loads(g.get('data-covered-capabilities'))) for g in overlays)),covered) + self.assertIn(level,' '.join(root.itertext())) + for when in ('2025-12-31','2027-01-01','2029-01-01','invalid'): + with self.assertRaises(ValueError):render.render_svg(self.data,view_date=when) + + def test_period_validation_and_gaps(self): + for edits in ({'effective_to':'2026-01-01'},{'effective_from':None},{'effective_from':'bad'}): + data=copy.deepcopy(self.data);data['states'][0].update(edits) + with self.assertRaises(ValueError):render.normalize(data) + data=copy.deepcopy(self.data);second=copy.deepcopy(data['states'][0]);second.update(id='next',kind='target',effective_from='2026-12-31',effective_to='2028-01-01');data['states'].append(second) + with self.assertRaisesRegex(ValueError,'overlap'):render.normalize(data) + second['effective_from']='2027-02-01' + with self.assertRaisesRegex(ValueError,'No state data'):render.render_svg(data,view_date='2027-01-15') + svg=render.render_svg(data,view_date='2027-02-01');root=ET.fromstring(svg) + self.assertEqual(json.loads(root.find('s:metadata',NS).text)['state_kind'],'target') + self.assertIn('Planned scenario',' '.join(root.itertext())) + with self.assertRaisesRegex(ValueError,'does not apply'):render.render_svg(data,view_date='2027-02-01',state_id='year') + for path in ('app','tech'): + bad=copy.deepcopy(self.data);item=bad['states'][0]['applications'][0] + if path=='tech':item=item['technical_capabilities'][0] + item.update(start_date='2027-01-01',end_date='2026-01-01') + with self.assertRaisesRegex(ValueError,'reversed lifetime'):render.normalize(bad) + bad=copy.deepcopy(self.data);bad['states'][0]['capabilities'][0]['end_date']='2026-04-30' + with self.assertRaisesRegex(ValueError,'inactive parent'):render.timeline_frames(render.normalize(bad)) + + def test_frames_match_arbitrary_dates_without_daily_interpolation(self): + model=render.normalize(self.data);frames=render.timeline_frames(model) + self.assertEqual([s['frame_from'].isoformat() for s in frames],['2026-01-01','2026-03-01','2026-04-01','2026-05-01','2026-06-01','2026-07-01','2026-11-01']) + for frame in frames: + last=(frame['frame_to'] or render.date('2027-01-01'))-render.dt.timedelta(days=1) + actual=render.state_on(model,last) + self.assertEqual([r['id'] for r in frame['records']],[r['id'] for r in actual['records']]) + self.assertEqual(frame['applications'],actual['applications']) + self.assertEqual([render.maturity(r,frame['as_of']) for r in frame['records']],[render.maturity(r,last) for r in actual['records']]) + # Legacy snapshots still work but cannot silently stand in for a dated timeline. + with self.assertRaisesRegex(ValueError,'No state data'):render.render_svg(EXAMPLE,view_date='2026-10-23') + + def test_acme_history_current_future_and_exact_date_exports(self): + data=json.loads((Path(render.__file__).parent.parent/'assets/example.json').read_text());model=render.normalize(data) + for when,expected in [('2026-06-15','historical'),('2026-10-01','current'),('2026-10-23','current'),('2027-06-15','target')]: + st=render.state_on(model,when);self.assertEqual(st['id'],expected) + for layers in (False,True): + svg=render.render_svg(data,view_date=when,sort_layers=layers,coverage=True,coverage_systems=['DEMO-APPLICATION-DATA'],tag_filter='MDM') + self.assertIn(when,' '.join(ET.fromstring(svg).itertext())) + self.assertEqual('DEMO-CAPABILITY-H3.2.1' in groups(svg),when>='2026-10-22') + for when in ('2026-05-31','2028-01-01'): + with self.assertRaisesRegex(ValueError,'No state data'):render.render_svg(data,view_date=when) + with tempfile.TemporaryDirectory() as directory: + source=Path(directory)/'model.json';target=Path(directory)/'map.svg';source.write_text(json.dumps(data)) + command=[sys.executable,str(Path(render.__file__)),str(source),str(target),'--date','2027-06-15'] + result=subprocess.run(command,capture_output=True,text=True);self.assertEqual(result.returncode,0,result.stderr) + self.assertEqual(target.read_text(),render.render_svg(data,view_date='2027-06-15')) + + +class ContextLegend(unittest.TestCase): + def setUp(self): + self.data=copy.deepcopy(EXAMPLE);self.data['coverage_system_id']='app-crm' + + def test_default_empty_footer_and_metadata_provenance(self): + root=ET.fromstring(render.render_svg(self.data)) + legend=root.find("s:g[@class='legend']",NS) + self.assertEqual(len(legend),0) + self.assertEqual(float(root.get('height')),float(root.get('data-content-bottom'))+20) + visible=' '.join(''.join(n.itertext()) for n in root.findall('.//s:text',NS)) + for text in ('Model revision:','Methodology baseline:','Adapter:','Renderer:','View adapter only'): + self.assertNotIn(text,visible) + md=json.loads(root.find('s:metadata',NS).text) + self.assertEqual(md['renderer_version'],render.RENDERER_VERSION) + self.assertIn('not full methodology conformance',md['view_contract']) + self.assertIn('Missing mapping',md['mapping_semantics']) + + def test_enabled_mode_entries_and_legend_off(self): + for maturity,labels,coverage in itertools.product((False,True),repeat=3): + svg=render.render_svg(self.data,show_maturity=maturity,labels=labels,coverage=coverage) + root=ET.fromstring(svg);text=' '.join(root.find("s:g[@class='legend']",NS).itertext()) + self.assertEqual('Maturity:' in text,maturity) + self.assertEqual('System labels:' in text,labels) + self.assertEqual('Coverage:' in text,coverage) + self.assertNotIn('Outline:',text) + if coverage:self.assertIn('area is not a percentage',text) + hidden=ET.fromstring(render.render_svg(self.data,show_maturity=maturity,labels=labels,coverage=coverage,legend=False)) + self.assertFalse(hidden.findall("s:g[@class='legend']",NS)) + self.assertEqual(float(hidden.get('height')),float(hidden.get('data-content-bottom'))+20) + self.assertEqual(geometry(svg),geometry(ET.tostring(hidden,encoding='unicode'))) + text=' '.join(ET.fromstring(render.render_svg(self.data,system='app-crm',sort_layers=True)).find("s:g[@class='legend']",NS).itertext()) + self.assertIn('Outline:',text);self.assertIn('Bands:',text) + + def test_maturity_visual_key_samples_and_footer_bounds(self): + shown=render.render_svg(self.data,show_maturity=True) + root=ET.fromstring(shown);tiles=root.findall(".//s:g[@class='maturity-legend-item']",NS) + self.assertEqual([t.get('data-maturity-level') for t in tiles],list(map(str,range(6)))) + for i,tile in enumerate(tiles): + sample=tile.find('s:rect',NS) + self.assertIn('caprect',sample.get('class').split());self.assertIn(f'm{i}',sample.get('class').split()) + self.assertEqual(sample.get('stroke-width'),'3') + self.assertIn(render.LEVELS[i],''.join(tile.itertext())) + self.assertIn(render.MATURITY_LEGEND[i]['description'],''.join(tile.itertext())) + self.assertLess(float(sample.get('x'))+float(sample.get('width')),float(root.get('width'))) + self.assertLess(float(sample.get('y'))+float(sample.get('height')),float(root.get('height'))) + for kwargs in ({},{'show_maturity':True,'legend':False},{'show_maturity':False}): + hidden=ET.fromstring(render.render_svg(self.data,**kwargs)) + self.assertFalse(hidden.findall(".//s:g[@class='maturity-legend-item']",NS)) + hidden=render.render_svg(self.data,show_maturity=True,legend=False) + self.assertEqual(geometry(shown),geometry(hidden)) + self.assertGreater(float(root.get('height')),float(ET.fromstring(hidden).get('height'))) + + def test_unmapped_coverage_and_context_filter(self): + data=copy.deepcopy(self.data) + for state in data['states']: + next(a for a in state['applications'] if a['id']=='app-crm')['capabilities']=[] + next(r for r in state['capabilities'] if r['id']=='lead')['tags']=['MDM'] + root=ET.fromstring(render.render_svg(data,coverage=True,tag_filter='MDM')) + text=' '.join(root.find("s:g[@class='legend']",NS).itertext()) + self.assertIn('Muted boxes:',text);self.assertNotIn('Coverage:',text) + for state in data['states']: + for record in state['capabilities']: + record['tags']=[t for t in record.get('tags',[]) if t!='ESG'] + if record.get('property')=='ESG':record['property']=None + root=ET.fromstring(render.render_svg(data,coverage=True,tag_filter='ESG')) + self.assertEqual(len(root.find("s:g[@class='legend']",NS)),0) + + +class CoverageShapes(unittest.TestCase): + def test_rectangular_and_independent_rounding(self): + hull=[(0,0),(100,0),(100,50),(40,80),(0,50)] + self.assertEqual(render.coverage_shape_points(hull),hull) + rectangle=render.coverage_shape_points(hull,'rectangular') + self.assertEqual(rectangle,[(0,0),(100,0),(100,80),(0,80)]) + for shape,count in [('angled',len(hull)),('rectangular',4)]: + rounded=render.coverage_shape_points(hull,shape,True) + self.assertEqual(len(rounded),count*9) + self.assertTrue(all(0<=x<=100 and 0<=y<=80 for x,y in rounded)) + self.assertNotIn((0,0),rounded) + with self.assertRaisesRegex(ValueError,'coverage shape'):render.coverage_shape_points(hull,'circle') + + def test_native_shapes_masks_overlap_and_restore(self): + data=json.loads((Path(render.__file__).parent.parent/'assets/example.json').read_text()) + ids=['APPLICATION-CRM-1','APPLICATION-OMS-1','DEMO-APPLICATION-GOVERNANCE'] + for shape,rounded,layers,depth in itertools.product(('angled','rectangular'),(False,True),(False,True),(2,3)): + svg=render.render_svg(data,view_date='2026-10-23',show_backlog=False,coverage=True,coverage_systems=ids,functional_overlap=True,coverage_shape=shape,round_coverage=rounded,sort_layers=layers,depth=depth) + root=ET.fromstring(svg);md=json.loads(root.find('s:metadata',NS).text) + self.assertEqual(md['view']['coverage_shape'],shape);self.assertEqual(md['view']['round_coverage'],rounded) + self.assertTrue(root.findall(".//s:g[@class='functional-overlap-region']",NS)) + for g in root.findall("s:g[@class='coverage-overlay']",NS): + polygon=g.find("s:polygon[@class='coverage-polygon']",NS) + self.assertEqual(polygon.get('points'),g.find('s:defs/s:mask/s:polygon',NS).get('points')) + hull=[tuple(map(float,p.split(','))) for p in polygon.get('data-coverage-hull').split()] + expected=render.coverage_shape_points(hull,shape,rounded) + self.assertEqual(polygon.get('points'),' '.join(f'{x:.4f},{y:.4f}' for x,y in expected)) + render.apply_coverage_shape(root,'angled',False) + for g in root.findall("s:g[@class='coverage-overlay']",NS): + p=g.find("s:polygon[@class='coverage-polygon']",NS) + actual=[tuple(map(float,v.split(','))) for v in p.get('points').split()] + expected=[tuple(map(float,v.split(','))) for v in p.get('data-coverage-hull').split()] + self.assertEqual(actual,expected) + with self.assertRaisesRegex(ValueError,'coverage shape'):render.render_svg(data,coverage_shape='circle') + +class FunctionalOverlap(unittest.TestCase): + def setUp(self): + self.data=copy.deepcopy(EXAMPLE) + for state in self.data['states']: + state['applications']=[{'id':'a','name':'System A <&>','capabilities':['acquire'],'technical_capabilities':[{'id':'t1','name':'First ability','capabilities':['acquire']}]}, + {'id':'b','name':'System B','capabilities':['lead'],'technical_capabilities':[{'id':'t2','name':'Second ability','capabilities':['acquire']}]}, + {'id':'c','name':'System C','capabilities':['acquire']}] + + def test_adjacent_acme_domains_do_not_overlap_from_padding(self): + data=json.loads((Path(render.__file__).parent.parent/'assets/example.json').read_text()) + ids=['APPLICATION-CRM-1','APPLICATION-OMS-1'] + for layers,depth in itertools.product((False,True),(1,2,3)): + svg=render.render_svg(data,view_date='2026-10-23',sort_layers=layers,depth=depth,show_backlog=False,coverage=True,coverage_systems=ids,functional_overlap=True) + root=ET.fromstring(svg) + overlays=root.findall("s:g[@class='coverage-overlay']",NS) + self.assertEqual(len(overlays),2) + hulls=[[tuple(map(float,p.split(','))) for p in g.find("s:polygon[@class='coverage-polygon']",NS).get('points').split()] for g in overlays] + self.assertLess(max(x for x,y in hulls[1]),min(x for x,y in hulls[0])) + self.assertFalse(root.findall("s:g[@class='functional-overlap']",NS)) + self.assertEqual(json.loads(root.find('s:metadata',NS).text)['view']['functional_overlap_system_pairs'],[]) + + def test_convex_polygon_intersections(self): + square=[(0,0),(10,0),(10,10),(0,10)] + self.assertEqual(render.polygon_intersection(square,[(20,0),(30,0),(30,10),(20,10)]),[]) + self.assertEqual(render.polygon_intersection(square,[(10,0),(20,0),(20,10),(10,10)]),[]) + overlap=render.polygon_intersection(square,[(5,-5),(15,-5),(15,5),(5,5)]) + self.assertEqual(set(overlap),{(5,0),(10,0),(10,5),(5,5)}) + inner=[(2,2),(8,2),(8,8),(2,8)] + self.assertEqual(set(render.polygon_intersection(square,inner)),set(inner)) + + def test_polygon_regions_and_union_boundary(self): + plain=render.render_svg(self.data,coverage=True,coverage_systems=['a','b','c']) + svg=render.render_svg(self.data,coverage=True,coverage_systems=['a','b','c'],functional_overlap=True) + self.assertEqual(geometry(plain),geometry(svg)) + root=ET.fromstring(svg);regions=root.findall(".//s:g[@class='functional-overlap-region']",NS) + self.assertEqual(len(regions),3) + self.assertFalse(root.findall("s:g[@class='functional-overlap']/s:rect",NS)) + boundary=root.find(".//s:g[@class='functional-overlap-outline']",NS) + self.assertEqual(boundary.get('filter'),'url(#functional-overlap-edge)') + for pair in regions: + self.assertEqual(len(json.loads(pair.get('data-overlap-systems'))),2) + self.assertIsNone(pair.get('mask')) + self.assertFalse(pair.findall('.//*[@mask]')) + self.assertTrue(pair.find('s:polygon',NS).get('points')) + self.assertIn('Red contour:',' '.join(root.find("s:g[@class='legend']",NS).itertext())) + + def test_box_cutouts_do_not_change_the_outer_overlap_boundary(self): + svg=render.render_svg(self.data,coverage=True,coverage_systems=['a','b','c'],functional_overlap=True) + root=ET.fromstring(svg) + self.assertTrue(root.findall(".//s:rect[@class='coverage-cutout']",NS)) + boundary=root.find("s:g[@class='functional-overlap']",NS) + before=ET.tostring(boundary) + for hole in root.findall(".//s:rect[@class='coverage-cutout']",NS): + hole.set('width','10000');hole.set('height','10000') + render.update_functional_overlap(root,{},True) + self.assertEqual(ET.tostring(root.find("s:g[@class='functional-overlap']",NS)),before) + + def test_off_single_system_and_coverage_master(self): + for coverage,flag,ids in ((True,False,['a','b']),(False,True,['a','b']),(True,True,['a']),(True,True,[])): + root=ET.fromstring(render.render_svg(self.data,coverage=coverage,functional_overlap=flag,coverage_systems=ids)) + self.assertFalse(root.findall("s:g[@class='functional-overlap']",NS)) + md=json.loads(root.find('s:metadata',NS).text) + self.assertFalse(md['view']['functional_overlap']);self.assertEqual(md['view']['functional_overlap_system_pairs'],[]) + root=ET.fromstring(render.render_svg(self.data,coverage=True,coverage_systems=['a','b'],functional_overlap=True,legend=False)) + self.assertEqual(len(root.findall(".//s:g[@class='functional-overlap-region']",NS)),1) + self.assertFalse(root.findall("s:g[@class='legend']",NS)) + + def test_acme_date_depth_and_filters(self): + data=json.loads((Path(render.__file__).parent.parent/'assets/example.json').read_text());model=render.normalize(data) + ids=['DEMO-APPLICATION-DATA','DEMO-APPLICATION-GOVERNANCE','DEMO-APPLICATION-WAREHOUSE'] + for when,layers,depth,tag in itertools.product(('2026-06-15','2026-10-21','2026-10-23','2027-01-01'),(False,True),(1,2,3),('', 'MDM','ESG')): + state=render.state_on(model,when) + svg=render.render_svg(data,view_date=when,sort_layers=layers,depth=depth,tag_filter=tag,show_backlog=False,coverage=True,coverage_systems=ids,functional_overlap=True) + root=ET.fromstring(svg) + active=root.findall("s:g[@class='coverage-overlay'][@data-coverage-visible='yes']",NS) + expected=[] + for i,left in enumerate(active): + for right in active[i+1:]: + points=[[tuple(map(float,p.split(','))) for p in g.find("s:polygon[@class='coverage-polygon']",NS).get('points').split()] for g in (left,right)] + if render.polygon_intersection(*points):expected.append(sorted([left.get('data-coverage-system'),right.get('data-coverage-system')])) + regions=root.findall(".//s:g[@class='functional-overlap-region']",NS) + actual=[json.loads(n.get('data-overlap-systems')) for n in regions] + self.assertEqual(actual,expected) + self.assertEqual(json.loads(root.find('s:metadata',NS).text)['view']['functional_overlap_system_pairs'],expected) + with tempfile.TemporaryDirectory() as directory: + source=Path(directory)/'model.json';target=Path(directory)/'map.svg';source.write_text(json.dumps(data)) + command=[sys.executable,str(Path(render.__file__)),str(source),str(target),'--functional-overlap'] + bad=subprocess.run(command,capture_output=True,text=True);self.assertNotEqual(bad.returncode,0) + good=subprocess.run(command+['--coverage','--coverage-system',ids[0],'--coverage-system',ids[1]],capture_output=True,text=True) + self.assertEqual(good.returncode,0,good.stderr) + self.assertTrue(ET.fromstring(target.read_text()).findall(".//s:g[@class='functional-overlap-region']",NS)) + +if __name__ == '__main__': + unittest.main() diff --git a/transitrix/skills/requirements-analysis/README.md b/transitrix/skills/requirements-analysis/README.md new file mode 100644 index 00000000..f56732d3 --- /dev/null +++ b/transitrix/skills/requirements-analysis/README.md @@ -0,0 +1,46 @@ +# Requirements-analysis skill + +Analyse the requirements of a PRODUCT or APPLICATION for a selected release +and date, optionally filtered by project. Invoke `/transitrix:requirements-analysis` +or give any assistant [SKILL.md](SKILL.md); the instructions use the standalone +CLI and do not depend on an editor or a particular assistant runtime. + +This is part of the existing [Transitrix plugin](../../README.md). Install or +update that plugin using its normal instructions; hosts discover +`skills/requirements-analysis/SKILL.md` alongside the other skills. There is no +separate skill package or personal installation channel. The shared plugin +version and methodology release process remain authoritative. + +## Examples + +- “Analyse APPLICATION-ALPHA-1, RELEASE-ALPHA-2, as at 2026-09-24, for + ACTION-ALPHA-1.” An internal application needs no manufactured product. +- “Analyse internal PRODUCT-ALPHA-1, RELEASE-ALPHA-2, as at 2026-09-24.” + Internal use does not turn a product into an application. +- “Analyse physical PRODUCT-ALPHA-1 at RELEASE-ALPHA-2 on 2026-09-24.” + The subject remains a product, independently of its physical form. +- “Analyse SaaS PRODUCT-ALPHA-1 at RELEASE-ALPHA-2 on 2026-09-24.” + Supporting applications are context, not implicit membership or evidence. + +These are independent synthetic selections, not an installed example catalogue. +See the [accepted four-case oracle](https://github.com/transitrix/methodology/blob/a131b1862d86f34be8feb729e1cc6ebc994c3891/notations/examples/requirement-subject-scope/README.md). +Missing essential scope prompts a question; the skill never guesses a release +or date. Omitted project means no project filter. + +## Tool and output + +The supported handoff is the built `@transitrix/cli` 2.12.0 candidate at +`bfc60f81bd0b7fe01dd9fac41ba4b1d4bc447730`, Node >=20, +`requirements-report/1` / `requirement-chain/0.3`. This is not an npm-publication +claim. CLI 2.11.0 is unsupported. See [the invocation and support checks](SKILL.md#1-resolve-scope-and-support) +before use. Missing tools or unsupported versions produce an unavailable result. + +The skill retains the exact CLI response, normalized request, invocation and +provenance as a report receipt, then separates computed facts, interpretation +and proposed actions. The receipt is a tooling artifact, not admitted model +data. Known IDs with incomplete totals remain incomplete; absent evidence never +becomes a passed verification. Recommendations do not write the model. + +For regulatory obligation matrices and compliance coverage, use the existing +[report skill](../report/README.md). It retains its own CLI and view-config +workflow unchanged. diff --git a/transitrix/skills/requirements-analysis/SKILL.md b/transitrix/skills/requirements-analysis/SKILL.md new file mode 100644 index 00000000..d27d290f --- /dev/null +++ b/transitrix/skills/requirements-analysis/SKILL.md @@ -0,0 +1,133 @@ +--- +name: requirements-analysis +description: "Analyse PRODUCT or APPLICATION requirements for an explicit release and date using the supported Transitrix scan-plus-report CLI. Return exact computed IDs, counts and diagnostics separately from interpretation and proposed actions." +when_to_use: 'User asks "analyse requirements for this application", "which product requirements lack verification", or "show release requirements gaps". For regulatory obligation matrices or compliance coverage, use the report skill instead.' +min_version: "7.0.0" +allowed-tools: Read, Write, Bash, Glob, Grep +--- + +# Requirements analysis + +Use `@transitrix/cli requirements-report` as the sole source of computed facts. +This skill is distributed in the existing [Transitrix plugin](../../README.md) +as `/transitrix:requirements-analysis`. Any assistant can read this file and +invoke the command; no editor, runtime-specific API or source import is needed. + +## 1. Resolve scope and support + +Resolve parameters from the request, then a report receipt the user explicitly +selected. Ask for missing essential scope; if no answer is available, report the +missing fields and stop. Do not guess a subject, latest release or today's date. + +| Parameter | Required choice / default | +|---|---| +| Catalogue root | Explicit root, or current directory only when it contains the intended `transitrix.yaml`. Ask if there are multiple catalogues. | +| Subject | Explicit `PRODUCT` or `APPLICATION` and exact model ID. Resolve a supplied name to an unambiguous ID with the user; never choose TYPE from internal use versus sale. | +| Release | Exact RELEASE ID belonging to the selected subject. Never substitute another release after a diagnostic. | +| As-at | Explicit valid `YYYY-MM-DD`; preserve the requested date. | +| Project | Optional ACTION(Project) ID; omission means no project filter. | +| Expected source revision | Optional full Git commit supplied by the user; otherwise no revision assertion. It does not select or check out a revision. | + +State the resolved scope and defaults before running: no project filter when +omitted, no revision assertion when omitted, JSON transport. Internal, external +and mixed use are independent of subject TYPE. A physical PRODUCT is valid; +an APPLICATION does not require creating a PRODUCT. This analysis never authors +membership, releases, vocabulary or model records. + +**Support boundary:** the caller handoff is `@transitrix/cli` **2.12.0 source +candidate**, source revision `bfc60f81bd0b7fe01dd9fac41ba4b1d4bc447730`, Node >=20, +transport `requirements-report/1`, projection `requirement-chain/0.3`, bound to +contract revision `a131b1862d86f34be8feb729e1cc6ebc994c3891`. See the +[versioned caller documentation](https://github.com/transitrix/transitrix-studio/blob/bfc60f81bd0b7fe01dd9fac41ba4b1d4bc447730/packages/cli/README.md#requirements-reports) +and [accepted scope contract](https://github.com/transitrix/methodology/blob/a131b1862d86f34be8feb729e1cc6ebc994c3891/notations/views/reports/requirement-subject-scope.md). +The methodology floor above is not a claim that 7.0.0 tools implement 0.3. + +Locate the installed executable and inspect its package documentation. If absent, +stop with “requirements analysis unavailable: supported CLI missing”. A supplied +candidate tarball can be installed in an isolated tooling directory using +`npm install --ignore-scripts /path/to/transitrix-cli-2.12.0.tgz`. Do not silently +install, upgrade or use an unpinned `npx` download. The earlier CLI 2.11.0 does not +support this command. A usage error is not evidence of interface support. +Candidate availability and npm publication are separate; do not describe the +candidate as published. For another version, obtain its declared compatible +transport/projection contract before treating its output as supported. + +## 2. Invoke and retain the receipt + +Invoke the installed binary directly, passing arguments as separate values +(quote shell values; never execute model text as commands). Example with explicit +scope; replace these synthetic IDs with the resolved selection: + +```sh +transitrix requirements-report \ + --root ./model \ + --subject-type APPLICATION --subject-id APPLICATION-ALPHA-1 \ + --release RELEASE-ALPHA-2 --project ACTION-ALPHA-1 \ + --as-at 2026-09-24 --json +``` + +For PRODUCT, change both subject TYPE and ID. Omit `--project` for an unfiltered +release report. If requested, append `--expect-source-revision `. +This is a source assertion, never a provenance override. Do not use the older +PRODUCT-only 0.2 adapter for this skill or recreate the graph from model files. + +Capture stdout, stderr and exit status separately. Preserve the complete, +unmodified JSON response and exact invocation with the analysis as its report +receipt. The response's `request` is the normalized scope/config; no new model +notation or view-config schema is needed. For a saved report, use the user's +chosen report-output location outside `canon/`, `field/` and `codex/`, avoid +replacing existing files, and save the invocation and diagnostics alongside it. +If no output location was requested, retain the response as a session artifact +and disclose its location and lifetime. Do not commit automatically. + +On rerun, use the retained request's explicit scope with an available local root +and the same compatible tool. Compare returned provenance, including the content +snapshot, instead of claiming identical input from the same Git commit alone. +A dirty working tree can differ at one revision; non-Git sources can still have +content provenance. Two scans detect observed changes, not atomic capture. + +## 3. Validate the returned envelope + +Read the entire response before summarizing. Check `schemaVersion`, `tool` +(name/version/source revision), returned request, source provenance, projection +contract version/revision and completeness against the selected interface. +Keep `source`, `projection`, `counts` and `errors` intact. Unknown versions, +missing required fields, malformed JSON, scope mismatch or inconsistent +status/exit code mean **unsupported or unavailable**, never a passed report. + +| Exit | Meaning | Required treatment | +|---|---|---| +| 0 | Complete computation | Still inspect verification failures and diagnostics; computation success is not verification success. | +| 2 | Incomplete but available | Retain known IDs, nullable totals and diagnostics. An empty known-ID list with unknown total is not zero. | +| 1 | Fatal; projection/counts null | Report the errors and unavailable result. Do not fill in totals or fall back to a previous result as current. | +| Other / no envelope | Invocation failure or unsupported interface | Preserve diagnostics and stop analysis; do not reconstruct a report. | + +Unresolved membership, invalid subject/release, missing project pairing, failed +reads and malformed data must remain visible. Absent verification definitions, +no applicable executed result, inconclusive execution and failed verification +are distinct findings. Child evidence does not verify a parent; other-release +or unqualified evidence does not verify the selected release. Do not repair +inputs or suppress diagnostics to obtain a complete result. + +## 4. Present analysis in three separate parts + +1. **Computed facts:** identify subject TYPE/ID, release, optional project, as-at, + tool/contract versions, source revision/dirty state/content snapshot and + complete/incomplete/unavailable status. Quote exact returned population, + stage, assignment and six-metric IDs/totals, with their completeness and + diagnostics. In 0.3 the retained `populations.product` key labels the + **subject population**, including APPLICATION. Do not count the ID arrays, + sum overlapping metrics, infer percentages or add a quality score. +2. **Interpretation:** explain what those specific IDs mean within this scope. + Cite returned record/edge identities and provenance for each finding; label + hypotheses and absent evidence. A complete computation can describe missing + verification; it does not certify the requirements or the business outcome. +3. **Recommended actions:** propose review of named missing sources, membership, + assignment or verification evidence, tied to the same IDs and receipt. Where + the result cannot identify an owner or cause, say so. These are proposals; + do not edit the model, create a replacement PRODUCT, transfer verification + across subjects or run an implementation workflow. + +Link the retained receipt so the reader can inspect every fact. Keep the +analysis within its catalogue audience: unlike the data-free repo-check skill, +this report contains model IDs and source details.