GeezerVison is showing github.com — fleet-hosted: parse fenced Metadata with backticks inside JSON strings · Issue #16075 · developing-today/code
fleet-hosted: parse fenced Metadata with backticks inside JSON strings #16075Labels app/fleetpkgs/fleet multicall binary + platform crateseffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/agentCreated by an agent workertask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests DescriptionProblem
The hosted create path's parseMetadataBlock uses a non-greedy regex that ends at the first triple-backtick sequence after the JSON fence opens. JSON.stringify leaves backticks inside string values unchanged, so a legitimate caller-owned title or link containing ``` can truncate the fenced block and make a valid Metadata object fail with invalid_metadata_block.
This is the hosted-worker parser in pkgs/fleet/hosted-worker/src/metadata.ts; the related aggregator parser has a separate follow-up (#16013/#16017) and does not cover this route.
Acceptance
- Fence parsing recognizes a closing delimiter line, not backticks inside JSON string contents, or otherwise safely parses the full fenced block.
- A render/parse round-trip preserves JSON string fields containing triple backticks and the create path does not misclassify the valid block as malformed.
- Missing markers, malformed JSON, and genuinely invalid delimiters still fail closed.
Evidence
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-27T10:23:47Z",
"session_id": null,
"lane": null,
"host": "amd",
"worktree": null,
"model": null,
"lane_start_issues": [],
"workspace_ref": null,
"auth_subject": "oc-code-06",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Activityadded kind/bugSomething isn't working (prefixed form of the classic bug label) task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests effort/sSmall: expected under 2 hours of work app/fleetpkgs/fleet multicall binary + platform crates on Nov 27, 2026dezren39 commented on Nov 27, 2026 agent-note: lane 0437-A-E claiming #16075 — alpha DRIVE, 2026-11-27. Premise verified firsthand: OPEN, 0 comments, no open PR referencing 16075. Implementing the smallest slice: fix parseMetadataBlock in pkgs/fleet/hosted-worker/src/metadata.ts to recognize a closing delimiter line instead of backticks inside JSON string contents, keeping fail-closed behavior for missing markers/malformed JSON; add round-trip regression test with triple backticks inside string fields. Oracle: render/parse round-trip preserves JSON string fields containing triple backticks; invalid blocks still fail closed. dezren39 commented on Nov 27, 2026 Done: PR #16097 merged (merge commit 57ce9d5, 2026-11-27T10:58:44Z); this issue auto-closed via Closes #16075. Verification: fleet-command run 45985331893 on head 9d40cc2 completed success (metadata.test.ts + stamping/backfill/ingestion suites, metadata only). parseMetadataBlock now extracts the fenced payload by delimiter line — backticks inside JSON string contents no longer participate in fence matching, and invalid delimiters/payloads still fail closed. — lane 0437-A-E
MetadataMetadataapp/fleetpkgs/fleet multicall binary + platform crateseffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/agentCreated by an agent workertask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests DevelopmentNo branches or pull requestsIssue actions
|