Repository navigation
fix(ui): preserve exact metadata integers on save - #971
Conversation
Reuse original YAML scalar nodes for unchanged values so unrelated field edits do not round large integer identifiers through JavaScript numbers.
Resolve unchanged scalar aliases against the original document before copying their values so metadata edits retain their exact integers.
Decode original values with the YAML library's cached alias conversion and reconcile exact integers before building the output document.
Keep distinct alias and save scenarios while testing supported field edits and eliminating duplicate assertions and dependency-internal spying.
Cover the actual target migration and nested source save path while ensuring parsed form values remain JSON-serializable numbers.
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Thanks @salmonumbrella. The exact-integer restore does what the description says: nested Could you change a few things before we merge?
Optional, not blocking: keeping the parsed original |
The dashboard gave no way to tell which release of a skill was installed: the only "Version" it showed was the install commit. The resources API now returns the frontmatter's metadata.version, and the list, cards, tree details, Updates tab and detail page show it as a tag. The detail page's commit row is relabelled "Commit" so the two are not mistaken for each other. Saving a skill in the editor wrote an untouched `version: 1.10` back as `1.1`, which would change the version the dashboard shows. Unchanged decimals now keep their written form on save, extending the integer preservation from #971. Closes #975
Editing any frontmatter field in the skill/agent editor re-serialized the header from JavaScript values, so bare integers above
Number.MAX_SAFE_INTEGER(for example9007199254740993inmetadata.x-acme-event-idor asourcesentry'sx-acmekey) were silently rounded on save, even when the user changed only the description.Dirty saves now restore the exact original integers for unchanged form values before serializing the header. This covers nested metadata,
sourcesentries, values reached through aliases, and root target migration.wiki/frontend.mdgets one new paragraph.Limitation: the form, JSON view and YAML preview still show ordinary JavaScript values, so they may display large integers rounded. Editing such a field itself can save the rounded value. The Save confirmation diff shows the exact content that will be saved.
Not covered: YAML mapping keys that aren't strings. They fall outside the strict JSON manifest boundary and are out of scope here.
#969 also touches
wiki/frontend.md, but this PR adds a separate paragraph. It has no code dependency on #969 and is not stacked on it.Verification
vitest run src/lib/frontmatter.test.ts), including the real SkillEditor save wiring and the body-only path.python3 scripts/ai-context.py check) pass.make checknot run; only the focused checks above. Hosted CI: eight checks passed; two jobs (docker-sandbox-online, redteam-signal) were skipped.AI-assisted implementation and review. A human has not yet reviewed every line.
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)Checklist
make check) — for code changesLinked Issue
Refs #894
Refs #637