Skip to content

test: pin share-link salvage and agent input key resolution - #461

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-8c9c
Draft

test: pin share-link salvage and agent input key resolution#461
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-8c9c

Conversation

@cursor

@cursor cursor Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Risky behavior now covered

Recent merges were EXAMPLES / placeholders / model announcements. The untested production paths with real blast radius sit in the shipped library (vendor/njs-engine.js / play njs-engine), not the gallery copy.

Share salvage. Messenger truncation and gzip CRC flips are the common damaged-link case. check-linkerr.mjs only pins the play.html banner for garbage #a=; check-graph-persistence.mjs only pins well-formed editor round-trips. decodeShareFragment / salvageGraph — what Workflow.load uses to recover nodes + links — had no pin. A regression throws “link may be truncated” on a recoverable graph, or silently accepts #ga= (unstable editor handoff) as a share.

Agent input keys. Workflow.run resolves every --input / run({ … }) key before any paid send. Mapping a friendly name onto the wrong upload, accepting a wired port as an override, or treating a stale Choice as “missing required” either posts the wrong media/prompt (charged) or dead-ends a graph the play page would have submitted. check-app-settings.mjs never drives resolveInputKey.

Test files added/updated

  • scripts/check-share-salvage.mjs (new)
  • scripts/check-agent-inputs.mjs (new)

Pins, offline, zero API spend (real NanoodleEngine):

  • Salvage: valid #j= / #g= / #a=u stay unrecovered; trailing-junk #j= and gzip-ok/JSON-broken #g= recover nodes+links (recovered: true); a prompt containing "links": [] cannot steal the real links array; damaged #a= prefers the nested graph and drops files/name/lang; empty or untyped nodes rethrow the strict error; #ga= is refused; Workflow.load still salvages a damaged #j=.
  • Inputs: Image / Image 2 dedupe; custom name as key; nodeId.field + case-insensitive resolve on a local text run; ambiguous bare field; unknown key lists availables; wired llm prompt / ivideo setting refused before fetch; unwired inpaint keeps image+mask; empty/stale Choice defaults to the first option (not missing-required).

Why these tests materially reduce regression risk

Salvage is the only path that turns a half-delivered share into a runnable graph. Losing string-aware extract, or treating empty nodes as success, is silent data loss for everyone who pastes a long link. Input resolution is the only gate between an agent-supplied key and a charged NanoGPT body — a one-character drift in resolveInputKey / resolveSettingKey is the wrong prompt or a wired override on a paid node.

node scripts/check-share-salvage.mjs and node scripts/check-agent-inputs.mjs are green. No production behavior change.

Open in Web View Automation 

Offline checks for the library paths Workflow.load / Workflow.run use:
recover nodes+links from damaged #g=/#j=/#a= fragments, and refuse
wired/ambiguous --input keys before any paid send.

Co-authored-by: mikkel <mikkel@255bits.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
nanoodle 7934962 Commit Preview URL

Branch Preview URL
Sep 04 2026, 10:10 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant