@runeditrun/rer 0.2.22 → 0.2.24

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 (72) hide show
  1. package/cli/README.md +19 -0
  2. package/cli/bounded.mjs +5 -1
  3. package/cli/delivery-declarations.mjs +2 -2
  4. package/cli/demo-host.mjs +1 -1
  5. package/cli/deploy-command.mjs +7 -5
  6. package/cli/deploy-inputs.mjs +4 -1
  7. package/cli/deploy-observation.mjs +20 -2
  8. package/cli/deploy-owner.mjs +12 -7
  9. package/cli/deploy.mjs +9 -6
  10. package/cli/deployment-record.mjs +52 -0
  11. package/cli/local.mjs +11 -3
  12. package/cli/managed-server.mjs +2 -1
  13. package/cli/output.mjs +1 -1
  14. package/cli/production-auth.mjs +7 -27
  15. package/cli/production-mail.mjs +72 -0
  16. package/cli/signin.mjs +11 -6
  17. package/cli/site.mjs +2 -2
  18. package/global/CHANGELOG.md +25 -0
  19. package/modules/container/README.md +8 -3
  20. package/modules/container/adapters/d1.mjs +1 -1
  21. package/modules/container/build.mjs +1 -1
  22. package/modules/container/host.mjs +7 -4
  23. package/modules/container/transfer.mjs +0 -1
  24. package/modules/container/websockets.mjs +54 -0
  25. package/modules/container/worker-engine.mjs +3 -3
  26. package/modules/demo/README.md +4 -0
  27. package/modules/demo/label.mjs +7 -4
  28. package/modules/demo/responses.mjs +1 -1
  29. package/modules/demo-host/README.md +34 -9
  30. package/modules/demo-host/capacity.mjs +2 -2
  31. package/modules/demo-host/container.mjs +19 -7
  32. package/modules/demo-host/placement.mjs +19 -5
  33. package/modules/demo-host/plan.mjs +11 -6
  34. package/modules/demo-host/start-script.mjs +2 -1
  35. package/modules/demo-host/startup.mjs +3 -3
  36. package/modules/demo-host/worker.mjs +36 -13
  37. package/modules/deploy-kit/README.md +35 -2
  38. package/modules/deploy-kit/diagnostics.mjs +16 -1
  39. package/modules/deploy-kit/owner-cli.mjs +3 -3
  40. package/modules/deploy-kit/owner-remove.mjs +23 -5
  41. package/modules/deploy-kit/owner-signin.mjs +1 -1
  42. package/modules/deploy-kit/pagination.mjs +99 -0
  43. package/modules/deploy-kit/provider.mjs +30 -70
  44. package/modules/deploy-kit/r2-objects.mjs +6 -17
  45. package/modules/deploy-kit/site-readback.mjs +67 -0
  46. package/modules/deploy-kit/site.mjs +17 -31
  47. package/modules/deploy-kit/uploaded-worker.mjs +9 -3
  48. package/modules/erasure/queue.mjs +0 -2
  49. package/modules/job-queue/cli.mjs +1 -1
  50. package/modules/mail/README.md +14 -5
  51. package/modules/mail/src/adapters/rer/contract.mjs +33 -5
  52. package/modules/mail/src/adapters/rer/index.mjs +4 -1
  53. package/modules/mail/src/core/transport.mjs +9 -3
  54. package/modules/operator-auth/README.md +5 -0
  55. package/modules/operator-auth/identity/email-link/index.mjs +5 -0
  56. package/modules/operator-auth/identity/oidc/jwt.mjs +1 -1
  57. package/modules/portability/bridge.mjs +3 -3
  58. package/modules/portability/catalogue.mjs +1 -1
  59. package/modules/portability/cli-options.mjs +1 -1
  60. package/modules/portability/legacy-files.mjs +1 -1
  61. package/modules/portability/legacy-safety.mjs +3 -3
  62. package/modules/portability/payloads.mjs +1 -1
  63. package/modules/release/source.mjs +1 -1
  64. package/onboarding/local/operation.mjs +4 -2
  65. package/onboarding/local/owner.mjs +9 -3
  66. package/onboarding/local/state-files.mjs +17 -0
  67. package/onboarding/process-diagnostics.mjs +25 -5
  68. package/package.json +1 -1
  69. package/scripts/publish-check/README.md +5 -2
  70. package/scripts/publish-check/content_identities.py +1 -1
  71. package/scripts/publish-check/json_identity.py +10 -1
  72. package/scripts/publish-check/public_hygiene.py +30 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runeditrun/rer",
