Repository navigation
Quality round: 12 Sonar rules, EventEmitter rationale, and engine-parity host polish - #88
Merged
Merged
Conversation
Co-Authored-By: Claude Code <noreply@anthropic.com>
…tion Co-Authored-By: Claude Code <noreply@anthropic.com>
Mailbox.items/waiters, EventBus.mailboxes, FunctionRegistry.services - all mutated in place, never reassigned. Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
…o default Object stringification S2933 (overrides readonly), S6582 (!key?.trim()), S6606 (instance ??=), S6594 (hoisted WHOLE_REF.exec; same-rule twin fixed in log.ts callSite), S6551 x2 (asText helper: primitives via String, structures via JSON - aligns with the python twin's str() rendering better than '[object Object]'). Co-Authored-By: Claude Code <noreply@anthropic.com>
…est wire-text rendering (S6551) copyStringFields/copyNumericFields extraction takes fromMap from 23 to well under 15; asText (primitives via String, structures via JSON) replaces default Object stringification for the wire id and string-map values - golden vectors green. Co-Authored-By: Claude Code <noreply@anthropic.com>
…ime CALL_SITE regex (S8786) Excluding ':' from the name class removes the ambiguity that let the lazy quantifier backtrack super-linearly. Co-Authored-By: Claude Code <noreply@anthropic.com>
… absorbed by it The teaching (body | EventEnvelope | promise of either) moves to the type's doc comment; the bus awaits and instanceof-discriminates anyway. Co-Authored-By: Claude Code <noreply@anthropic.com>
…their condition Co-Authored-By: Claude Code <noreply@anthropic.com>
…Object stringification Co-Authored-By: Claude Code <noreply@anthropic.com>
…near call-site parse - actuator S3776: checkServices 20 -> per-route checkService extraction - actuator/config/envelope S6551: one hardened asText (object -> JSON, function -> toString, primitives -> String), exported from the codec module; config's local copy removed - cli S7785: top-level await replaces the then/catch chain (ESM, node>=20) - log S8786 (round 2): the scanning regex was still polynomial on non-matching input; callSite now parses right-to-left with lastIndexOf - strictly linear Co-Authored-By: Claude Code <noreply@anthropic.com>
…on on unknown widens to {}
Behavior identical for every input class (string/number/bigint/boolean/
symbol via String, function via toString, object/null via JSON,
undefined literal).
Co-Authored-By: Claude Code <noreply@anthropic.com>
…mitter Anycast work queue vs broadcast notifier - the design rationale from the maintainer review, pinned where the next reader will ask. Co-Authored-By: Claude Code <noreply@anthropic.com>
…or shape
GET / serves the engines' minimal index page (embedded, no static file
service by design); actuator JSON responses are pretty-printed (the
engines' default SimpleMapper presentation); unknown paths and non-GET
methods answer the engines' SimpleHttpUtility error shape
{status, message, type: 'error'} with 'Resource not found'.
Co-Authored-By: Claude Code <noreply@anthropic.com>
Eric's ruling: explicit charset on json/text/html actuator responses; octet-stream (envelope wire) unchanged. Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The screenshot-driven code-quality round (the node twin of mercury-python PR #16),
plus the engine-parity loose ends, in 17 commits — suite green after every one:
Quality (12 SonarQube rules, each swept repo-wide, not just the flagged line):
readonlyon construction-only fields (Mailbox, EventBus, registry, config)Number.parseIntover the global (cli, server)??=, S6582 optional chain, S6594RegExp.exec(config + log twin)asTextexported from thecodec module (primitives via String with positive typeof narrowing — negating
typeof on
unknownwidens to{}and re-admits objects; structures via JSON);demo now validates
textas a string (non-string → teaching 400)fromMap23 andcheckServices20 → helper extractionright-to-left
lastIndexOfparse, strictly linearHandlerreturns honestunknown(the union was absorbed by it)"types": ["node"]for deterministic editor resolutionDesign record: bus.ts's header now explains why the Mailbox is hand-built rather
than EventEmitter (anycast work queue vs broadcast notifier; the handle-free lifecycle
argument) — the maintainer-review rationale, pinned where the next reader will ask.
Engine-parity host polish (signatures extracted from the Java engine):
GET /serves the engines' minimal index page (embedded, no static file service);actuator JSON is pretty-printed (SimpleMapper's default presentation); unknown paths
and non-GET methods answer
{"status": 404, "message": "Resource not found", "type": "error"}(SimpleHttpUtility signature); all json/text/html responses carry; charset=utf-8, matching the python twin. LICENSE copyright years refreshed.Why
The wrapper should read like textbook TypeScript before publication, and operations
teams should not be able to tell a Node.js function host from an engine by its HTTP
presentation — page, rendering, and error signature included.
Verification
51/51 (
tsc+node --test) after every commit, including new pins for the indexpage, error shape (GET-unknown and POST-on-known), pretty rendering, and content
types. Live demo drives for everything the compiled suite cannot see: CLI top-level
await boot, error exit codes, demo string validation, and the full content-type map —
byte-symmetric with the python twin.
Co-Authored-By: Claude Code noreply@anthropic.com
🤖 Generated with Claude Code