Plan an incremental IG build from a delta of changed files

Map a delta (a commit range, a PR’s diff, or the staged index) onto a base AST: which resources to rebuild (the forward cone), which to load from cache, which to remove, or a full build and why. Builds nothing.

Skills it satisfies

A skill states the capability; this Tool is one way to exercise it. Each skill’s declared input and output contract follows, where it has one.

ig-publisher-fork

Requirements for an agent working a local experimental fork of the IG Publisher — which repositories, what the AST must carry, what must not change, and the acceptance criteria. Read before forking, and before reporting a fork’s work complete.

Source: fhir-harness/skills/fhir-ig-base/ig-publisher-fork.md.

Also satisfied by: fhir-cache-seed-npm, fhir-package-mirror, ig-ast-export, ig-ast-incremental-build, ig-ast-measure-real-igs, smart-fhir-cache-seed.

The skill declares no I/O contract (schemas/skills/ig-publisher-fork/{input,output}.schema.json).

ig-ast-delta

List and view what changed between two IG ASTs, check whether an AST is still valid for the IG’s current inputs, and render the delta as just-the-docs pages that carry the provisional mark. Read before trusting a cached AST, before reviewing an incremental IG build, and before rendering anything from a cache.

Source: fhir-harness/skills/fhir-ig-base/ig-ast-delta.md.

Also satisfied by: ig-ast-diff, ig-ast-jsonld, ig-ast-list, ig-ast-pages, ig-ast-render, ig-ast-validity, ig-cache.

The skill declares no I/O contract (schemas/skills/ig-ast-delta/{input,output}.schema.json).

Inputs and outputs

Each port names a shared type by IRI, so two Tools for one skill can be checked for interchangeability.

porttyperequireddescriptionconstraint
inastFilesystemPathyesstring · A filesystem path, possibly outside the repository. Not admissible as a command-line argument.
inigFilesystemPathyesstring · A filesystem path, possibly outside the repository. Not admissible as a command-line argument.
inheadCommitShaDefault HEAD; -staged diffs the index instead.string · pattern ^[0-9a-f]{7,40}$ · A git commit sha, full or abbreviated (7-40 hex digits).
infsh-usersFilesystemPathfsh-file-users/v1 from fsh-cone --file-users: lets a changed RuleSet- or Alias-only file reach its users rather than force a full build.string · A filesystem path, possibly outside the repository. Not admissible as a command-line argument.
outrebuildCountThe forward cone. The plan says full, with reasons, when a file’s effect cannot be determined or the cone exceeds the threshold.integer · A non-negative count — how many of something, or how many to show. Zero is a real answer.

Processes and tasks

Steps this Tool can carry out, because each names a skill it satisfies:

processsteplanevia skill
Is the incremental IG AST what a full build would have produced?Check the base AST against the inputsIncremental build (system)ig-ast-delta
Is the incremental IG AST what a full build would have produced?Diff the two ASTsIncremental build (system)ig-ast-delta
Is the incremental IG AST what a full build would have produced?Read the deltaQC reviewerig-ast-delta
An IG site, built from the AST on its cache branchRestore and judge the cached ASTSite build (agent, stage-local)ig-ast-delta
An IG site, built from the AST on its cache branchBuild the IG with the AST exporterAST refresh (GitHub runner: IG Publisher with the AST exporter)ig-publisher-fork
SMART Guideline end to endReview each L3 asset (before / after if adapted)Human adjudicatorsig-ast-delta

How it is deployed and reached

  • Command line. From the repository root: java -cp "target/classes:$(cat cp.txt)" org.hl7.fhir.igtools.ast.AstPlanCli -ast <ast> -ig <ig> [-head <rev> | -staged] [-out plan.json] [-fsh-users <json>].
  • GitHub Actions. No workflow in this checkout runs its command.

As an API: its operation in the OpenAPI document and the MCP tool list of its layer.

installcli: git clone -b claude/ast-export https://github.com/litlfred/fhir-ig-publisher && cd fhir-ig-publisher/ast-export && mvn -q package && mvn -q dependency:build-classpath -Dmdep.outputFile=cp.txt
runtimejava, git
networkno
when to choose it
whenBefore an incremental build, and to show a reviewer what a change reaches.
limitsThe cone is computed on the BASE edges, so it is provisional until the rebuild: new edges can extend it. A RuleSet-only FSH file forces a full build unless -fsh-users is given.
costSeconds; reads files and git.

What it is made of

Linked data

The Tool is published as its own JSON-LD document at its IRI, https://litlfred.github.io/folio-assistant/fhir-harness/tools/ig-ast-plan.jsonld, partOf its layer’s document. The node below is the definition this page was drawn from, and is embedded in the page as application/ld+json.

{
  "@context": "https://litlfred.github.io/folio-assistant/fhir-harness/fhir-harness.context.jsonld",
  "@id": "https://litlfred.github.io/folio-assistant/fhir-harness/tools/ig-ast-plan.jsonld",
  "@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
  "partOf": "https://litlfred.github.io/folio-assistant/fhir-harness/fhir-harness.jsonld",
  "name": "ig-ast-plan",
  "title": "Plan an incremental IG build from a delta of changed files",
  "description": "Map a delta (a commit range, a PR's diff, or the staged index) onto a base AST: which resources to rebuild (the forward cone), which to load from cache, which to remove, or a full build and why. Builds nothing.",
  "install": {
    "cli": "git clone -b claude/ast-export https://github.com/litlfred/fhir-ig-publisher && cd fhir-ig-publisher/ast-export && mvn -q package && mvn -q dependency:build-classpath -Dmdep.outputFile=cp.txt"
  },
  "invoke": {
    "shell": "java -cp \"target/classes:$(cat cp.txt)\" org.hl7.fhir.igtools.ast.AstPlanCli -ast <ast> -ig <ig> [-head <rev> | -staged] [-out plan.json] [-fsh-users <json>]"
  },
  "io": {
    "inputs": [
      {
        "name": "ast",
        "schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/FilesystemPath",
        "required": true
      },
      {
        "name": "ig",
        "schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/FilesystemPath",
        "required": true
      },
      {
        "name": "head",
        "schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/CommitSha",
        "description": "Default HEAD; `-staged` diffs the index instead.",
        "required": false
      },
      {
        "name": "fsh-users",
        "schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/FilesystemPath",
        "description": "`fsh-file-users/v1` from `fsh-cone --file-users`: lets a changed RuleSet- or Alias-only file reach its users rather than force a full build.",
        "required": false
      }
    ],
    "outputs": [
      {
        "name": "rebuild",
        "schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Count",
        "description": "The forward cone. The plan says `full`, with reasons, when a file's effect cannot be determined or the cone exceeds the threshold."
      }
    ]
  },
  "satisfies": [
    "ig-publisher-fork",
    "ig-ast-delta"
  ],
  "requirements": {
    "runtime": [
      "java",
      "git"
    ],
    "network": false
  },
  "selection": {
    "when": "Before an incremental build, and to show a reviewer what a change reaches.",
    "limits": "The cone is computed on the BASE edges, so it is provisional until the rebuild: new edges can extend it. A RuleSet-only FSH file forces a full build unless `-fsh-users` is given.",
    "cost": "Seconds; reads files and git."
  }
}

folio-assistant — code under the Apache License 2.0, documentation under CC BY 3.0. Generated schema and API references are rebuilt from source on every push to main.

deployed dev