Repository navigation
Add Mosaic Add-on Studio: development, validation, and review environment for Mosaic Companion extensions - #22
Conversation
d26b990 to
a845c47
Compare
The same review pass checked whether the base-revision property actually holds —
that everything judging a submission runs from the base revision and never from
the pull request's own tree. It does, for every step: each `node` invocation and
every policy file comes from the `base` worktree, `adjudicate.mjs` and its
`--repo` are the same checkout so the policy-beside-itself trap is avoided, and
nothing before the gates executes anything from the submitted tree.
THE EXCEPTION IS THE WORKFLOW ITSELF. On a `pull_request` event GitHub executes
the workflow YAML from the pull request's merge commit, not from the base. The
comment in this file saying a gate "cannot be the thing that protects itself" is
true of `addon-pr.yml` too: a submission that adds `addons/x/**` and replaces
this file with a job of the same name that exits 0 produces a green check, and
stage 1 never runs because stage 1 is inside the replaced file. The exposure is
bounded — a forged check, no CI privilege, and the `.github/` change is visible
in the diff — but nothing addressed it.
`.github/CODEOWNERS` makes that require a maintainer's review, and records the
standing rule that matters more than the mechanism: an add-on submission has no
reason to touch the review machinery, the licensing terms or the publisher keys,
so one that does is refused on sight rather than read. It needs "Require review
from Code Owners" set on `main` to have effect; without that it is advisory.
Four smaller things in the workflow.
The commit counter was wrong, and in the worst direction. On a `pull_request`
event the checkout is the synthetic merge commit, so `git rev-list --count`
returned 2 for a one-commit submission and the "squash and force-push" error
fired on every pull request. `format-patch` omits merges, so stage 0 was right
all along and only the advice was wrong — which teaches contributors to distrust
a correct gate. `--no-merges`.
The add-on id was interpolated into shell steps as a `${{ }}` expression, which
is substituted into the script text before bash parses it. The id is cut out of
a path by `sed`, and git C-quotes only `"`, `\` and control bytes — so `$`, `(`,
`)`, `|`, `;` and spaces survive a path intact. Nothing exploitable could reach
those steps, because stage 3 refuses a bad id first; but that protection lives
in another file behind another gate, which is the pattern this workflow warns
about everywhere else. The id now goes through `env:`, and the identify step
refuses anything that is not `[a-z][a-z0-9-]{1,40}` before any later step sees
it.
The checkout persisted credentials into `.git/config`, and a later step runs the
submission's own build and test scripts, which can read them. Nothing here needs
them: `fetch-depth: 0` has already fetched everything and the only subsequent
remote operation is an anonymous clone of a public repository.
And the job summary is writable from those same steps, so a submission could
append its own Markdown to this job's report. It cannot alter what is already
there, so the verdict is now written before any submitted code runs and anything
appended appears below it.
Two correctness fixes beside those. The surface artifact records the commit it
was generated from, and nothing compared it to what the pinned tag resolves to —
a moved tag would judge submissions against one revision while testing them
against another; that is now checked. And the two halves of this pull request
disagreed about lockfiles: the `lockfile-present` gate failed a missing one while
this workflow carried on with a `::notice`. The gate is right, because
publication runs `npm ci` and `npm ci` fails outright without a lockfile, so the
build step now says so and stops.
`dco-matches-author` compared two sets over the whole patch, which let a
multi-commit submission pass on the strength of one correct pair. Measured on
#22, whose second commit is authored `...+BitSempre@...` and signed off
`...+BitSiempre@...` — an inserted letter, in the address and not just the
display name — and the set check saw the first commit's correct sign-off and
passed. The DCO is an assertion by the author of each commit, so it is now
checked commit by commit.
Signed-off-by: Robert Moir <130709596+zephyrnova@users.noreply.github.com>
zephyrnova
left a comment
There was a problem hiding this comment.
Thank you for this — and for a submission that passes every mechanical gate on its own merits. Zero permissions declared and none needed, licence and lockfile clean, scoped entirely to its own directory, and 4,871 lines of reviewable source. Two specific things are worth naming before anything else: capability-rules.mjs blanks comments before scanning, which is the same conclusion our own post-mortem reached after a comment explaining why an add-on deliberately did not call an API was read as a call to it; and src/host.js sets canReachUserProjects: false and says so in a comment, which is a tool stating a capability it does not have. Neither is common.
Two clerical items, and one squash fixes both.
The branch carries two commits, and a submission is one logical commit (CONTRIBUTING.md). Separately, the second commit is authored 26889439+BitSempre@users.noreply.github.com and signed off 26889439+BitSiempre@users.noreply.github.com — an inserted letter, in the address rather than only the display name — so the DCO check does not match it to its author. Correcting the trailer while squashing resolves both:
git reset --soft $(git merge-base origin/main HEAD) && git commit -s && git push --force-with-lease
Neither is a judgement about the second commit, which is a good change: it makes npm test actually run, and our own review never caught that because stage 7 was not run on this pull request.
One change request, and it is a request to delete code rather than write any.
shared/mosaic-app-reference.data.mjs carries a provenance block naming electron/addon-preload.ts, electron/addons/api/*.ts and src/components/Sidebar.tsx at v0.1.13, generated 2026-11-01. Those are the same three sources, at the same release, that this repository's own adjudicator is built from. So the Studio contains a second implementation of the gate a submission has to pass — and the two already disagree. Our renderable tab.icon set has 32 names; the Studio's has 31, missing Eth. Ours is the compiler-enforced one: the app holds the list to the sidebar's own icon map through a Record<AddonIconName, ...>, so a name missing from it fails the build. As it stands, the Studio would tell an author that a manifest the app renders perfectly well is invalid.
That is a false block produced by a mirrored list, and it is the failure mode this repository has paid for repeatedly — nine times by our own count, every one of them a defect in our checking rather than in a submission.
The app now publishes that description as an artifact precisely so nobody has to mirror it. It is at scripts/adjudicate/addon-surface.json on main, pinned to a release and carrying the commit it was generated from, and it is attached as an asset to each app release. It states the window.addonAPI namespaces and their methods, the permission each requires, the grantable and reserved vocabularies, the reserved IPC namespaces, the manifest patterns and limits, the renderable icon set and its fallback — and the app version at which each method and permission first appeared.
So the request is that the Studio read that file instead of generating its own description. The benefit is not tidiness: a builder whose rules are a hand-copy of ours is wrong every time we change something, and the only version of this that survives contact with a moving app is one where the rules come from the app. We would rather not be in a position where people building with the Studio produce manifests our gate rejects.
This does not make anything here depend on the Studio. The dependency runs the other way, and only on a file already published.
What this review did not establish.
The mechanical tiers were run; the reading tier was not. The 854-line App.jsx and the 585-line capability-rules.mjs have not been read against their own claims, and that is the layer that found every honesty defect in the previous four review rounds — a button reporting work it had not done, a badge over demo data, a status that was always green. That reading is the next pass, not a finding against this submission. Stage 7 is also outstanding: renderer/ is build output here, so the bundle a user would install has not been seen by anyone.
Four network hosts appear in the code, after our own scan was corrected to stop counting npm's lockfile URLs and SVG namespace declarations: github.com, example.com, www.apache.org and www.gnu.org. All four read as licence and documentation strings rather than endpoints, and the only live call is to 127.0.0.1. That will be confirmed in the reading pass rather than taken on trust.
Three of this round's gate failures were defects in our own checks, not in this submission, and all three are now fixed: RegExp.prototype.exec being read as process execution — which fired twice on the Studio's own manifest validator — the host list diluted from four real hosts to nine by npm's, and src/host.js reported as imported by nothing while App.jsx imports it.
…ment for Mosaic Companion extensions Adds the Mosaic Add-on Studio as an add-on under addons/mosaic-addon-studio/. - Checks add-ons against the official add-on surface (scripts/adjudicate/addon-surface.json, pinned at cf3f5f7 and vendored with provenance and an integrity check) instead of a hand-copied description of the app. The renderable icon set now matches the app's: 32 names, including Eth. - Capability scanner: reads comments, strings, templates and regex literals correctly, runs in linear time, and reports code it cannot read instead of skipping it. - One generator for starter projects and licence texts, shared by the in-Mosaic host and the validator. - Manifest rules: strict SemVer, buckets:publish requires a publishes list, input and homepage validation. - Host fixes (appVersion, validateProject contract, jail path normalisation) with regression tests. - Tests: 221 in this directory, all passing, none skipped. Tests that need the Studio development repository stay in that repository (273 there, all passing). Signed-off-by: BitSempre <26889439+BitSempre@users.noreply.github.com>
a845c47 to
ce67614
Compare
|
Thank you for the careful review. The branch is updated: 1. One logical commit. Done. The two earlier commits have been consolidated into a single commit on 2. DCO. You were right: the second previous commit had a 3. Read the published surface instead of mirroring it.
4. What the review did not establish.
5. What changed and what is still open.
Known, open, and minor issues:
This is a summary of the checks and evidence available to me, not a claim that all possible issues have been eliminated. |
Add Mosaic Add-on Studio (mosaic-addon-studio). Self-contained Studio for Mosaic Companion. MIT License. Signed-off-by BitSempre.