refactor(plugins): delete the never-provided ctx.devJobs surface (epic #470 C2a) - #555
Open
Weegy wants to merge 4 commits into
Open
refactor(plugins): delete the never-provided ctx.devJobs surface (epic #470 C2a)#555Weegy wants to merge 4 commits into
Weegy wants to merge 4 commits into
Conversation
`ctx.devJobs` was a published plugin accessor that nothing ever provided.
It resolved its host service lazily per call, so every invocation threw
"dev-platform host service unavailable". No manifest in this repo, in the
private byte5 plugin set, or in any sibling repo ever declared
`permissions.devJobs`, so no consumer has ever existed.
Per specs/470-dev-platform-plugin/dormant-capabilities.md section 2 this is
a pure deletion of an unreachable surface. No permission gate is added to
ctx.services: `provide("devJobs", ...)` exists nowhere, so both `ctx.devJobs`
and `ctx.services.get("devJobs")` already yield nothing. Removing the
accessor opens no hole. No package manifest, serviceRegistry or builder
codegen is touched, and no installed plugin changes behaviour.
Deleted:
- plugin-api: the `devJobs?` field on PluginContext and the six types
DevJobKind, DevJobStatus, DevJobDescriptor, DevJobCreateRequest,
DevJobEventRecord, DevJobsAccessor
- host pluginContext: the permissions gate, the context spread,
DevJobsHostService and createPluginDevJobsAccessor
- manifestLoader: the `permissions.devJobs` parse and its two summary fields
- admin-v1: the dev_jobs / dev_jobs_repos_hint DTO fields
- devRepoPluginGrantStore.ts and pluginDevJobsAccessor.test.ts (whole files)
The descriptor/event view types survive core-locally in
src/devplatform/devJobTypes.ts, which travels with the dev-platform tree when
it moves. DevJobKind/DevJobStatus are re-exported from src/devplatform/types.ts
rather than redefined.
devJobsHostService survives for the chat surface but sheds everything that
existed only for the plugin path: listGrantedRepoIds and the grants dep,
the plugin-shaped createJob (and with it repoStore, resolveJobPlacement and
mintRunnerToken), and cancelJob's requestedByPluginId creator check with its
finalize dep. chatDevJobService only ever called getJob, listJobs and
listJobEvents; it passed inert stubs for the rest.
Migrations 0024 (dev_repo_plugin_grants) and 0025 (source='plugin') are kept
- the migration set is forward-only - and are annotated as knowingly orphaned
so a future reader does not read the schema as evidence of a live feature.
Back-compat: a stale manifest still declaring `permissions.devJobs` installs
and activates unchanged. Unknown permission keys are ignored today; that was
implicit, and test/manifestDevJobsLegacyKey.test.ts now asserts it explicitly
so a future strict-validation change cannot break stale manifests silently.
…ervice # Conflicts: # specs/470-dev-platform-plugin/decoupling-baseline.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deletes a published plugin surface that no code has ever provided. Ratchet 3,303 → 3,220 (−83).
What was dead
ctx.devJobsresolves its host service lazily, per call — andprovide('devJobs', …)exists nowhere inmiddleware/src. So every invocation throwsdev-platform host service unavailable. Verified: zeropermissions.devJobsdeclarations in this repo, inomadia-byte5-plugins(six production private plugins), or in any sibling repo. No consumer has ever existed.Five layers were independently missing: no provider, no grant writer (
DevRepoPluginGrantStorewas never constructed, sodev_repo_plugin_grantshad no writer at all), no grant API, no consent surface, no consumer.Deleted
PluginContext.devJobs+ the sixDevJob*types from@omadia/plugin-api· thepermissions.devJobsgate,DevJobsHostServiceandcreatePluginDevJobsAccessorfromplatform/pluginContext.ts· the manifest parse and its two summary fields · thedev_jobs/dev_jobs_repos_hintadmin DTO fields ·devRepoPluginGrantStore.ts(whole file) ·pluginDevJobsAccessor.test.ts(whole file).Types moved to a local
src/devplatform/devJobTypes.ts— not a new published package — so they travel with the tree at P4.src/devplatform/types.tsalready ownedDevJobKind/DevJobStatusasas constunions backing the runtime validators, so the new file re-exports rather than redefines.DevJobCreateRequesthad no surviving consumer and was dropped outright.devJobsHostService.tssurvives and shrinks — 163 → 113 lines, deps six → one.chatDevJobServicecalls exactlygetJob,listJobs,listJobEvents; everything else was plugin-only and the chat surface was already faking it (it passedasync () => []for grants and afinalizethat unconditionally threw — which is itself the proof those paths were never live).Migrations 0024/0025 kept and annotated as knowingly orphaned. Forward-only repo.
Scope
Pure deletion. No package manifest, no
serviceRegistry.ts, no builder codegen, no permission gate added toctx.services.That is deliberate. A previous attempt bundled this with a capability gate on
services.getand was rejected: three private byte5 integration plugins callctx.services.provide()while declaringprovides: [], so they would have failed to activate outright — andchannel-teamsresolvesgraphTenantIdwith a?? 'default'fallback, so a silently-undefinedgetwould have written graph data under the wrong tenant id. Data corruption, not an outage.The gate is still needed, and it remains a real hole — but it is not a prerequisite for this deletion. Both
ctx.devJobsandctx.services.get('devJobs')already yield nothing today, so removing the accessor opens no path that was not already open. The gate becomes a prerequisite before the extracted plugin registersdevJobs(P4), and it needs a compat path for out-of-repo plugins.Backward compatibility
A manifest still declaring
permissions.devJobsinstalls and activates cleanly withctx.devJobs === undefined. Unknown manifest keys being ignored was implicit — nothing stated it — somanifestDevJobsLegacyKey.test.tsnow asserts it explicitly, in both thetrueand{ repos_hint: [...] }forms, so a future strict-validation change cannot silently start rejecting stale manifests.Test plan
5,290 pass / 0 fail;npx tsc --noEmitclean; workspace typecheck (31 packages) exit 0; build exit 0devJobOrchestratorTool.test.ts(19 tests incl. the authorization suite),chatDevJobToolWiring.test.ts,chatDevJobService.pg.test.tsserviceRegistry.ts, no codegen touched — every installed plugin resolves exactly what it resolved beforeweb-ui/app/_lib/storeTypes.tsneeded no change: itsPluginPermissionsSummarynever mirroreddev_jobs(normcp), which independently corroborates the "no consent surface" findingTwo intermittent full-suite failures were investigated rather than assumed: different tests each run, both green in isolation, and a stash-rebuild-baseline run was clean — the documented load-sensitivity, not this change.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.