@runeditrun/rer 0.2.82 → 0.2.84

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.
Files changed (157) hide show
  1. package/cli/authoring.mjs +1 -0
  2. package/cli/contract.mjs +1 -1
  3. package/cli/demo-host.mjs +5 -1
  4. package/cli/demo.mjs +6 -1
  5. package/cli/export.mjs +1 -1
  6. package/cli/parse.mjs +1 -1
  7. package/edition-authoring/base-copies.mjs +72 -25
  8. package/edition-authoring/copy-checkout.mjs +7 -120
  9. package/edition-authoring/edition-migrations.mjs +41 -0
  10. package/edition-authoring/files.mjs +67 -0
  11. package/edition-authoring/lock.mjs +2 -2
  12. package/edition-authoring/module-closure.mjs +232 -0
  13. package/edition-authoring/module-edges.mjs +100 -0
  14. package/edition-authoring/module-resolution.mjs +66 -0
  15. package/edition-authoring/module-syntax.mjs +57 -0
  16. package/edition-authoring/package-target.mjs +92 -0
  17. package/edition-authoring/runtime-dependencies.mjs +74 -97
  18. package/edition-authoring/vendor/babel-parser/LICENSE +22 -0
  19. package/edition-authoring/vendor/babel-parser/README.md +21 -0
  20. package/edition-authoring/vendor/babel-parser/babel-helper-string-parser/index.mjs +292 -0
  21. package/edition-authoring/vendor/babel-parser/babel-helper-validator-identifier/identifier.mjs +66 -0
  22. package/edition-authoring/vendor/babel-parser/babel-helper-validator-identifier/index.mjs +13 -0
  23. package/edition-authoring/vendor/babel-parser/babel-helper-validator-identifier/keyword.mjs +31 -0
  24. package/edition-authoring/vendor/babel-parser/babel-parser/index.mjs +99 -0
  25. package/edition-authoring/vendor/babel-parser/babel-parser/options.mjs +81 -0
  26. package/edition-authoring/vendor/babel-parser/babel-parser/parse-error/bind-operator-errors.mjs +8 -0
  27. package/edition-authoring/vendor/babel-parser/babel-parser/parse-error/module-errors.mjs +15 -0
  28. package/edition-authoring/vendor/babel-parser/babel-parser/parse-error/parse-expression-errors.mjs +10 -0
  29. package/edition-authoring/vendor/babel-parser/babel-parser/parse-error/pipeline-operator-errors.mjs +29 -0
  30. package/edition-authoring/vendor/babel-parser/babel-parser/parse-error/standard-errors.mjs +224 -0
  31. package/edition-authoring/vendor/babel-parser/babel-parser/parse-error/strict-mode-errors.mjs +17 -0
  32. package/edition-authoring/vendor/babel-parser/babel-parser/parse-error/to-node-description.mjs +31 -0
  33. package/edition-authoring/vendor/babel-parser/babel-parser/parse-error.mjs +114 -0
  34. package/edition-authoring/vendor/babel-parser/babel-parser/parser/base.mjs +34 -0
  35. package/edition-authoring/vendor/babel-parser/babel-parser/parser/comments.mjs +199 -0
  36. package/edition-authoring/vendor/babel-parser/babel-parser/parser/expression.mjs +1794 -0
  37. package/edition-authoring/vendor/babel-parser/babel-parser/parser/index.mjs +76 -0
  38. package/edition-authoring/vendor/babel-parser/babel-parser/parser/lval.mjs +439 -0
  39. package/edition-authoring/vendor/babel-parser/babel-parser/parser/node.mjs +111 -0
  40. package/edition-authoring/vendor/babel-parser/babel-parser/parser/statement.mjs +1962 -0
  41. package/edition-authoring/vendor/babel-parser/babel-parser/parser/util.mjs +244 -0
  42. package/edition-authoring/vendor/babel-parser/babel-parser/plugin-utils.mjs +116 -0
  43. package/edition-authoring/vendor/babel-parser/babel-parser/plugins/estree.mjs +417 -0
  44. package/edition-authoring/vendor/babel-parser/babel-parser/plugins/flow/index.mjs +2412 -0
  45. package/edition-authoring/vendor/babel-parser/babel-parser/plugins/flow/scope.mjs +37 -0
  46. package/edition-authoring/vendor/babel-parser/babel-parser/plugins/jsx/index.mjs +420 -0
  47. package/edition-authoring/vendor/babel-parser/babel-parser/plugins/jsx/xhtml.mjs +261 -0
  48. package/edition-authoring/vendor/babel-parser/babel-parser/plugins/placeholders.mjs +205 -0
  49. package/edition-authoring/vendor/babel-parser/babel-parser/plugins/typescript/index.mjs +2889 -0
  50. package/edition-authoring/vendor/babel-parser/babel-parser/plugins/typescript/scope.mjs +115 -0
  51. package/edition-authoring/vendor/babel-parser/babel-parser/plugins/v8intrinsic.mjs +26 -0
  52. package/edition-authoring/vendor/babel-parser/babel-parser/tokenizer/context.mjs +22 -0
  53. package/edition-authoring/vendor/babel-parser/babel-parser/tokenizer/index.mjs +1037 -0
  54. package/edition-authoring/vendor/babel-parser/babel-parser/tokenizer/state.mjs +178 -0
  55. package/edition-authoring/vendor/babel-parser/babel-parser/tokenizer/types.mjs +583 -0
  56. package/edition-authoring/vendor/babel-parser/babel-parser/types.mjs +1 -0
  57. package/edition-authoring/vendor/babel-parser/babel-parser/util/class-scope.mjs +82 -0
  58. package/edition-authoring/vendor/babel-parser/babel-parser/util/expression-scope.mjs +121 -0
  59. package/edition-authoring/vendor/babel-parser/babel-parser/util/identifier.mjs +23 -0
  60. package/edition-authoring/vendor/babel-parser/babel-parser/util/location.mjs +34 -0
  61. package/edition-authoring/vendor/babel-parser/babel-parser/util/production-parameter.mjs +40 -0
  62. package/edition-authoring/vendor/babel-parser/babel-parser/util/scope.mjs +173 -0
  63. package/edition-authoring/vendor/babel-parser/babel-parser/util/scopeflags.mjs +66 -0
  64. package/edition-authoring/vendor/babel-parser/babel-parser/util/whitespace.mjs +61 -0
  65. package/edition-authoring/vendor/yaml/LICENSE +13 -0
  66. package/edition-authoring/vendor/yaml/README.md +11 -0
  67. package/edition-authoring/vendor/yaml/compose/compose-collection.mjs +88 -0
  68. package/edition-authoring/vendor/yaml/compose/compose-doc.mjs +43 -0
  69. package/edition-authoring/vendor/yaml/compose/compose-node.mjs +110 -0
  70. package/edition-authoring/vendor/yaml/compose/compose-scalar.mjs +86 -0
  71. package/edition-authoring/vendor/yaml/compose/composer.mjs +218 -0
  72. package/edition-authoring/vendor/yaml/compose/resolve-block-map.mjs +115 -0
  73. package/edition-authoring/vendor/yaml/compose/resolve-block-scalar.mjs +198 -0
  74. package/edition-authoring/vendor/yaml/compose/resolve-block-seq.mjs +49 -0
  75. package/edition-authoring/vendor/yaml/compose/resolve-end.mjs +37 -0
  76. package/edition-authoring/vendor/yaml/compose/resolve-flow-collection.mjs +207 -0
  77. package/edition-authoring/vendor/yaml/compose/resolve-flow-scalar.mjs +228 -0
  78. package/edition-authoring/vendor/yaml/compose/resolve-props.mjs +148 -0
  79. package/edition-authoring/vendor/yaml/compose/util-contains-newline.mjs +34 -0
  80. package/edition-authoring/vendor/yaml/compose/util-empty-scalar-position.mjs +27 -0
  81. package/edition-authoring/vendor/yaml/compose/util-flow-indent-check.mjs +15 -0
  82. package/edition-authoring/vendor/yaml/compose/util-map-includes.mjs +13 -0
  83. package/edition-authoring/vendor/yaml/doc/Document.mjs +333 -0
  84. package/edition-authoring/vendor/yaml/doc/anchors.mjs +74 -0
  85. package/edition-authoring/vendor/yaml/doc/applyReviver.mjs +54 -0
  86. package/edition-authoring/vendor/yaml/doc/createNode.mjs +88 -0
  87. package/edition-authoring/vendor/yaml/doc/directives.mjs +176 -0
  88. package/edition-authoring/vendor/yaml/errors.mjs +57 -0
  89. package/edition-authoring/vendor/yaml/index.mjs +17 -0
  90. package/edition-authoring/vendor/yaml/log.mjs +11 -0
  91. package/edition-authoring/vendor/yaml/nodes/Alias.mjs +119 -0
  92. package/edition-authoring/vendor/yaml/nodes/Collection.mjs +147 -0
  93. package/edition-authoring/vendor/yaml/nodes/Node.mjs +38 -0
  94. package/edition-authoring/vendor/yaml/nodes/Pair.mjs +36 -0
  95. package/edition-authoring/vendor/yaml/nodes/Scalar.mjs +24 -0
  96. package/edition-authoring/vendor/yaml/nodes/YAMLMap.mjs +144 -0
  97. package/edition-authoring/vendor/yaml/nodes/YAMLSeq.mjs +113 -0
  98. package/edition-authoring/vendor/yaml/nodes/addPairToJSMap.mjs +62 -0
  99. package/edition-authoring/vendor/yaml/nodes/identity.mjs +36 -0
  100. package/edition-authoring/vendor/yaml/nodes/toJS.mjs +35 -0
  101. package/edition-authoring/vendor/yaml/parse/cst-scalar.mjs +214 -0
  102. package/edition-authoring/vendor/yaml/parse/cst-stringify.mjs +61 -0
  103. package/edition-authoring/vendor/yaml/parse/cst-visit.mjs +97 -0
  104. package/edition-authoring/vendor/yaml/parse/cst.mjs +98 -0
  105. package/edition-authoring/vendor/yaml/parse/lexer.mjs +722 -0
  106. package/edition-authoring/vendor/yaml/parse/line-counter.mjs +39 -0
  107. package/edition-authoring/vendor/yaml/parse/parser.mjs +975 -0
  108. package/edition-authoring/vendor/yaml/public-api.mjs +102 -0
  109. package/edition-authoring/vendor/yaml/schema/Schema.mjs +37 -0
  110. package/edition-authoring/vendor/yaml/schema/common/map.mjs +17 -0
  111. package/edition-authoring/vendor/yaml/schema/common/null.mjs +15 -0
  112. package/edition-authoring/vendor/yaml/schema/common/seq.mjs +17 -0
  113. package/edition-authoring/vendor/yaml/schema/common/string.mjs +14 -0
  114. package/edition-authoring/vendor/yaml/schema/core/bool.mjs +19 -0
  115. package/edition-authoring/vendor/yaml/schema/core/float.mjs +43 -0
  116. package/edition-authoring/vendor/yaml/schema/core/int.mjs +38 -0
  117. package/edition-authoring/vendor/yaml/schema/core/schema.mjs +23 -0
  118. package/edition-authoring/vendor/yaml/schema/json/schema.mjs +62 -0
  119. package/edition-authoring/vendor/yaml/schema/tags.mjs +96 -0
  120. package/edition-authoring/vendor/yaml/schema/yaml-1.1/binary.mjs +59 -0
  121. package/edition-authoring/vendor/yaml/schema/yaml-1.1/bool.mjs +26 -0
  122. package/edition-authoring/vendor/yaml/schema/yaml-1.1/float.mjs +46 -0
  123. package/edition-authoring/vendor/yaml/schema/yaml-1.1/int.mjs +71 -0
  124. package/edition-authoring/vendor/yaml/schema/yaml-1.1/merge.mjs +67 -0
  125. package/edition-authoring/vendor/yaml/schema/yaml-1.1/omap.mjs +74 -0
  126. package/edition-authoring/vendor/yaml/schema/yaml-1.1/pairs.mjs +78 -0
  127. package/edition-authoring/vendor/yaml/schema/yaml-1.1/schema.mjs +39 -0
  128. package/edition-authoring/vendor/yaml/schema/yaml-1.1/set.mjs +93 -0
  129. package/edition-authoring/vendor/yaml/schema/yaml-1.1/timestamp.mjs +101 -0
  130. package/edition-authoring/vendor/yaml/stringify/foldFlowLines.mjs +146 -0
  131. package/edition-authoring/vendor/yaml/stringify/stringify.mjs +130 -0
  132. package/edition-authoring/vendor/yaml/stringify/stringifyCollection.mjs +155 -0
  133. package/edition-authoring/vendor/yaml/stringify/stringifyComment.mjs +20 -0
  134. package/edition-authoring/vendor/yaml/stringify/stringifyDocument.mjs +85 -0
  135. package/edition-authoring/vendor/yaml/stringify/stringifyNumber.mjs +25 -0
  136. package/edition-authoring/vendor/yaml/stringify/stringifyPair.mjs +150 -0
  137. package/edition-authoring/vendor/yaml/stringify/stringifyString.mjs +338 -0
  138. package/edition-authoring/vendor/yaml/util.mjs +11 -0
  139. package/edition-authoring/vendor/yaml/visit.mjs +233 -0
  140. package/edition-authoring/workflow-copies.mjs +125 -0
  141. package/edition-authoring/workflow-scripts.mjs +112 -0
  142. package/foundation/runtime/contract-docs.mjs +753 -0
  143. package/global/CHANGELOG.md +33 -2
  144. package/modules/demo/declaration.mjs +1 -4
  145. package/modules/demo/vite.mjs +1 -1
  146. package/modules/deploy-kit/README.md +1 -1
  147. package/modules/deploy-kit/templates.mjs +3 -3
  148. package/onboarding/operator-installer.mjs +2 -2
  149. package/package.json +1 -1
  150. package/scripts/publish-check/README.md +6 -0
  151. package/scripts/publish-check/history_scan.py +5 -3
  152. package/scripts/publish-check/hygiene_config.py +2 -1
  153. package/scripts/publish-check/report.py +9 -3
  154. package/scripts/publish-check/third-party-notices.json +13 -0
  155. package/scripts/publish-check/third_party_notices.py +38 -0
  156. package/scripts/publish-check/tree_scan.py +6 -0
  157. package/scripts/publish-check.mjs +1 -1
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.84
4
+
5
+ - The publication scan accepts the upstream copyright notice of a Base-listed third-party licence text only under an exact licence file name with the listed Git blob ID (initially the vendored yaml 2.9.1 `LICENSE`) and reports each in `thirdPartyNotices`; seed configuration cannot extend the list, and scans of the unpacked rer tarball and of refreshed seeds pass without review records.
6
+ - Refresh resolves every runtime import form without declaration files, reads workflow run steps from a YAML AST, preserves equal-byte tracked siblings as edition-owned discovery exceptions, and keeps ordinary baseline-unresolved imports unresolved. Local package conditions are selected by Node itself, excluding types for runtime edges. JavaScript runtime paths follow Node's explicit-file rules; TypeScript source resolution is retained.
7
+ - Parse those import edges and workflow files with Babel parser 7.29.8 (MIT) and yaml 2.9.1 (ISC), vendored unchanged in behaviour as portable ESM modules under `edition-authoring/vendor`, so refresh installs no parser package.
8
+ - The edition-authoring tool includes its vendored YAML and JavaScript parsers with their licences: deploy-kit templates and the review-harness upgrade guide copy the whole `vendor/` directory, and the lock's toolchain identity covers it, so a copied tool's `lock` and `check` no longer fail on a missing `vendor/yaml/index.mjs`.
9
+ - Fix the Verify template's unavailable job-level runner context, keep its pnpm store under the runner temporary directory, lint delivered workflows in Base Verify, and upgrade unchanged historical Verify templates and their helper closure during refresh.
10
+ - Close every recorded code module over relative imports and declarations using existing copy namespaces, preserving seed-owned dependencies and pre-existing unresolved imports; withhold optional directory additions without a witnessed destination and refuse missing seed-owned bindings atomically.
11
+ - Declare edition migrations `run-data-paths` and `run-data-pricing`; repeat `--edition-migration ID` to consent to refresh while leaving the documented edition-owned edits owed.
12
+ - Check physical spelling before refresh writes or relies on a path; preserve unrecorded template aliases with a notice and refuse aliases on recorded paths and dependencies.
13
+ - Discover workflow helpers across shell wrappers, quoted paths, command substitutions and interpreter options, using the caller's template namespace.
14
+ - Pass the resolved demo Run exit from the CLI to Vite without loading adapters from copied demo modules, remove an empty authoring catch, and keep the Run guide link lint-clean.
15
+ - Add the contract document generator `foundation/runtime/contract-docs.mjs`: `write` regenerates `ACCEPTANCE.md`, `docs/CLAIMS.md` and the Status summary rows from `CONTRACT.md`, `check` fails on stale outputs, and `convert`, `id-map` and `coverage` support structural contract rewrites. `BASELINE.md` adds shared conformance and agent access duties that seeds cite by Base id.
16
+
17
+ ### Known issues
18
+
19
+ - The two refresh recovery guidance issues documented in 0.2.82 still apply, with the same manual recoveries.
20
+ - The delivered Verify template's runner-temporary pnpm store, Chromium and apt cache lifecycle is not yet exercised end to end on a GitHub Ubuntu 24.04 runner; Base Verify covers only Base's own bootstrap.
21
+
22
+ ## 0.2.83
23
+
24
+ - Point the shared Run chooser to Business pairing and keep one local launch recipe with optional alternatives tucked away.
25
+ - Show Assisted at US$10/month and Managed at US$100/month, labelled early access, with global billing on the Run chooser.
26
+ - Keep seed CI Chromium and apt caches under the runner temporary directory, prepare them before sudo, and require the apt helper cache directory to exist so it cannot create runner HOME directories as root.
27
+ - Pin every seed workflow example to Ubuntu 24.04 so Ubuntu 26.04 adoption requires deliberate qualification.
28
+ - Print setup refusal reasons from the command itself in reference-journey failure diagnostics, including refusals before a setup log is opened.
29
+
30
+ ### Known issues
31
+
32
+ - The two refresh recovery guidance issues documented in 0.2.82 still apply, with the same manual recoveries. Use the manual recoveries below.
33
+
3
34
  ## 0.2.82
