Repository navigation
refactor!: resolve publications through the ASTRA SDK - #25
Merged
Merged
Conversation
Signed-off-by: EiffL <fr.eiffel@gmail.com>
Signed-off-by: EiffL <fr.eiffel@gmail.com>
Signed-off-by: EiffL <fr.eiffel@gmail.com>
EiffL
force-pushed
the
refactor/resolved-analysis-sdk
branch
2 times, most recently
from
August 28, 2026 19:29
415684c to
a5e6c87
Compare
Signed-off-by: EiffL <fr.eiffel@gmail.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Quality pass over the branch — no behavior changes.
Reuse:
- hrefForSlug called myst-common's slugToUrl instead of forking MyST's
slug -> URL rule, which fails silently as wrong hrefs when MyST changes.
- Deleted artifactUrl, a pure pass-through left over when the /static/
fallback was removed.
- Collapsed the metric field aliases (error -> uncertainty, units -> unit)
inside readMetric rather than at each of four call sites.
- Shared the page -> analysis scope rule between the href map and
active-page resolution, which had drifted into two spellings.
Simplification:
- One inactiveUnderUniverse() helper for a sentence written four times.
- renderFinding's `parts` is required; the fallback branch was unreachable.
- Dropped the sentinel/stringify layering on the project cache key.
Efficiency:
- resolveScope rebuilt five id->record maps on every {astra} reference.
Split out a memoized ScopeCore keyed on ResolvedProject identity, so
invalidation stays free while the per-pass parts are still per call.
- analysisPageHrefs and collectCitedDois are page-independent but ran once
per page; the former re-read myst.yml and every TOC page's full source,
making builds O(pages^2) in file reads. Both memoized per project.
- Restored the mtime-revalidated table parse cache dropped in the refactor,
so repeated references to one CSV parse it once. The row cap stays in the
render layer, where it moved deliberately: {astra:value} needs full rows.
- The freshness cache held the full text of every spec file for the process
lifetime and byte-compared them per page; it now stores a digest.
- Scope carries resultUrl instead of rebuilding it at three call sites.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ud8wSfVjAMPDVB5txwzTi
Signed-off-by: EiffL <fr.eiffel@gmail.com>
EiffL
commented
Aug 29, 2026
EiffL
commented
Aug 29, 2026
Signed-off-by: EiffL <fr.eiffel@gmail.com>
Signed-off-by: EiffL <fr.eiffel@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@astra-spec/sdkproject resolution and canonical indexesResolvedAnalysisBundlethrough a versioned, data-only carrier, with separately rewritten static artifact resources and SDK-collected citationsPublication contract
Every transformed page carries:
The
bundleis passed through unchanged. MyST-rewritten artifact URLs remain separate and are rejoined by canonicaloutputPathplus the SDKcacheToken, so the theme does not need a parallel data model. Visible artifacts and hidden static-resource links are emitted relative to the current source page, including nested MyST pages, while SDK binding paths remain untouched.The small SDK host cache records every file read, directory listing, and stat result used during project resolution. It deduplicates concurrent page builds while invalidating on source, universe, or artifact changes—including newly materialized outputs.
ASTRA component prose is inserted after MyST's document-level transformations, so MySTRA applies MyST's official math nesting, labeling, and KaTeX rendering passes at that boundary. Inline and display math therefore reach themes fully rendered, while malformed equations report through the page's normal
VFilediagnostics.Theme metadata boundary
Placed record carriers and inline record references expose only resolvable SDK identity:
Analysis references use a deliberately separate address:
hrefexists only when a concrete, unambiguousproject.tocpage maps to that analysis using MyST's route rules. No/<analysis-id>URL is invented. Active-page scope and route mapping share the same source-stem logic for Markdown, notebooks, TeX, and.myst.jsonpages.Inline values additionally carry the relevant
type,selection,unit,product,col, andfilterstrings when available. Optional values are omitted rather than serialized as empty or undefined compatibility fields.Breaking alpha cleanup
This is a deliberate clean cutover with no legacy compatibility layer:
astra:numrefand customastra:refsurfaces; explicit directive labels use standard MyST{ref}prior-insightsandfilter=aliases, author-addressable universe paths, and/staticartifact fallbackVerification
npm run typechecknpm run buildnpm run bundle, followed by a successful import of the standalone bundlenpm test— 72 testsnpm run docs:build— strict build, no issuesgit diff --checkCompanion consumer work: