Skip to content

Replace internal-source line selectors with string markers; retire Scribe/DPM remote extraction#1059

Draft
danielporterda wants to merge 3 commits into
mainfrom
snippet-string-markers-internal-sources
Draft

Replace internal-source line selectors with string markers; retire Scribe/DPM remote extraction#1059
danielporterda wants to merge 3 commits into
mainfrom
snippet-string-markers-internal-sources

Conversation

@danielporterda

Copy link
Copy Markdown
Contributor

Important

Blocked on the two source PRs merging: DACH-NY/canton#34155 and DACH-NY/daml-shell#193. The marker selectors here reference tokens added on those branches. Generation was validated against the source PR commits (canton 982b60d56381ba58013c231c65357dbc9f73dfc8, daml-shell 3f5e4315e10c992eb3ff7fdb42290e5d8bee4907); re-validate against the merged commits before landing.

What

Eliminates every location.type == "lines" selector associated with internal source repositories and retires stale remote-source metadata where upstream explicitly transferred docs ownership to cf-docs.

Selector counts (before → after)

Config lines before after
canton-snippet-list-remote.json 11 0 (10 stringMarker, 1 retired)
daml-shell-snippet-list-remote.json 20 0 (20 stringMarker)
scribe-snippet-list-remote.json 22 config removed (snippets now cf-docs-owned)
dpm-snippet-list-remote.json 7 config removed (snippets now cf-docs-owned)

The remaining 164 line selectors in public digital-asset/cn-quickstart are a separate migration and are not claimed as fixed by this internal-repo work.

Commits

  1. Extractor fixextractByStringMarker() now trims blank edge lines instead of .trim(), preserving first-line indentation for indented sources (RST literal blocks), and fails if a marker doesn't appear exactly once. Behavior-neutral for all 11 existing daml/splice stringMarker snippets (their content starts at column 0; verified by scanning the checked-in outputs).
  2. Selector switch + regeneration — 30 selectors converted; outputs regenerated by focused extraction against the source PR branches. Retires the max-burst-factor snippet (Canton d4ed3d74e485 removed that config when BaseCantonConfig began failing on unknown keys), including its import and the unsupported Batch sizes section on the GS performance-optimization page.
  3. Scribe/DPM ownership cleanup — Scribe (DACH-NY/scribe 75ac557896d7) and DPM (digital-asset/dpm 6c85930ac6e1) both deleted their docs after transferring ownership to cf-docs, so remote extraction can never succeed again. The 22 used PQS snippets move to snippets/pqs/, the 3 used DPM snippets to snippets/dpm/, 3 unused DPM snippet files are deleted (a 7th config entry had no checked-in output), configs and generator targets are removed, and regression tests lock all of this in. Note: the live DPM repository is public digital-asset/dpm; DACH-NY/dpm does not exist.

