Repository navigation
test(characterization): fix the public surface of memory, guardrails, skills, a2a and oauth before the v4 extraction (rail 3.8.55) - #16179
Merged
Conversation
…cts before the v4 extraction Pins the memory barrel exports, sqlite backend auto-registration, store/recall (FTS on a temp DB), UPSERT semantics, token budget and current invalid-input behavior. Three current defects are pinned as characterization cases (UPSERT with a Date expiresAt throws, backend search without maxTokens throws a ZodError, SearchConfig.limit is ignored).
…nd PII/injection contracts Pins the guardrails barrel exports, the six default guardrails and their priorities, pii-masker opt-in (no mutation with the flags off, masked copy with PII_REDACTION_ENABLED), the prompt-injection fixture in block/warn modes, registry short-circuit/skip/chaining and invalid-input behavior. A malformed custom pattern currently makes the injection guard fail open; pinned as a characterization case.
…ute lifecycle Pins the exports of every skills module consumed outside src/lib/skills, the builtin handler names, registry scoping (owner vs global, version selection), loadFromDatabase, executor success/failure/history semantics and the sandbox runner contract through an injected container provider. Pins two current defects as characterization cases: two-char version constraints (>=, <=, ==) never match, and a timeout is recorded as error instead of timeout.
… state machine Pins the exports of the a2a modules consumed outside src/lib/a2a, both Agent Cards (v0.3 and v1.0) against A2A_SKILL_HANDLERS, the list-capabilities handler, executeA2ATaskWithState success/failure, task transitions and owner scoping, and the auth/owner helpers. Pins two current defects as characterization cases: the v0.3 card serves zh-CN strings, and collectMemoryHits always returns [] with the default sqlite backend.
…ed wiring Pins the oauth facade/registry/constants exports, every provider id with its flow type and aliases, the resolvePublicCred() wiring of the embedded client ids (asserted by shape and identity, never as literals), the claude PKCE auth-url and code-exchange flow, and the Kiro social/OIDC refresh flows with a scripted fetch, plus current invalid-input and upstream-failure behavior.
This was referenced Oct 10, 2026
5 tasks done
Contributor
CI Coverage Report
Coverage artifact was not available for this run. |
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.
Summary
Rail 3.8.55, Task 12 ("characterization B"). Before the v4 extraction moves
memory,guardrails,skills,a2aandoauthout of the core, the LTS needs tests that pin their public surface and observable behavior as it is today. This PR adds one characterization file per subsystem. There are no production changes.Every file has three parts:
Object.keys(await import(<barrel or externally consumed module>)).sort()compared withdeepEqualagainst a literal list. If an export is added or removed, the test fails and the diff shows exactly what moved.When current behavior looks wrong, the test is titled
characterization: <x> currently <y>. It asserts what happens today and the bug is not fixed here (see "Defects pinned" below).What changed
tests/unit/characterization-memory.test.tstests/unit/characterization-guardrails.test.tspii-maskerwith flags OFF (no mutation, same reference through the registry) / ON (masked copy), injection fixture in block/warn, registry short-circuit/skip/chain,resolveDisabledGuardrailstests/unit/characterization-skills.test.tsloadFromDatabase, execute success/failure/history, sandbox runner via an injected container provider (no Docker)tests/unit/characterization-a2a.test.tsA2A_SKILL_HANDLERS, Agent Card v0.3 + v1.0 against the handler table,list-capabilitieshandler,executeA2ATaskWithState, task transitions/owner scoping, auth/owner helperstests/unit/characterization-oauth.test.tsresolvePublicCredwiring (checked by shape and identity, never as literals, per HR #11), claude PKCE auth URL + code exchange, Kiro social/OIDC refresh with a scripted fetchDB-touching files import
tests/_setup/isolateDataDir.tsand callresetDbInstance()intest.after. The env vars that change behavior (OMNIROUTE_API_KEY,REQUIRE_API_KEY, PII/injection flags, OAuth client-id overrides) are deleted at file start so results do not depend on the shell.Defects pinned as
characterization:(not fixed; issue candidates)createMemoryUPSERT with aDateexpiresAtthrowsTypeError(the INSERT path callstoISOString(), the UPDATE path binds the raw Date).sqliteBackend.search()withoutmaxTokensthrows aZodError. It forwardsmaxTokens: undefined, which overrides the 2000 default.memoryManager.searchswallows the error and returns[].collectMemoryHitswith the default sqlite backend always returns[], so A2A memory-hit observability never fires in production.sqliteBackend.searchignoresSearchConfig.limit.resolveVersionwith>=,<=or==never matches.charAt(0)is used as the operator, so the base version parses to NaN.error, nevertimeout, even thoughSkillStatus.TIMEOUTand the DB CHECK both allow it./.well-known/agent.json) serves hardcoded zh-CN name/descriptions, introduced by the localization commit feat(i18n): complete zh-CN localization for compression engines and dashboard UI #9038. The v1.0 card is English.customPatterns): a malformed custom regex makes the prompt-injection guard fail open, even in block mode.Validation
node --import tsx/esm --import ./open-sse/utils/setupPolyfill.ts --import ./tests/_setup/isolateDataDir.ts --test --test-force-exit tests/unit/characterization-memory.test.tscharacterization-guardrails.test.tscharacterization-skills.test.tscharacterization-a2a.test.tscharacterization-oauth.test.tstests/unit/characterization-*.test.tsnpx eslint tests/unit/characterization-*.test.ts(+ lint-staged on commit)npm run typecheck:corenpm run check:test-discoverytests/unit/*.test.tsrunner)npm run check:file-sizenpm run check:public-credsThe full unit suite and the build were not run, per the campaign rules (the devbox is saturated). CI covers both.