3
- "version": "0.2.22",
3
+ "version": "0.2.24",
4
4
  "description": "The rer command: install, set up, run and launch Run Edit Run checkouts.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -63,8 +63,11 @@ public report. Authoring's integrity checks remain unchanged.
63
63
  against every declared file's bytes and regular-file mode in the same scanned
64
64
  tree. Historical matches use only that commit's blobs; present files cannot
65
65
  rescue a historical mismatch. Working-tree preimages reject linked paths.
66
- Only the exact native match at a proved inventory field is classified. There
67
- is no filename, hash-value or comma-delimited credential exemption.
66
+ Copy records use the same proof at custom JSON paths.
67
+ The captured secret must occur unambiguously inside the exact proved JSON value;
68
+ a native fragment ending partway through a digest qualifies too. The same value
69
+ in another field remains a finding. There is no filename, hash-value or
70
+ comma-delimited credential exemption.
68
71
 
69
72
  `checksum_maps.py` classifies a file-name to digest map (`'0005_operator_auth.sql':
70
73
  '<sha256>'`, in JSON, JavaScript, YAML or similar) in any file outside the
@@ -24,7 +24,7 @@ class ContentIdentities:
24
24
  pointers = set(module_pins(path, document.value))
25
25
  pointers.update(source_pointers(path, document.value))
26
26
  pointers.update(controller_pointers(document.value))
27
- if path in ('base-copies.json', 'base/PROVENANCE.json') and read_regular is not None:
27
+ if read_regular is not None:
28
28
  pointers.update(copy_pointers(document.value, read_regular))
29
29
  self.allowed[path] = pointers
30
30
 
@@ -67,13 +67,22 @@ class Document:
67
67
  def matches(self, hit, pointers):
68
68
  if hit.get('RuleID') not in ('generic-api-key', 'hex-api-key'):
69
69
  return False
70
+ secret = hit.get('Secret', '').encode('utf-8')
71
+ if not secret:
72
+ return False
70
73
  located = set()
71
74
  for left, right in match_spans(self.data, hit):
75
+ start = self.data.find(secret, left, right)
76
+ if start < 0 or self.data.find(secret, start + 1, right) >= 0:
77
+ continue
72
78
  for pointer in pointers:
73
79
  span = self.spans.get(pointer)
74
80
  if span:
75
81
  a, b, value = span
