Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions docs/COMMAND_F_MASTER_ARCHITECTURE_V2.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@ Any future source profiler that touches instances must be a separate on-premises

Each CF slice is a Spec Kit-style feature unit with `spec.md`, `plan.md`, and `tasks.md`, followed by consistency analysis, implementation, deterministic evidence, and a convergence pass. The specification states **what/why**; the plan states **how**; tasks are independently verifiable work items. Feature architecture must not be smuggled into the constitution or treated as completed merely because documentation exists.

## Roadmap identity reconciliation

Canonical execution used `CF-11` for the multi-version package-graph foundation correction required to represent real transitive FHIR package closures. That completed history is retained exactly and is not renamed.

The ecosystem Context Graph originally planned under numeric CF-11 still remains a required prerequisite for `CF-12 commandf impact`. To restore that missing product capability without rewriting history or shifting every downstream identifier, the graph-gap restoration slice is named:
Comment on lines +124 to +126

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

2. Sibling roadmap remains stale 🐞 Bug ⚙ Maintainability

The reconciliation reassigns CF-11 to the multi-version foundation and creates CF-11G for the
Context Graph, but COMMAND_F_DISCOVERY_COVERAGE_2026-08-13.md still says its execution stack is
unchanged and lists CF-11 as the Context Graph immediately before CF-12. This leaves the
authoritative plan set with conflicting slice identities and sequencing despite consistency.md
declaring the roadmap contradiction closed.
Agent Prompt
## Issue description
The new CF-11/CF-11G identity mapping conflicts with the retained execution list in the discovery-coverage authority.

## Issue Context
Update the sibling roadmap to preserve historical CF-11 while inserting CF-11G before CF-12, or explicitly replace its numbered list with a pointer to the canonical Master Architecture stack.

## Fix Focus Areas
- docs/COMMAND_F_MASTER_ARCHITECTURE_V2.md[122-134]
- docs/COMMAND_F_DISCOVERY_COVERAGE_2026-08-13.md[642-663]
- specs/012-cf-11g-ecosystem-context-graph/consistency.md[18-43]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


```text
CF-11G = ecosystem Context Graph + `commandf context`
```

`CF-11G` is a product slice identity. Its Spec Kit package uses sequence `012` only because that is the next available spec-directory sequence. CF-12 and later product identifiers remain unchanged.

The graph slice consumes exact multi-version package identity from canonical CF-11 and canonical artifact inspection from CF-02. It does not depend on the external CF-06/CF-10 HL7-maintainer gate.

## First execution stack