4
35
 
5
36
  - Deliver the accepted import-door intake implementation and its runtime and type dependencies at `@runeditrun/rer/modules/import-kit/door`, preserving the D1 entry.
@@ -10,8 +41,8 @@
10
41
 
11
42
  ### Known issues
12
43
 
13
- - For a Base-equal untracked, ignored or excluded authoring helper, the suggested `git add -f` followed by refresh can leave `verify-base` reporting `unrecordedCopies`; from the seed root, run `node node_modules/@runeditrun/rer/edition-authoring/cli.mjs record-base LOCAL_PATH ORIGIN_PATH FULL_40_HEX_COMMIT --base /absolute/base-checkout`, then the same entry's `verify-base --base /absolute/base-checkout`. Corrected refusal text ships in 0.2.83.
14
- - On case-insensitive APFS, the suggested `mv -i` for a Base-equal committed `Copy-Checkout.mjs` can leave the old Git index spelling, so refresh succeeds but verification fails; move its `.refresh-backup` outside the checkout, run `git rm --cached -- PATH/Copy-Checkout.mjs` and `git add -- PATH/copy-checkout.mjs base-copies.json`, then verify again. This preserves both the backup and delivered bytes; corrected refusal text ships in 0.2.83.
44
+ - For a Base-equal untracked, ignored or excluded authoring helper, the suggested `git add -f` followed by refresh can leave `verify-base` reporting `unrecordedCopies`; from the seed root, run `node node_modules/@runeditrun/rer/edition-authoring/cli.mjs record-base LOCAL_PATH ORIGIN_PATH FULL_40_HEX_COMMIT --base /absolute/base-checkout`, then the same entry's `verify-base --base /absolute/base-checkout`. The manual recovery remains necessary.
45
+ - On case-insensitive APFS, the suggested `mv -i` for a Base-equal committed `Copy-Checkout.mjs` can leave the old Git index spelling, so refresh succeeds but verification fails; move its `.refresh-backup` outside the checkout, run `git rm --cached -- PATH/Copy-Checkout.mjs` and `git add -- PATH/copy-checkout.mjs base-copies.json`, then verify again. This preserves both the backup and delivered bytes; the manual recovery remains necessary.
15
46
 