76
- if (left <= a + 1 and b - 1 <= right and hit.get('Secret') == value
82
+ # Native fragments can truncate a digest capture. Bind the
83
+ # captured secret's bytes, including a partial capture, to
84
+ # this exact unescaped JSON value.
85
+ if (a + 1 <= start and start + len(secret) <= b - 1
77
86
  and self.data[a + 1:b - 1] == value.encode('ascii')):
78
87
  located.add((a, b))
79
88
  return len(located) == 1
@@ -12,11 +12,12 @@ from png_text import text_chunks
12
12
  from media import sample_spans
13
13
  from c2pa import certificate_spans
14
14
  URI_AUTHORITY = re.compile(r'''//(?P<authority>[^/?#\s<>"']+)''')
15
+ ACTION_REFERENCE = re.compile(r'''uses:\s*["']?[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+@[^\s"']+''')
15
16
  SCHEME_CHARACTERS = frozenset('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+.-')
16
17
  # Match raw, complete commit trailer lines; decoded or embedded prose cannot
17
18
  # acquire trailer privileges. Only the address span is omitted from email checks.
18
19
  COAUTHOR = re.compile(
19
- rb'^Co-Authored-By:[ \t]+[^<>\r\n]*[^<>\s][ \t]+<(?P<address>'
20
+ rb'^Co-Authored-By:[ \t]+(?=[^ \t])[^<>\r\n]*[^<>\s][ \t]+<(?P<address>'
20
21
  rb'noreply@(?:anthropic|github)\.com|'
21
22
  rb'[0-9]+\+[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){0,38}@users\.noreply\.github\.com'
22
23
  rb')>[ \t]*\r?$', re.I | re.M)
@@ -27,7 +28,7 @@ def without_public_coauthor_addresses(data):
27
28
  # A quoted attribution followed by ordinary prose stays ordinary body text.
28
29
  tail = data.rstrip(b' \t\r\n')
29
30
  block = re.split(rb'\r?\n[ \t]*\r?\n', tail)[-1]
30
- if not all(re.fullmatch(rb'[A-Za-z0-9-]+:[ \t]+[^\r\n]+\r?', line)
31
+ if not all(re.fullmatch(rb'[A-Za-z0-9-]+:[ \t][^\r\n]+\r?', line)
31
32
  for line in block.split(b'\n')):
32
33
  return data
33
34
  offset = len(tail) - len(block)
@@ -74,11 +75,36 @@ def private_emails(text, config):
74
75
  email_text = re.sub(r'(?i)\b(?a:git@github\.com:)(?=[A-Za-z0-9]|\$\{[A-Za-z_$][A-Za-z0-9_.$]*\})', '', email_text)
75
76
  # A package manager's patch filename joins the name and version with an at sign.
76
77
  version = r'(?:v?[0-9]+(?:\.[0-9]+)*(?:-[A-Za-z0-9-]+)?|[a-f0-9]{40})(?:\.patch)?(?![A-Za-z0-9_.-])'
77
- email_text = re.sub(r'(?m)^\s*-?\s*uses:\s*[\"\']?[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+@[^\s\"\']+', '', email_text)
78
- email_text = re.sub(r'(?<![A-Za-z0-9])(?:@[A-Za-z0-9_.-]+/)?[A-Za-z0-9_.-]+(?:/[A-Za-z0-9_.-]+)?@' + version, '', email_text)
78
+ email_text = without_action_references(email_text)
79
+ # Only the first character of a package token can change the outcome.
80
+ # Keep the outer boundary for scopes preceded by punctuation (x.@scope/pkg).
81
+ email_text = re.sub(r'(?<![A-Za-z0-9])(?:@[A-Za-z0-9_.-]+/)?(?<![A-Za-z0-9_.-])[A-Za-z0-9_.-]+(?:/[A-Za-z0-9_.-]+)?@' + version, '', email_text)
79
82
  return [match.group() for match in EMAIL.finditer(email_text) if not public_email(match.group(), config)]
80
83
 
81
84
 
85
+ def without_action_references(text):
86
+ pieces, offset = [], 0
87
+ for match in ACTION_REFERENCE.finditer(text):
88
+ # Locate the literal first, then walk each whitespace gap once. A
89
+ # multiline ^\s*-?\s* retries and repartitions long blank-line runs.
90
+ start = match.start()
91
+ while start > offset and text[start - 1].isspace():
92
+ start -= 1
93
+ if start > offset and text[start - 1] == '-':
94
+ start -= 1
95
+ while start > offset and text[start - 1].isspace():
96
+ start -= 1
97
+ if start > 0 and text[start - 1] != '\n':
98
+ newline = text.find('\n', start, match.start())
99
+ if newline < 0:
100
+ continue
101
+ start = newline + 1
102
+ pieces.append(text[offset:start])
103
+ offset = match.end()
104
+ pieces.append(text[offset:])
105
+ return ''.join(pieces)
106
+
107
+
82
108
  # A stored host name is lower case, upper case or capitalised, label by label.
83
109
  # Bytes that merely decode to text, such as compressed pixels, rarely are.
84
110
  HOST_LABEL = re.compile(r'(?:[a-z0-9-]+|[A-Z0-9-]+|[A-Z][a-z0-9-]*)')