| Slice | User-visible result | Depends on |
Expand All @@ -133,12 +147,13 @@ Each CF slice is a Spec Kit-style feature unit with `spec.md`, `plan.md`, and `t
| CF-08 | GitHub Action + annotations | CF-05 |
| CF-09 | FSH source mapping | CF-08 |
| CF-10 | public real-IG delta corpus | CF-06, CF-07 |
| CF-11 | ecosystem context graph | CF-02 |
| CF-12 | `commandf impact` | CF-11 |
| CF-11 | multi-version package graph foundation correction | CF-01 |
| CF-11G | ecosystem Context Graph + `commandf context` | CF-02, CF-11 |
| CF-12 | `commandf impact` | CF-11G |
| CF-13 | baselines/suppression/quality gates | CF-05 |
| CF-14 | on-prem aggregate-only source profiler | CF-02 |
| CF-15 | verified dry-run recipes | CF-04, CF-09 |
| CF-16 | mapping analysis IR, parse-only | CF-11 |
| CF-16 | mapping analysis IR, parse-only | CF-11G |

## Mandatory acceptance gates

Expand Down
211 changes: 211 additions & 0 deletions specs/012-cf-11g-ecosystem-context-graph/consistency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
# CF-11G Consistency Analysis — Ecosystem Context Graph

Status: PASS / planning consistency closed

## Inputs reviewed

- `AGENTS.md`;
- `.specify/memory/constitution.md`;
- `docs/COMMAND_F_MASTER_ARCHITECTURE_V2.md`;
- `docs/COMMAND_F_DISCOVERY_COVERAGE_2026-08-13.md`;
- canonical CF-11 multi-version package-graph `spec.md` and `plan.md`;
- current `Lockfile` schema-v1 implementation;
- current resolver implementation;
- current CF-02 `PackageInspection` / `ResourceArtifact` model;
- current CLI command surface;
- issue #19 roadmap reconciliation boundary.

## Roadmap contradiction

### Observed

The Master Architecture originally assigned:

```text
CF-11 = ecosystem context graph
CF-12 = commandf impact
```

Canonical execution later used CF-11 for the multi-version package-graph foundation correction, and that work is already merged/history-bearing.

### Resolution

Use `CF-11G` as the graph-gap restoration identity.

Properties of this decision:

- completed CF-11 history is not renamed or rewritten;
- CF-12 remains `commandf impact`;
- CF-13..CF-16 do not shift;
- the next Spec Kit sequence is `012`, but sequence number and product slice identity are explicitly separate;
- mapping IR work that requires the Context Graph depends on CF-11G rather than the historical numeric CF-11 alone.

Result: PASS.

## Vertical-slice check

### Constitution requirement

Every feature must produce a user-visible command, report, annotation, or independently executable verification result.

### Resolution

CF-11G ships `commandf context` with deterministic JSON graph output. The graph is independently inspectable before `commandf impact` exists.

Result: PASS.

## Determinism check

### Risk

Resolver traversal and graph extraction can inherit queue/hash/input ordering.

### Resolution

- exact resolved dependency edges are stored canonically;
- public graph collections use stable explicit sort keys;
- repeat-run byte equality is an acceptance criterion;
- root-order permutation is tested for both lock-v2 and graph output.

Result: PASS.

## Multi-version provenance check

### Risk

Schema-v1 locks cannot always reconstruct exact parent→child edges when multiple concrete versions satisfy similar constraints.

### Resolution

- new resolver runs write schema v2 with exact resolved edge evidence;
- existing commands keep valid v1 compatibility;
- `commandf context` fails closed on v1 instead of guessing.

Result: PASS.

## Backward-compatibility check

### Risk

A lock schema bump could unnecessarily invalidate existing user workflows.

### Resolution

Schema-specific decoding retains v1 support for commands that do not require exact resolved-edge evidence. Only the new Context Graph command requires v2.

Result: PASS.

## Canonical-resolution authority check

### Risk

An unversioned canonical URL can match multiple in-closure versions. Choosing one would create false graph authority.

### Resolution

The graph explicitly serializes `resolved`, `external`, and `ambiguous` target states. No first/newest/root-nearest heuristic is allowed.

Result: PASS.

## Extraction-completeness check

### Risk

FHIR contains more canonical/reference-bearing fields than the first graph slice can responsibly implement. Silently ignoring them while claiming a complete Context Graph would violate evidence rules.

### Resolution

CF-11G V1 has an explicit extractor contract for StructureDefinition, ValueSet, and CodeSystem dependency fields, while all present unsupported source resource types are listed in deterministic coverage metadata. Artifact nodes may exist without a claim of complete outgoing-edge extraction.

Result: PASS.

## Snapshot/differential check

### Risk

Extracting all element references from generated StructureDefinition snapshots can duplicate inherited dependencies and present them as local declarations.

### Resolution

Use top-level `baseDefinition` plus differential element profile/targetProfile/binding references in V1. This gives author-local dependency evidence without snapshot inheritance inflation.

Result: PASS.

## Storage-architecture check

### Master Architecture constraint

Graph-plane persistence should be relational-first unless measurement justifies a graph database.

### Resolution

CF-11G does not introduce a database at all. Its canonical output is a normalized deterministic relation set in JSON. If a persisted index becomes necessary for CF-12, embedded relational storage is the first candidate. Graph databases/vector stores require later evidence.

Result: PASS.

## Dependency check

### Risk

Adding a graph crate/database before a shipped consumer would violate repository dependency discipline.

### Resolution

The plan prefers no new Rust dependency. Existing serde, archive, digest, and deterministic collection facilities are sufficient for CF-11G V1.

Result: PASS.

## Trust-boundary check

### Risk

Graph build could accidentally become a second package acquisition path or bypass archive bounds.

### Resolution

`commandf context` is cache-only/offline, verifies lock digests, and reuses the CF-02 bounded archive inspection boundary. No registry lookup participates in graph construction.

Result: PASS.

## CF-06 / CF-10 independence check

### Risk

The blocked upstream HL7-maintainer path could become an accidental prerequisite or motivate a semantic workaround.

### Resolution

CF-11G depends only on canonical package/canonical inspection foundations. It does not change CF-06 oracle identity, reinterpret oracle failures, or modify the frozen CF-10 corpus.

Result: PASS.

## CF-12 sequencing check

`commandf impact` requires a working graph. Tasks explicitly prohibit CF-12 implementation until CF-11G convergence closes.

Result: PASS.

## Open design questions

No blocking design ambiguity remains for implementation start.

Implementation may refine Rust type names and private module boundaries provided it does not change these normative contracts:

- explicit lock-v2 resolved-edge evidence;
- v1 backward compatibility for existing commands;
- v1 refusal for Context Graph build;
- deterministic graph JSON;
- explicit canonical target state;
- V1 extractor coverage;
- offline verified-cache boundary;
- no compatibility authority in CF-11G.

## Final classification

```text
SPEC_PLAN_TASKS_CONSISTENCY = PASS
ROADMAP_IDENTITY = CF-11G
IMPLEMENTATION_ORDER = T010 -> T011 -> T012 -> T020...
CF-12_ELIGIBLE = NO / requires CF-11G convergence
CF-06_PIN_CHANGE = NOT AUTHORIZED BY THIS SLICE
```
Loading
Loading