Repository navigation
fix(app-shell): the pending-changes drill-in no longer lists the protection envelope as authored keys (objectui#12594) - #12599
Conversation
…velope out of its diff A new object draft listed the registry stamp `_packageId` under "Also changed:" as if the author had typed it. `computeChangeDetail` now drops the ADR-0010 envelope keys, read off the spec's `MetadataProtectionFields`, from both bodies before it compares them, so every list and the no-change mark read the same envelope-free pair. The fetched bodies keep the envelope, so the security-posture lint still reads them as served. Claude-Session: https://claude.ai/code/session_016v3WXCXoatAw13mUAHxwJB Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016v3WXCXoatAw13mUAHxwJB Co-authored-by: Claude <noreply@anthropic.com>
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
席位核对 — ACCEPT · objectui#12594 · head
|
Landing · head
|
Fixes #12594
Clause-②: no
What changed
Expanding a NEW object draft in the pending-changes sheet listed the registry stamp
_packageIdunder "Also changed:" as if the author had typed it.computeChangeDetailinpackages/app-shell/src/preview/DraftChangesPanel.tsxnow removes the ADR-0010 protection envelope from both bodies before it compares them. The keys are read from the spec'sMetadataProtectionFieldsviaObject.keys, with no local list. Every list the drill-in renders (fields added, changed and removed; keys added, changed and removed) and the no-change mark read that one envelope-free pair.The fetched bodies keep the envelope.
fetchItemBodyalso feeds the security-posture lint and the member-existence probe, and the lint's docblock says the envelope stays on its input. So the strip sits at the diff seam, not inunwrapItem. Nothing served or saved changes: no producer route, and no addition toMETADATA_READ_DECORATIONS, per the triage grade.Option chosen: (a), every envelope key left out of the diff
Measured before choosing:
MetadataProtectionFieldsis one flat shape. The split exists only inside objectstack's metadata-protocol (DERIVED_PROVENANCE_KEYSagainst the lock family) and is not exported, so no local split was invented._lock: fullis refused with 400 VALIDATION_ERROR ("the metadata API never sets, changes or removes a lock", ADR-0010 section 3.5).Four axes:
Screenshots (new object draft expanded; local HotCRM backend, package created through POST /api/v1/packages)
Before, on main (
_packageIdlisted under Also changed):After (gone;
label,name,nameField,sharingModeland the fields still list):Tests (at 16a2796)
New pin
DraftChangesPanel.protectionEnvelope-12594.test.tsx, 5 tests, green. It checks that:MetadataProtectionFieldskey, withlabeland a field still listed as controls;_unpublished, a keyAppSchemadeclares outside the envelope, still lists;computeChangeDetaildrops the envelope in both directions.The fixtures carry every key
Object.keys(MetadataProtectionFields)names.Targeted reach set, green: every DraftChangesPanel, DraftPreviewBar and CommitTimeline test, plus every test that mounts DraftChangesPanel, including the objectui#12510, objectui#12517 and objectui#8181 pins. Test Files 42 passed (42), Tests 265 passed (265).
Ablation, removing the strip: 4 of 5 red (the spec-read guard stays green as designed). Restored;
git diff HEADempty.Ablation, replacing the strip with an underscore-prefix filter: exactly the CONTROL test goes red. Restored;
git diff HEADempty.@object-ui/app-shelltype-check (the test project lists the new file), build, and eslint on the touched files all pass (0 errors; the warnings are pre-existing).check:i18n-keys,check:i18n-drift,check-changeset-presence,check-spec-symbol-derivationandcheck:new-line-citationsall exit 0.Full app-shell suite: not measured locally (the run was lost to a worker restart); CI runs it.
Acceptance notes
_unpublished, a spec-declared machine-managed key outside the envelope.Session:
https://claude.ai/code/session_016v3WXCXoatAw13mUAHxwJBGenerated by Claude Code