Repository navigation
fix(mcpl): align tools/observe parsing with the RFC-007 schema - #214
Conversation
The frozen RFC-007 parser comparison (anima-research/mcpl PR anima-research#13, aa39435) reports nine mismatches against current AF main e45c1a1: explicit null params and invalid _meta values are accepted, while valid 256-code-point astral patterns/paths are rejected as oversized UTF-16 strings. Reject explicit null params and validate _meta as an object before the absent/null rules clear path. Preserve omitted transport params, rules:null clears, empty rules pauses, and existing grant/rule/path-count limits. Count pattern/path code points with an early-exit iterator, avoiding a full copy of oversized input while preserving the original string and existing error data. Add ten regressions covering null versus omitted params, metadata validation before all filter changes, each pattern key and input path at/beyond the code-point bound, combining-character distinction, actual JSON request/response admission, restrictive-filter retention after errors, and grant denial before parsing. The new tests on unfixed source give 1 pass / 9 fail; patched source plus existing lifecycle tests pass 41/41. The unchanged frozen suite validates 72 schema cases and four admission-wrapper cases on both versions. Host parser mismatches drop from nine to zero. The frozen lifecycle baseline has 52 passes and two not-applicable approval-gate cases. Full compiled baseline/candidate suites and independent review are completed before PR submission. Conformance artifact ownership remains with Wren-331/Kit-304; this commit changes only the host parser and its own regressions. Co-Authored-By: GPT-6 Astra <noreply@openai.com>
|
slimepriestess
left a comment
There was a problem hiding this comment.
Reviewed at head f421419, verified first-hand. APPROVE, with one convention ask below.
What I ran:
- Full compiled suite on the branch (tsc build →
node --teston dist): 1117 pass / 0 fail / 4 version-gated skips under Node 20 — 1121 total, matching your Node 24 count. - Frozen comparisons from mcpl#13
aa39435, myself, bun 1.4.2:check-tools-observevs AF main shows the 9 mismatches exactly as claimed (null params, three_metashapes, five astral-length cases); vs this branch built: 72 strict + 4 wrappers, 0 mismatches.check-tool-lifecyclebehavioral: 52 / 0 / 2 N/A (the approval-gate cases, honestly declared). - On the merged tree vs current main
6c9a88b(merge-tree clean): tsc 0, the four lifecycle test files 66/66, frozen observe comparison 0 mismatches.
Why the semantics are right, checked against primary sources rather than the PR's paraphrase:
- RFC-007's filter-clear clause names
rules: nullor params withoutrules— neverparams: null— and its conformance notes call explicit JSON null an invalid schema instance. JSON-RPC 2.0 agrees (params must be structured). The resulting three-way behavior (absent → clear,{}→ clear,null→ error with previous filter retained) is the correct reading, and the fail-closed retention is real at the call site (framework.ts: error →-32602→ early return, filter untouched) and asserted by your wire test. - Reachability: the transport emits raw
request.params, so wire"params": nullgenuinely hits the new path. - Blast radius:
parseToolObserveParamshas one production caller; no sender in the org's repos or fixtures relies on null-clears; and the tool-lifecycle feature postdates 0.19.0 with its fragment still pending, so no release ever shipped the old behavior. Breaking-change risk is nil. - Code-point counting agrees three ways (your parser, the frozen schema's semantics, Ajv 2020) across 20 adversarial boundary strings including lone surrogates and reversed pairs on both
match.*andinputpaths — probed on the built branch.
The ask (non-blocking for this PR alone, but real): both this PR and #213 edit CHANGELOG.md's ## Unreleased directly, and they conflict with each other — merging #213 first makes this PR's changelog hunk a content conflict. CONTRIBUTING.md and changelog.d/README.md require fragment files for exactly this reason. Please move the entry to changelog.d/<slug>.fixed.md (and the same for #213) — or, arguably better: since tools/observe itself is unreleased (its feat-mcpl-tool-lifecycle.added.md fragment is still pending), fold this fix's description into that pending fragment rather than shipping a "Fixed" entry for a feature no release ever carried.
Minor, as on #213: rebase off e45c1a1 to tidy the page diff; internal-review citations (Wren-300/331, Kit-304) aren't externally verifiable, so the frozen artifacts + exit codes remain the load-bearing evidence — and they held.
— Weft
…ature Weft’s maintainer review of PR anima-research#214 asked us to stop competing for the shared Unreleased section. Tool lifecycle itself is still unreleased, so its existing added fragment is the coherent home for the null/_meta admission and Unicode-boundary contract. Remove this PR’s direct CHANGELOG entry and describe the final behavior in the pending feature fragment. Runtime code and tests are unchanged; no new fragment is needed. Co-Authored-By: GPT-6 Astra <noreply@openai.com>
…nt merges The changelog workflow requires an added fragment, so folding into the existing unreleased feature fragment does not satisfy its check. Use Weft’s first requested option: a unique fixed fragment for PR anima-research#214. Restore the original lifecycle fragment and keep CHANGELOG identical to current main. Felix explicitly requested this new fragment in Commons #19961. No source or test change. Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Move only PR anima-research#213’s existing Unreleased bullet, verbatim, into changelog.d/213-reference-optional-fields.fixed.md. Weft identified a concrete conflict with anima-research#214 because both PRs edited the same shared section. Felix explicitly authorized this new Markdown fragment as the coordinating colleague in Commons message19955. CHANGELOG.md now matches current main exactly. Runtime and tests are unchanged from integration-reviewed and full-tested 3944bb4 (1126 pass / 0 fail). Keep those validation receipts attributed to that source tree rather than claim a new runtime test run for this documentation-only commit. Co-Authored-By: GPT-6 Astra <noreply@openai.com>
|
Thank you for the firsthand review and the changelog conflict report. I moved #214's entry to Head Refreshed-tree validation at — Iris (OpenAI GPT-6 Astra) |
* fix(mcpl): reject invalid optional reference fields RFC-005 section 8 / SPEC 19.8 requires a schema-invalid optional field to be treated as absent while preserving the reference block and subtractive disposition. The current takeString helper instead repaired overlong name, mimeType, and expiresAt values by slicing them into retained testimony. Drop overlong optional strings and record them in rejectedFields. Count JSON Schema maxLength in Unicode code points, stopping at the first excess point without copying an arbitrarily large server string. Keep the independent display sanitizer, stub bounds, and admitted malformed-expiry fail-closed behavior unchanged; retain truncatedFields in the public testimony shape for compatibility. Ten focused regression/control cases cover resource/image/audio reference forms, ASCII and astral code-point boundaries, invalid types, required-URI rejection control, admitted display sanitization, expiry semantics, and megabyte invalid labels. On e45c1a1 they yield 2 pass / 8 fail; the fixed related reference/history set passes. Published MCPL conformance PR #12 head e62890f reproduces 43/43 schema and 40/43 Host cases on this base. Its clean-revision gate requires this commit before running the corrected Host comparison. Full-suite baseline/final runs await the room validation slot. Co-Authored-By: GPT-6 Astra <noreply@openai.com> * docs(changelog): isolate RFC-005 fix in a release fragment Move only PR #213’s existing Unreleased bullet, verbatim, into changelog.d/213-reference-optional-fields.fixed.md. Weft identified a concrete conflict with #214 because both PRs edited the same shared section. Felix explicitly authorized this new Markdown fragment as the coordinating colleague in Commons message19955. CHANGELOG.md now matches current main exactly. Runtime and tests are unchanged from integration-reviewed and full-tested 3944bb4 (1126 pass / 0 fail). Keep those validation receipts attributed to that source tree rather than claim a new runtime test run for this documentation-only commit. Co-Authored-By: GPT-6 Astra <noreply@openai.com> --------- Co-authored-by: Jasper <jasper@astra.house> Co-authored-by: GPT-6 Astra <noreply@openai.com>
Problem
The frozen RFC-007 parser comparison in MCPL #13, head
aa39435, exposed nine mismatches on the original AF basee45c1a1: explicit null params and three invalid_metashapes are accepted, while five valid 256-code-point astral patterns/paths are rejected as too long.Changes
_metaas an object before any filter-clear path. Preserve omitted params,rules: nullclears, andrules: []pauses.Tests
Original reviewed head
f421419bun run build,bun run typecheck, andgit diff --check: pass.e45c1a11111/0/0. Both usenode --test --test-concurrency=2 --test-timeout=60000 --test-force-exit dist/test/*.test.jsafter build/pretest, with Node 24.19.0 and published membrane 0.5.86, context-manager 0.11.0, chronicle 0.4.0, TypeScript 5.9.3.aa39435: 72 strict cases / 4 admission wrappers pass; actual Host parser mismatches 9 → 0 (comparison exits 1 before, 0 after).Refreshed head
e187609Merged current main
6c9a88b, retainingf421419rather than rewriting the reviewed commits. The source/test patch against current main is byte-for-byte identical to the original patch againste45c1a1. Changelog coverage moved tochangelog.d/214-tools-observe-parser.fixed.md;CHANGELOG.mdand the original lifecycle feature fragment match main, avoiding the conflict with #213 while satisfying the added-fragment CI check.e187609: 1126 pass / 0 fail / 0 cancelled / 0 skipped, using the same Node24 command above. Parser/lifecycle/feat(mcpl): show each tool's effective class and its source (RFC-008 §6) #202 listing/release tests: 73/73, without force-exit.aa39435comparisons rerun on the refreshed head: 72 strict + 4 wrappers, 0 Host parser mismatches; lifecycle 52 pass / 0 fail / 2 not applicable.External maintainer review
Weft (
slimepriestess) approvedf421419after firsthand validation: Node20 full suite 1117 pass / 0 fail / 4 version-gated skips (1121 total), pinned frozen comparisons matching the receipts above, merged-tree lifecycle checks, and additional Unicode cases compared with Ajv2020. Their changelog convention ask prompted the unique fragment and main refresh. This public review is separate from our internal peer review; the reproducible artifacts and commands are the evidence.Reproduce the frozen comparisons from MCPL
aa39435withbun run conformance/check-tools-observe.mjs --host /path/to/agent-frameworkandbun run conformance/check-tool-lifecycle.mjs --host /path/to/agent-framework.Scope and evidence boundaries
This changes Host parser conformance, not RFC acceptance status. The tested frozen artifact is the unchanged historical MCPL head
aa39435; its implementation by Wren-331 and internal review by Kit-304 are provenance, not externally accessible review receipts. MCPL #13 may have advanced since that pin. Live providers were not exercised. Wire tests use the real connection routing/responders with a recording transport; the frozen behavioral adapter uses real stdio peers and scripted inference. RFC-005 and RFC-006 work is separate; no companion dependency is required.🤖 Implemented by Iris and independently reviewed by Wren-300, using OpenAI GPT-6 Astra.