Skip to content

Commit 72bc312

Browse files
committed
Validate the complete documentation graph
Compose catalog validation with canonical page, local link, semantic-code link, and heading-fragment checks across every compiler-owned reference page. Snapshot the ordered graph and verify exact page parity through native LSP, packaged desktop and browser workers, and the VS Code web host.
1 parent 693804c commit 72bc312

10 files changed

Lines changed: 507 additions & 11 deletions

File tree

‎TODO.md‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ VS Code opens the index beside a script, supports search, breadcrumbs, links,
4747
and compiler-derived semantic code. Keep that working base and finish the
4848
missing graph rather than rebuilding the viewer.
4949

50-
- [ ] Cover the documentation graph and reference contract with catalog
51-
validation, link checking, deterministic snapshots, native/bundled-server
52-
parity, and VS Code desktop/web integration tests. Missing documentation or
53-
broken related-symbol and migration links should fail the repository check.
5450
- [ ] Finish semantic code in generated reference pages. Signatures now use
5551
catalog identities for syntax coloring and navigation, and examples can use
5652
rustdoc-style hidden `# ` fixture lines so the compiler can map exact

‎docs/COMPILER.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,15 @@ only that one command in language-server Markdown, and the command opens the
11651165
exact page beside the script; other command URIs remain inert. Standard-library
11661166
and language go-to-definition responses use the same URI directly.
11671167

1168+
[`src/documentation/validation.rs`](../src/documentation/validation.rs) checks
1169+
the complete rendered graph rather than a hand-picked set of pages. It composes
1170+
the three catalog validators, requires complete and unique index metadata,
1171+
renders every indexed page, resolves Markdown and semantic-code HTML links
1172+
relative to their virtual document, and verifies heading fragments. A stable
1173+
fingerprint snapshots the ordered reference index. Native LSP tests compare all
1174+
pages with this model, while packaged desktop and browser worker tests exercise
1175+
the same page endpoint through the compiled adapter.
1176+
11681177
## VS Code client
11691178

11701179
[`editors/vscode`](../editors/vscode) is a thin TypeScript extension around the

‎docs/ROADMAP_ARCHIVE.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# SplitScript roadmap
22

3+
## 2026-08-17: validated documentation graph across compiler products
4+
5+
- Added one compiler-owned validation pass over all 413 reference
6+
pages. It composes language, migration, and standard-library catalog
7+
validation with canonical page identity, complete metadata, relative link,
8+
semantic-code HTML link, and heading-fragment checks.
9+
- Added a deterministic reference-index snapshot so an accidental symbol,
10+
hierarchy, title, signature, or summary change fails repository verification
11+
and requires an intentional expectation update.
12+
- Compared every native LSP page with the direct documentation model and added
13+
exact-page checks through both packaged desktop and browser language-server
14+
workers. The VS Code web-host acceptance test now verifies that catalog hover
15+
opens the requested symbol page beside the script.
16+
317
## 2026-08-17: documentation links in ordinary editor workflows
418

519
- Added exact compiler-owned documentation identities to catalog-backed hover

‎editors/vscode/test/webHost.ts‎

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,33 @@ export async function run(): Promise<void> {
2424
await vscode.commands.executeCommand('splitscript.restartLanguageServer');
2525
await hoverAt(script, hoverPosition);
2626

27+
const printPosition = document.positionAt(document.getText().indexOf('print') + 1);
28+
const printHovers = await hoverAt(script, printPosition);
29+
const printMarkdown = printHovers.flatMap(hover => hover.contents)
30+
.filter(
31+
(content): content is vscode.MarkdownString =>
32+
content instanceof vscode.MarkdownString,
33+
)
34+
.map(content => content.value)
35+
.join('\n');
36+
assert(
37+
printMarkdown.includes(
38+
'command:splitscript.openDocumentation?%5B%22%2Fstdlib%2Ffunctions%2Fprint.md%22%5D',
39+
),
40+
'catalog hover does not link to its exact compiler-owned documentation page',
41+
);
42+
await vscode.commands.executeCommand(
43+
'splitscript.openDocumentation',
44+
'/stdlib/functions/print.md',
45+
);
46+
const printDocumentation = await vscode.workspace.openTextDocument(
47+
vscode.Uri.parse('splitscript-docs:/stdlib/functions/print.md'),
48+
);
49+
assert(
50+
printDocumentation.getText().includes('# print'),
51+
'the documentation command did not open the requested symbol page',
52+
);
53+
2754
await vscode.commands.executeCommand('splitscript.openDocumentation');
2855
await waitFor(
2956
async () => (vscode.window.tabGroups.all.length >= 2 ? true : undefined),
@@ -98,14 +125,17 @@ export async function run(): Promise<void> {
98125
}
99126
}
100127

101-
async function hoverAt(uri: vscode.Uri, position: vscode.Position): Promise<void> {
102-
await waitFor(async () => {
128+
async function hoverAt(
129+
uri: vscode.Uri,
130+
position: vscode.Position,
131+
): Promise<readonly vscode.Hover[]> {
132+
return waitFor(async () => {
103133
const hovers = await vscode.commands.executeCommand<readonly vscode.Hover[]>(
104134
'vscode.executeHoverProvider',
105135
uri,
106136
position,
107137
);
108-
return hovers !== undefined && hovers.length > 0 ? true : undefined;
138+
return hovers !== undefined && hovers.length > 0 ? hovers : undefined;
109139
}, 'the browser language server returned no hover');
110140
}
111141

‎src/documentation.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ mod bundled;
44
mod code;
55
mod entry;
66
mod reference;
7+
mod validation;
78

89
pub use entry::{DocumentedParameter, StandardLibraryDocumentation};
910
pub(crate) use reference::migration_topic_uri;

‎src/documentation/reference.rs‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ pub struct DocumentationReference {
6969
}
7070

7171
impl DocumentationReference {
72+
/// Validates catalogs and every rendered page in the documentation graph.
73+
///
74+
/// This checks the same graph consumed by native tools and editor clients,
75+
/// including canonical page identities, local links, and heading anchors.
76+
pub fn validate(&self) -> Vec<String> {
77+
super::validation::validate(self, &self.library)
78+
}
79+
7280
/// Returns the stable virtual page for a language-catalog item.
7381
pub fn language_item_uri(&self, item: LanguageItemId) -> String {
7482
language_item_uri(item)
@@ -806,7 +814,7 @@ impl DocumentationReference {
806814
}
807815
DocumentationPage {
808816
uri: uri.to_owned(),
809-
title: "SplitScript language".to_owned(),
817+
title: "Language".to_owned(),
810818
markdown,
811819
}
812820
}
@@ -872,7 +880,7 @@ impl DocumentationReference {
872880
}
873881
DocumentationPage {
874882
uri: uri.to_owned(),
875-
title: "Migrate to SplitScript".to_owned(),
883+
title: "Migration".to_owned(),
876884
markdown,
877885
}
878886
}

0 commit comments

Comments
 (0)