docs(code-runtime): sync Agent Note and public JSDoc with the shipped seam

- Agent Note: correct the stale worker-adoption paragraph — the worker
  consumes the seam constants directly by name (no RESERVED_WORDS /
  RESERVED_ERROR_PROPERTIES re-alias) — and describe DUNDER_MEMBER as
  `__x__` (non-empty middle).
- types.ts: document RESERVED_BINDING_GLOBALS on CodeBindingNamespace.global
  (names like `__dsh_main__` pass the identifier rule but are still refused)
  and the non-empty-middle dunder rule on memberNameProperty; propagate to
  the type-equiv derivative docs (both languages, re-recorded).
This commit is contained in:
Chinesezjc
2026-08-01 05:54:04 +08:00
parent 4dc2b197d7
commit c05db227d5
7 changed files with 29 additions and 20 deletions

View File

@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/core-data-structures/code-runtime.md
code-runtime.md: 522fe29deae8cac01462a336a02d082502b61fb4
code-runtime.zh.md: 6d16f8ed2ab3b99620f30a8e81dc3718cf1419d1
code-runtime.md: e7b5a86513abcab90eb81fc0b24296760bf3b926
code-runtime.zh.md: 17ddbb0f685d97ba3c2dd6a23744771e88a40ed0

View File

@@ -76,9 +76,9 @@ interface CodeBindingErrorClass {
name: string
/**
* Non-empty own property for the member name. The portable exclusion set is
* `RESERVED_ERROR_MEMBERS` plus dunder-form names (`__*__`), enforced
* identically by every backend; any other name — identifiers or not — is
* accepted everywhere.
* `RESERVED_ERROR_MEMBERS` plus dunder-form names (`__x__`, non-empty
* middle), enforced identically by every backend; any other name —
* identifiers or not — is accepted everywhere.
*/
memberNameProperty: string
}
@@ -98,7 +98,10 @@ interface CodeBindingNamespace {
* identifier subset `[A-Za-z_][A-Za-z0-9_]*` and no language's reserved
* words, so the same namespace list works against every backend regardless
* of `language` — a JS-only spelling like `$tools` is rejected by design,
* not just by the Python backend.
* not just by the Python backend. Names that satisfy the identifier rule but
* name a backend-owned slot (`RESERVED_BINDING_GLOBALS`: `console`,
* `__dsh_main__`, `__builtins__`, `__name__`, `__debug__`) are also refused
* everywhere, since some backend seeds that slot in the program's namespace.
*/
global: string
/** The callable members, keyed by the exact name the program calls. */

View File

@@ -76,9 +76,9 @@ interface CodeBindingErrorClass {
name: string
/**
* Non-empty own property for the member name. The portable exclusion set is
* `RESERVED_ERROR_MEMBERS` plus dunder-form names (`__*__`), enforced
* identically by every backend; any other name — identifiers or not — is
* accepted everywhere.
* `RESERVED_ERROR_MEMBERS` plus dunder-form names (`__x__`, non-empty
* middle), enforced identically by every backend; any other name —
* identifiers or not — is accepted everywhere.
*/
memberNameProperty: string
}
@@ -98,7 +98,10 @@ interface CodeBindingNamespace {
* identifier subset `[A-Za-z_][A-Za-z0-9_]*` and no language's reserved
* words, so the same namespace list works against every backend regardless
* of `language` — a JS-only spelling like `$tools` is rejected by design,
* not just by the Python backend.
* not just by the Python backend. Names that satisfy the identifier rule but
* name a backend-owned slot (`RESERVED_BINDING_GLOBALS`: `console`,
* `__dsh_main__`, `__builtins__`, `__name__`, `__debug__`) are also refused
* everywhere, since some backend seeds that slot in the program's namespace.
*/
global: string
/** The callable members, keyed by the exact name the program calls. */