Generated-output diff summary

  • Daml Shell (20 snippets): content is byte-for-byte identical to regenerating with the old line selectors against current upstream main — the only checked-in diff is a stale trailing blank line that today's wrapCode trimming already removes. The marker switch itself is content-neutral (verified by diffing both generations).
  • Canton: 4 snippets byte-identical (modulo the same stale trailing blank); 6 change intentionally because the old line ranges had drifted against the current conf files:
    • 3 configuration-reference snippets regain their missing closing }
    • remote-participant snippet regains its canton.remote-participants.myparticipant { header
    • the 2 performance-optimization snippets become the complete storage-pool and pruning-batch blocks (the old ranges split the storage block and mislabeled its tail as the pruning snippet)
  • 1 snippet removed (burst-factor, see above).

Validation

  • npm run test:external-snippets — 9 passed (includes new regression tests: no lines selectors for these repos, retired configs stay retired, marker-token uniqueness, indentation-preserving + exactly-once extraction semantics)
  • Focused external generation for Canton (10/10) and Daml Shell (20/20) against the source PR branch checkouts — all succeeded
  • jq validation of every changed JSON file — OK
  • git diff --check — clean
  • Mintlify broken-links from docs-main — output identical to main (only pre-existing |gsf_scan_url| placeholder warnings)
  • Every changed /snippets/... import resolves to an existing file — 0 missing

Source ownership notes

  • Scribe explicitly transferred PQS docs ownership to cf-docs (75ac557896d794f5f7e74b07da4f9a3f7787b3dc states PQS documentation is now hosted by canton-network/cf-docs); this PR does not recreate upstream docs to host markers.
  • DPM's docs were deleted upstream (6c85930ac6e14ee51e744a752ee6bdb8be53d96a) for the same reason.

github-actions Bot added 3 commits July 13, 2026 15:23
…traction

extractByStringMarker() used .trim() on the extracted region, which
stripped leading whitespace from the first content line only. For
indented sources (RST literal blocks), that misaligned the first line
against the rest of the snippet. Trim blank edge lines instead,
preserving every line's indentation — matching the Sphinx
literalinclude :start-after:/:end-before: semantics this function
already documents.

This is behavior-neutral for every existing stringMarker snippet (daml,
splice): their marked content starts at column 0, where .trim() and
blank-edge trimming are equivalent, confirmed by scanning all 11
checked-in stringMarker outputs.

Also fail extraction when a marker string does not appear exactly once
in its source file, so a stray duplicate can't silently select the
wrong region.

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Replace the line-number selectors for the internal source repositories
with the stringMarker tokens now present on the source branches:

- canton-snippet-list-remote.json: 10 selectors -> CF_DOCS_SNIPPET_*
  comment markers in community/app documentation-snippets .conf files
  (DACH-NY/canton#34155).
- daml-shell-snippet-list-remote.json: all 20 selectors ->
  cf-docs-snippet-daml-shell-* :name:/comment markers in the two RST
  docs (DACH-NY/daml-shell#193).

Regenerate the checked-in snippet outputs with focused extraction
against those source branches. Daml Shell content is byte-for-byte
identical to regenerating with the old line selectors on current
upstream main (the only checked-in diff is a stale trailing blank line
that today's wrapCode trimming already removes). Six Canton snippets
change content intentionally, because the old line ranges had drifted:
three configuration-reference snippets regain their closing braces, the
remote-participant snippet regains its block header, and the two
performance-optimization snippets become the complete storage-pool and
pruning-batch blocks instead of fragments that split the storage block.

Retire the max-burst-factor snippet entirely: DACH-NY/canton removed
that configuration in d4ed3d74e485 when BaseCantonConfig started
failing on unknown keys. Drop the selector, the generated snippet, its
import, and the unsupported 'Batch sizes' example from the
global-synchronizer performance-optimization page.

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…cf-docs

Both upstream repositories deleted their docs after transferring
documentation ownership to cf-docs:

- DACH-NY/scribe 75ac557896d7 removed the docs and states PQS
  documentation is now hosted by canton-network/cf-docs.
- digital-asset/dpm 6c85930ac6e1 deleted its external docs because they
  now live in canton-network/cf-docs.

Extracting from those repositories can never succeed again, so remote
extraction is retired rather than recreating upstream docs to host
markers:

- Rehome the 22 still-used PQS snippets from the misleading
  snippets/external/scribe/main path to cf-docs-owned snippets/pqs/ and
  update the three importing pages.
- Rehome the 3 used DPM snippets to snippets/dpm/, delete the 3 unused
  checked-in DPM snippet files, and update the two importing pages.
  (The seventh DPM config entry, dpm-components-shell-42, had no
  checked-in output at all.)
- Remove both configs from remote-snippet-lists.json, delete
  scribe-/dpm-snippet-list-remote.json, and drop the scribe/dpm
  generator targets from generate_external_snippets.py.

Add regression tests that fail if the canton or daml-shell external
configs reintroduce location.type == "lines", if the retired scribe/dpm
configs come back, or if marker tokens collide within a source file,
plus unit tests for the indentation-preserving and exactly-once
stringMarker extraction semantics.

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@mintlify

mintlify Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
cantonfoundation 🟢 Ready View Preview Jul 13, 2026, 7:40 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant