@shardworks/astrolabe-apparatus 0.1.229 → 0.1.230

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shardworks/astrolabe-apparatus",
3
- "version": "0.1.229",
3
+ "version": "0.1.230",
4
4
  "license": "ISC",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,17 +20,17 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "zod": "4.3.6",
23
- "@shardworks/stacks-apparatus": "0.1.229",
24
- "@shardworks/tools-apparatus": "0.1.229",
25
- "@shardworks/clerk-apparatus": "0.1.229",
26
- "@shardworks/fabricator-apparatus": "0.1.229",
27
- "@shardworks/spider-apparatus": "0.1.229",
28
- "@shardworks/loom-apparatus": "0.1.229",
29
- "@shardworks/animator-apparatus": "0.1.229"
23
+ "@shardworks/stacks-apparatus": "0.1.230",
24
+ "@shardworks/clerk-apparatus": "0.1.230",
25
+ "@shardworks/tools-apparatus": "0.1.230",
26
+ "@shardworks/spider-apparatus": "0.1.230",
27
+ "@shardworks/fabricator-apparatus": "0.1.230",
28
+ "@shardworks/loom-apparatus": "0.1.230",
29
+ "@shardworks/animator-apparatus": "0.1.230"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "25.5.0",
33
- "@shardworks/nexus-core": "0.1.229"
33
+ "@shardworks/nexus-core": "0.1.230"
34
34
  },
35
35
  "files": [
36
36
  "dist",
@@ -42,7 +42,7 @@
42
42
  ],
43
43
  "scripts": {
44
44
  "build": "tsc",
45
- "test": "node --disable-warning=ExperimentalWarning --experimental-transform-types --test 'src/**/*.test.ts'",
45
+ "test": "node --disable-warning=ExperimentalWarning --experimental-transform-types --test 'src/**/*.test.ts' 'pages/**/*.test.js'",
46
46
  "typecheck": "tsc --noEmit"
47
47
  }
48
48
  }
@@ -307,10 +307,10 @@
307
307
  detailTitle.textContent = 'Plan: ' + plan.id;
308
308
 
309
309
  // Metadata card
310
- var briefLink = '<a href="/pages/clerk/?writ=' + encodeURIComponent(plan.id) + '">' + esc(plan.id) + '</a>';
310
+ var briefLink = '<a href="/pages/writs/?writ=' + encodeURIComponent(plan.id) + '">' + esc(plan.id) + '</a>';
311
311
  var mandateHtml = '';
312
312
  if (plan.generatedWritId) {
313
- mandateHtml = '<dt>Mandate Writ</dt><dd><a href="/pages/clerk/?writ=' +
313
+ mandateHtml = '<dt>Mandate Writ</dt><dd><a href="/pages/writs/?writ=' +
314
314
  encodeURIComponent(plan.generatedWritId) + '">' + esc(plan.generatedWritId) + '</a></dd>';
315
315
  }
316
316
 
@@ -10,6 +10,12 @@
10
10
 
11
11
  import { describe, it } from 'node:test';
12
12
  import assert from 'node:assert/strict';
13
+ import { readFileSync } from 'node:fs';
14
+ import { resolve, dirname } from 'node:path';
15
+ import { fileURLToPath } from 'node:url';
16
+
17
+ const __dirname = dirname(fileURLToPath(import.meta.url));
18
+ const astrolabeJs = readFileSync(resolve(__dirname, 'astrolabe.js'), 'utf-8');
13
19
 
14
20
  // ── Extracted pure functions (identical to astrolabe.js) ─────────────
15
21
 
@@ -422,3 +428,34 @@ describe('renderDecisionsTable()', () => {
422
428
  assert.ok(!html.includes('<script>'));
423
429
  });
424
430
  });
431
+
432
+ describe('astrolabe.js plan-detail writ cross-link URL', () => {
433
+ // Regression guard: the plan-detail brief-writ and mandate-writ anchors
434
+ // historically targeted '/pages/clerk/?writ=…', but no plugin registers
435
+ // a page with id 'clerk' — the Clerk's writs page is registered with id
436
+ // 'writs' and served at '/pages/writs/'. That produced a bare 404 on
437
+ // every click. Pin the canonical URL shape and forbid the broken one.
438
+
439
+ it('writ deep-links target the canonical Clerk writs page path', () => {
440
+ assert.match(
441
+ astrolabeJs,
442
+ /\/pages\/writs\/\?writ=/,
443
+ 'writ deep-links must target /pages/writs/?writ=',
444
+ );
445
+ assert.doesNotMatch(
446
+ astrolabeJs,
447
+ /\/pages\/clerk\/\?writ=/,
448
+ 'writ deep-links must NOT target the broken /pages/clerk/?writ= path',
449
+ );
450
+ });
451
+
452
+ it('both plan-detail writ anchors (brief and mandate) use the canonical path', () => {
453
+ // The plan-detail view emits two writ anchors: the brief-writ link and
454
+ // the (optional) mandate-writ link. Both must use the canonical shape.
455
+ var matches = astrolabeJs.match(/\/pages\/writs\/\?writ=/g) || [];
456
+ assert.ok(
457
+ matches.length >= 2,
458
+ 'expected at least 2 canonical /pages/writs/?writ= links (brief + mandate), found ' + matches.length,
459
+ );
460
+ });
461
+ });