16
47
  ## 0.2.81
17
48
 
@@ -1,16 +1,13 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { containedInput } from './input-path.mjs';
3
- import { pathToFileURL } from 'node:url';
4
3
 
5
4
  export async function demoRunDeclaration(declaration, { root, adapter, read } = {}) {
6
5
  if (declaration.runUrl !== undefined) return declaration;
7
6
  read ??= async path => JSON.parse(await readFile(await containedInput(root, path), 'utf8'));
8
7
  let bare = false;
9
8
  if (adapter === undefined) {
10
- let operations;
11
- try { operations = await read('OPERATIONS.json'); }
9
+ try { await read('OPERATIONS.json'); }
12
10
  catch (error) { if (error.code !== 'ENOENT') throw error; bare = true; }
13
- if (operations?.seedContract) adapter = (await import(pathToFileURL(await containedInput(root, operations.seedContract.adapter)).href)).commandAdapter;
14
11
  }
15
12
  const path = adapter?.site?.declaration ?? (bare ? 'deploy-site.json' : undefined);
16
13
  if (!path) return declaration;
@@ -21,7 +21,7 @@ export function demoSockets() {
21
21
  if (error.code !== 'ENOENT') throw error;
22
22
  if (on()) throw new Error('rer demo needs deploy-demo.json with the product name and canonical run-site domain. See DEMO.md.');
23
23
  }
24
- const resolved = declaration && await demoRunDeclaration(declaration, { root: config.root ?? process.cwd() });
24
+ const resolved = declaration && await demoRunDeclaration(process.env.RER_DEMO_RUN_URL === undefined ? declaration : {...declaration, runUrl: process.env.RER_DEMO_RUN_URL}, { root: config.root ?? process.cwd() });
25
25
  return {
26
26
  define: { 'import.meta.rerDemo': JSON.stringify(resolved ? { name: resolved.name, url: demoRunUrl(resolved.runUrl === undefined ? `https://${resolved.domain}/run` : resolved.runUrl) } : null) },
27
27
  ...(on() && command === 'serve' ? { resolve: { alias: [{ find: /^cloudflare:sockets$/, replacement: 'cloudflare:sockets' }] } } : {}),
@@ -294,7 +294,7 @@ The old kit `_rer_deploy_migrations` ledger is moved atomically into `d1_migrati
294
294
 
295
295
  `operations/operations.mjs` retains v1 compatibility and supports declarative v2 `loops`. A required disabled loop fails. Enabled mail loops explicitly select `resend`, `sendgrid` or `cloudflare`; the corresponding nonblank key is required (`RESEND_API_KEY`, `SENDGRID_API_KEY`, or `CLOUDFLARE_EMAIL_API_TOKEN` plus `CLOUDFLARE_EMAIL_ACCOUNT_ID`). A conflicting `MAIL_PROVIDER` fails. Optional disabled features pass. No DNS, mail, build, deployment or provider request occurs in these checks. Existing v1 executable adapters remain the existing reviewed local contract; deploy-kit `check()` refuses executable configuration and accepts declarative v2 only. `mailPlan()` consumes the mail module's `mailDoctor(...,live:false)` once that module is integrated; absence is an explicit import error.
296
296
 
297
- `createTemplates({destination,project,sourcePaths,commands,loops})` creates a new directory only, containing `edition.json`, `OPERATIONS.json` v2, **both** operations modules and the real edition-authoring tool modules. Commands/effects and selected paths must describe actual adopter files. Add actual sources, initialize Git and stage them, then call `lockTemplates(root)`: it invokes actual edition-authoring `lock` and `check`, generating real `sources.lock.json` hashes and retaining any recipe-selected origins. Existing destinations and locks are refused. It never invents source hashes or overwrites an owner edition.
297
+ `createTemplates({destination,project,sourcePaths,commands,loops})` creates a new directory only, containing `edition.json`, `OPERATIONS.json` v2, **both** operations modules and the complete real edition-authoring tool (its modules and vendored parsers with their licences). Commands/effects and selected paths must describe actual adopter files. Add actual sources, initialize Git and stage them, then call `lockTemplates(root)`: it invokes actual edition-authoring `lock` and `check`, generating real `sources.lock.json` hashes and retaining any recipe-selected origins. Existing destinations and locks are refused. It never invents source hashes or overwrites an owner edition.
298
298
 
299
299
  ## Validation and provenance
300
300
 
@@ -1,9 +1,10 @@
1
- import { access, mkdir, readdir, copyFile, writeFile } from 'node:fs/promises';
1
+ import { access, mkdir, copyFile, writeFile } from 'node:fs/promises';
2
2
  import { constants } from 'node:fs';
3
3
  import { execFileSync } from 'node:child_process';
4
4
  import { resolve, join, dirname } from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import { assert } from './validation.mjs';
7
+ import { toolFiles } from '../../edition-authoring/files.mjs';
7
8
  const base = resolve(dirname(fileURLToPath(import.meta.url)),'../..');
8
9
  /** Generate alongside an edition. The existing edition tree is never an output directory. */
9
10
  export async function createTemplates({destination,project,sourcePaths,commands,loops=[]}) {
@@ -13,9 +14,8 @@ export async function createTemplates({destination,project,sourcePaths,commands,
13
14
  await mkdir(root,{recursive:false});
14
15
  // A new directory only: callers add actual edition sources then run the lock command.
15
16
  const scripts = join(root,'scripts'); await mkdir(scripts);
16
- await mkdir(join(scripts,'edition-authoring'));
17
17
  for (const name of ['operations.mjs','project-operations.mjs']) await copyFile(join(base,'operations',name),join(scripts,name),constants.COPYFILE_EXCL);
18
- for (const name of await readdir(join(base,'edition-authoring'))) if (name.endsWith('.mjs') && !name.endsWith('.test.mjs')) await copyFile(join(base,'edition-authoring',name),join(scripts,'edition-authoring',name),constants.COPYFILE_EXCL);
18
+ for (const name of toolFiles(join(base,'edition-authoring'))) { await mkdir(dirname(join(scripts,'edition-authoring',name)),{recursive:true}); await copyFile(join(base,'edition-authoring',name),join(scripts,'edition-authoring',name),constants.COPYFILE_EXCL); }
19
19
  await writeFile(join(root,'OPERATIONS.json'),JSON.stringify({version:2,project,runtime:{requirements:[{name:'node',version:'>=22.12.0'}]},requiredEnvironment:[],commands,loops},null,2)+'\n',{flag:'wx'});
20
20
  await writeFile(join(root,'edition.json'),JSON.stringify({schemaVersion:1,id:project,toolchain:{id:'runeditrun/edition-authoring',version:'1.1.0'},parent:null,components:[{id:project,role:'edition',source:{kind:'local',paths:sourcePaths}}]},null,2)+'\n',{flag:'wx'});
21
21
  return {root,lock:['node','scripts/edition-authoring/cli.mjs','lock'],check:['node','scripts/edition-authoring/cli.mjs','check']};
@@ -36,10 +36,10 @@ export function operatorInstaller({ database, features, prepare, prepareData })
36
36
  // without the key. trafficProxy also refuses /cdn-cgi/* on the public listener.
37
37
  const devBindings = devKey => devKey ? { RER_DEV_KEY: devKey, RER_DEV_IDENTITY: 'on' } : {};
38
38
  const internalPort = port => { if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error('A local runtime requires the traffic proxy internal port.'); return String(port); };
39
- const developmentEnvironment = () => { const { RER_MODELS_SERVICE, RER_MODELS_KEY, RER_DEMO, RER_DEMO_EXPIRES, RER_STATE_DIR, ...env } = process.env; return env; };
39
+ const developmentEnvironment = () => { const { RER_MODELS_SERVICE, RER_MODELS_KEY, RER_DEMO, RER_DEMO_EXPIRES, RER_STATE_DIR, RER_DEMO_RUN_URL, ...env } = process.env; return env; };
40
40
  // A demo's Vite persists to its own folder (the seed's vite.config reads RER_STATE_DIR)
41
41
  // and its Worker sees RER_DEMO=1 and the demo's end (modules/demo).
42
- const demoBindings = demo => demo ? { RER_DEMO: '1', RER_DEMO_EXPIRES: demo.ends, RER_STATE_DIR: demo.state } : {};
42
+ const demoBindings = demo => demo ? { RER_DEMO: '1', RER_DEMO_EXPIRES: demo.ends, RER_STATE_DIR: demo.state, RER_DEMO_RUN_URL: demo.runUrl } : {};
43
43
  export const developmentTarget = ({ root, origin, runtimePort, devKey, modelsLive, demo }) => [process.execPath, [projectViteBinary(root), 'dev', '--host', '127.0.0.1', '--port', internalPort(runtimePort), '--strictPort'], { env: { ...developmentEnvironment(), PATH: [process.env.PATH, join(root, 'node_modules', '.bin')].filter(value => value !== undefined).join(delimiter), RER_DEV_ORIGIN: origin, WRANGLER_SEND_METRICS: 'false', X_LOCAL_EXPLORER: 'false', ...devBindings(devKey), ...(modelsLive ? { RER_MODELS_SERVICE: modelsLive.baseUrl, RER_MODELS_KEY: modelsLive.apiKey } : {}), ...demoBindings(demo) } }];
44
44
 
45
45
  export const previewTarget = ({ origin, runtimePort, devKey, scheduled }) => [process.execPath, [fileURLToPath(new URL('./production-runtime.mjs', import.meta.url))], { env: { ...process.env, RER_DEV_ORIGIN: origin, RER_RUNTIME_HOST: '127.0.0.1', RER_RUNTIME_PORT: internalPort(runtimePort), WRANGLER_SEND_METRICS: 'false', CLOUDFLARE_INCLUDE_PROCESS_ENV: 'false', X_LOCAL_EXPLORER: 'false', RER_RUNTIME_TRIGGERS: scheduled ? '1' : '0', ...(devKey ? { RER_DEV_KEY: devKey } : {}) } }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runeditrun/rer",
3
- "version": "0.2.82",
3
+ "version": "0.2.84",
4
4
  "description": "The rer command: install, set up, run and launch Run Edit Run checkouts.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -137,6 +137,12 @@ regenerates the manifest, and its `--check` mode rejects a stale one. An
137
137
  alphabetic top-level domain label ends before a following digit, so a match
138
138
  ends at the DER string's boundary rather than absorbing the next tag byte.
139
139
 
140
+ `third_party_notices.py` loads Base's listed licence texts and compares the Git
141
+ blob ID of a licence-named file's complete bytes with them, computed from the
142
+ bytes so untracked working files bind the same way. Only `hygiene.email` from
143
+ that file's content becomes a `notice.third-party` entry in `thirdPartyNotices`;
144
+ the path and every other rule are inspected as usual.
145
+
140
146
  `controller_metadata.py` recognizes the standalone controller review manifest by
141
147
  its exact four-field structure, immutable source revision, descriptor digest,
142
148
  relative directory list and path-to-SHA-256 file map, at any JSON path. Only
@@ -18,6 +18,7 @@ from content_identities import ContentIdentities, candidate as identity_candidat
18
18
  from checksum_maps import ChecksumMaps
19
19
  from credential_assignments import text_rules, Findings
20
20
  from assignment import is_assignment
21
+ from third_party_notices import RULE as NOTICE, blob_id
21
22
 
22
23
 
23
24
  def scan(repo, ref='HEAD', public_base=None, env_file=None, project=None, repository=None, *, cache_dir=None, timeout=300, annotation_file=None):
@@ -37,7 +38,7 @@ def scan(repo, ref='HEAD', public_base=None, env_file=None, project=None, reposi
37
38
  config = load_config(history.selected(CONFIG))
38
39
  reviewed_bytes = history.selected(REVIEWED)
39
40
  reviewed = load_reviewed(reviewed_bytes) if reviewed_bytes else {}
40
- add = Findings(report, reviewed, hashes).add
41
+ add = Findings(report, reviewed, hashes, config['thirdPartyNotices']).add
41
42
  try:
42
43
  config['pendingDestination'] = destination(history, project, repository)
43
44
  except (ValueError, TypeError, UnicodeError):
@@ -87,7 +88,7 @@ def scan(repo, ref='HEAD', public_base=None, env_file=None, project=None, reposi
87
88
  rules, provenance, references = inspected[key]
88
89
  entry_scope = 'pre-existing' if (scope != 'release-tree' and oid in public_blobs) or public_paths.get(path) == oid else scope
89
90
  for rule in rules:
90
- add(rule, path, commit, oid, entry_scope)
91
+ add(rule, path, commit, blob_id(history.blob(oid)) if rule == NOTICE else oid, entry_scope)
91
92
  if references:
92
93
  deferred.append((references, path, commit, oid, entry_scope))
93
94
  if provenance:
@@ -109,7 +110,8 @@ def scan(repo, ref='HEAD', public_base=None, env_file=None, project=None, reposi
109
110
  public_oid = public_paths.get(path)
110
111
  scope = 'pre-existing' if public_oid and (public_oid == oid or history.blob(public_oid) == data) else 'working-tree'
111
112
  for rule in rules:
112
- add(rule, path, history.commit, oid, scope)
113
+ # A notice names the exact bytes it matched, tracked or not.
114
+ add(rule, path, history.commit, blob_id(data) if rule == NOTICE else oid, scope)
113
115
  if references:
114
116
  deferred.append((references, path, history.commit, oid, scope))
115
117
  if path == 'LICENSE':
@@ -2,6 +2,7 @@
2
2
  import json
3
3
  import re
4
4
  from publication_config import intended_public_repositories
5
+ from third_party_notices import third_party_notices
5
6
 
6
7
  # A home segment within a relative path is not an absolute home directory.
7
8
  # Match the username itself so a bare home, including one with spaces, counts.
@@ -34,7 +35,7 @@ def load_config(data=None):
34
35
  except re.error:
35
36
  raise ValueError('invalid internal reference regex') from None
36
37
  return {'publicEmails': {e.lower() for e in emails}, 'internalReferencePatterns': compiled,
37
- 'intendedPublicRepositories': intended_public_repositories()}
38
+ 'intendedPublicRepositories': intended_public_repositories(), 'thirdPartyNotices': third_party_notices()}
38
39
 
39
40
 
40
41
  def public_email(address, config):
@@ -1,6 +1,7 @@
1
1
  """Caller-compatible, value-free publication reports."""
2
2
  from policy import safe_path
3
3
  from reviewed import FORBIDDEN
4
+ from third_party_notices import RULE as NOTICE
4
5
 
5
6
 
6
7
  def new_report(public_base=False):
@@ -8,20 +9,23 @@ def new_report(public_base=False):
8
9
  scanner=dict(name='gitleaks', version='8.30.1'),
9
10
  history=dict(scope='selected-and-public-base' if public_base else 'all-local-refs-and-selected-commit',
10
11
  commits=0, trees=0, blobs=0, commitMessages=0, tagMessages=0),
11
- findings=[], preExisting=[], warnings=[], fixtures=[], reviewed=[], info=[],
12
+ findings=[], preExisting=[], warnings=[], fixtures=[], reviewed=[], info=[], thirdPartyNotices=[],
12
13
  guarantees=dict(historyScanned=False, visualRecognition=False, environmentChecked=False))
13
14
 
14
15
 
15
16
  class Findings:
16
- def __init__(self, report, reviewed, env_hashes):
17
+ def __init__(self, report, reviewed, env_hashes, notices=None):
17
18
  self.report, self.reviewed, self.env_hashes = report, reviewed, env_hashes
19
+ self.notices = notices or {}
18
20
  self.seen = {}
19
21
 
20
22
  def add(self, rule, path, commit=None, oid=None, scope='newly-public', bucket=None, scanner_rule=None):
21
23
  bucket = bucket or ('preExisting' if scope == 'pre-existing' and rule != 'secret.env-match' else 'findings')
22
24
  if rule in ('pending-public-destination', 'provenance.declared-source'):
23
25
  bucket = 'info'
24
- if (rule, path, oid) in self.reviewed and bucket != 'info':
26
+ if rule == NOTICE:
27
+ bucket = 'thirdPartyNotices'
28
+ if (rule, path, oid) in self.reviewed and bucket not in ('info', 'thirdPartyNotices'):
25
29
  if rule in FORBIDDEN:
26
30
  self.add('reviewed.forbidden', path, commit, oid, scope)
27
31
  else:
@@ -41,6 +45,8 @@ class Findings:
41
45
  item['scannerRule'] = scanner_rule
42
46
  if bucket == 'info':
43
47
  item['severity'] = 'INFO'
48
+ if bucket == 'thirdPartyNotices':
49
+ item.update(package=self.notices[oid]['package'], version=self.notices[oid]['version'])
44
50
  self.seen[key] = item
45
51
  self.report[bucket].append(item)
46
52
 
@@ -0,0 +1,13 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "notices": [
4
+ {
5
+ "blob": "e060aaa1fe0f933e699c8feb3fdcc51c2999bf0c",
6
+ "package": "yaml",
7
+ "version": "2.9.1",
8
+ "licence": "ISC",
9
+ "source": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz",
10
+ "reason": "The LICENSE file of the yaml 2.9.1 npm package, byte for byte (git hash-object of package/LICENSE in that registry tarball), vendored under edition-authoring/vendor/yaml. The ISC licence requires retaining its copyright notice, whose maintainer attribution is third-party public text, not an identity of ours."
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,38 @@
1
+ """Exact upstream licence texts whose copyright notices are third-party public text, maintained by Base only."""
2
+ import hashlib
3
+ import json
4
+ import re
5
+ from pathlib import Path
6
+ from publication_config import unique_object
7
+
8
+ RULE = 'notice.third-party'
9
+ LICENCE_NAMES = frozenset({'LICENSE', 'LICENCE', 'LICENSE.md', 'LICENSE.txt', 'COPYING'})
10
+ FIELDS = {'blob', 'package', 'version', 'licence', 'source', 'reason'}
11
+
12
+
13
+ def blob_id(data):
14
+ # Git's object identity of these exact bytes, also for files with no tree entry.
15
+ return hashlib.sha1(b'blob %d\0' % len(data) + data).hexdigest()
16
+
17
+
18
+ def third_party_notices():
19
+ path = Path(__file__).with_name('third-party-notices.json')
20
+ document = json.loads(path.read_bytes(), object_pairs_hook=unique_object)
21
+ if (not isinstance(document, dict) or set(document) != {'schemaVersion', 'notices'} or
22
+ document['schemaVersion'] != 1 or not isinstance(document['notices'], list)):
23
+ raise ValueError('invalid third-party notices')
24
+ notices = {}
25
+ for entry in document['notices']:
26
+ if (not isinstance(entry, dict) or set(entry) != FIELDS or
27
+ not all(isinstance(entry[k], str) and entry[k].strip() for k in FIELDS) or
28
+ not re.fullmatch(r'[0-9a-f]{40}', entry['blob']) or entry['blob'] in notices):
29
+ raise ValueError('invalid third-party notice')
30
+ notices[entry['blob']] = entry
31
+ return notices
32
+
33
+
34
+ def notice(path, data, notices):
35
+ """The listed notice these exact bytes are, only under a licence file name."""
36
+ if path.rsplit('/', 1)[-1] not in LICENCE_NAMES:
37
+ return None
38
+ return notices.get(blob_id(data))
@@ -10,6 +10,7 @@ from project_identity import tree_identity
10
10
  from licenses import license_rules
11
11
  from git_history import InspectionError
12
12
  from trust_bundle import bundles
13
+ from third_party_notices import RULE as NOTICE, notice
13
14
 
14
15
  DEPENDENCY_DIRS = {'.git', 'node_modules'}
15
16
 
@@ -40,6 +41,11 @@ def context(history, commit, config):
40
41
  def text_rules(data, path, config, env_hashes, *, commit_message=False):
41
42
  """Rules, provenance and the repository references whose rules wait for one bulk resolution."""
42
43
  rules, provenance, references = inspect(data, path, config, commit_message=commit_message)
44
+ # A listed upstream licence text, byte for byte under a licence file name,
45
+ # keeps its copyright notice: it is reported as a notice, not a finding.
46
+ # The path itself, and every other rule, stays inspected.
47
+ if 'hygiene.email' in rules and notice(path, data, config['thirdPartyNotices']):
48
+ rules = rules - {'hygiene.email'} | {NOTICE}
43
49
  path_rules, _, path_references = inspect(path.encode('utf-8', 'surrogateescape'), '@path', config)
44
50
  rules.update(path_rules)
45
51
  if env_hashes and (environment_match(data, env_hashes) or environment_match(path.encode(), env_hashes)):
@@ -64,7 +64,7 @@ finally {
64
64
  if (reason) report = {
65
65
  schema: 'rer.publish-check/v3', status: 'INCOMPLETE', complete: false, source: null,
66
66
  findings: [{ rule: reason, path: '.', commit: null, scope: 'newly-public' }],
67
- preExisting: [], warnings: [], fixtures: [], reviewed: [], info: [],
67
+ preExisting: [], warnings: [], fixtures: [], reviewed: [], info: [], thirdPartyNotices: [],
68
68
  history: { commits: 0, trees: 0, blobs: 0 },
69
69
  guarantees: { historyScanned: false, visualRecognition: false, environmentChecked: false },
70
70
  };