feat(hub-mode): re-derive hub-mode as a gsd-core capability - #1
Open
avireddy0 wants to merge 1 commit into
Open
Conversation
…e + hub v1 query + validator relaxations)
Re-derives the deferred Envision-authored hub-mode against gsd-core's
capability architecture (ADR-457 build-at-publish, ADR-959 command families).
Hybrid: a capability descriptor + additive, repo_type-gated branches in core .cts.
The standalone validator path is byte-behavior-identical (all hub branches isHub-gated).
CREATE:
- capabilities/hub-mode/capability.json — role:feature; capability-owned federated
config keys repo_type {enum standalone|spoke|hub, default standalone} +
workflow.hub_mode {boolean,false}; commands:[{family:"hub",
module:"hub-command-router.cjs",router:"routeHubCommand"}] (auto-routed by
dispatchCapabilityCommand — no gsd-tools.cjs edit). repo_type is NOT added to the
central config-schema.manifest.json (validateCrossCapability owns-exactly-once).
- src/hub-query.cts — typed, synchronous port of the deferred hub-query.cjs
(5 read-only getters + deriveState/loadPhaseBundle/readStateMilestone/
sliceCurrentMilestoneSection). PORT FIX: extractCurrentMilestone imported from
./roadmap-parser.cjs (retired ./core.cjs spine). Stamps generator_version 1.0.0.
- src/hub-command-router.cts — synchronous routeHubCommand; requires `hub v1`;
dispatches milestone current / phase / phases / manifest / spoke. All mutation:false.
- tests/{hub-query,repo-type-hub-mode}.test.cjs — ported (47 asserts, via runGsdTools).
EDIT (additive, repo_type-gated):
- src/verify.cts cmdValidateHealth — reads repo_type RAW via JSON.parse (default
standalone, fail-open) → isHub. Hub branches: W005 skip _-dirs; W006 archive-aware;
W007 scope to current-milestone {lo,hi}; W002 lookbehind/lookahead regex + archive
prefix union; W019 .planning/.gsdrootallow allowlist + hub fix text. NEW invalid
repo_type warning = W022 (W021 already used twice at :1719 and :1822).
- .gitignore + eslint.config.mjs — register the two gitignored compiled artifacts.
- gsd-core/bin/lib/capability-registry.cjs — regenerated (gen:capability-registry).
RECONCILIATIONS:
- repo-type T1/T6: the deferred spec asserted standalone STRICTLY flags 3-digit
phase dirs, but live phaseDirNameRe accepts \d{2,} by upstream contract
(tests/26-w005-... asserts 999.1-foo is valid in standalone). Restoring a strict
2-digit standalone regex regressed that upstream test, so standalone keeps the
shared regex; hub's only W005 relaxation is the _-prefix skip. T1/T6 reconciled
to the engine's real behavior (documented inline).
- W021→W022: the invalid-repo_type warning uses W022; ported W021 asserts updated.
- Assert count: 47 (21 repo-type + 26 hub-query), matching the README design intent.
Verified: npm run build (exit 0), gen-capability-registry --check (in sync,
repo_type federated + absent from central manifest), 47/47 hub asserts pass,
upstream W005/W006/validator regression tests green, lint:ci clean on all
hub files, verb + relaxation smokes green.
Claude-Session: https://claude.ai/code/session_01Jo32HyGuio7m4BDxLbBYvf
|
|
||
| function sliceCurrentMilestoneSection(roadmapContent: string, version: string | null): string | null { | ||
| if (!version) return null; | ||
| const escaped = version.replace(/\./g, '\\.'); |
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.
Summary
Re-derives the deferred Envision-authored hub-mode against gsd-core's capability architecture (ADR-457 build-at-publish, ADR-959 command families). Hub-mode is a hybrid: a capability descriptor + additive,
repo_type-gated branches in core.cts. The standalone validator path stays byte-behavior-identical — every hub branch isisHub-gated.Spec source: the deferred
gsd-hub-mode-deferred/artifacts (the only true engine patch in the retiredget-shit-done-cc@1.42.3overlay; no upstream home).What's in it
Created
capabilities/hub-mode/capability.json—role:feature; capability-owned federated config keysrepo_type {enum standalone|spoke|hub, default standalone}+workflow.hub_mode {boolean,false};commands:[{family:"hub", module:"hub-command-router.cjs", router:"routeHubCommand"}](auto-routed bydispatchCapabilityCommand— nogsd-tools.cjsedit).repo_typeis deliberately NOT in the centralconfig-schema.manifest.json(validateCrossCapabilityowns-exactly-once).src/hub-query.cts— typed, synchronous port of the deferredhub-query.cjs(5 read-only getters +deriveState/loadPhaseBundle/readStateMilestone/sliceCurrentMilestoneSection). PORT FIX:extractCurrentMilestoneimported from./roadmap-parser.cjs(retired./core.cjsspine). Stampsgenerator_version: "1.0.0".src/hub-command-router.cts— synchronousrouteHubCommand; requireshub v1; dispatchesmilestone current/phase <id>/phases [--milestone][--state]/manifest [--tier][--role]/spoke <slug>. Allmutation:false.tests/{hub-query,repo-type-hub-mode}.test.cjs— ported, 47 asserts (21 repo-type + 26 hub-query), invoked viatests/helpers.cjsrunGsdTools.Edited (additive,
repo_type-gated)src/verify.ctscmdValidateHealth— readsrepo_typeRAW viaJSON.parse(.planning/config.json)(default standalone, fail-open) →isHub. Hub branches: W005 skip_-dirs; W006 archive-aware; W007 scope to current-milestone{lo,hi}; W002 lookbehind/lookahead regex + archive-prefix union; W019.planning/.gsdrootallowallowlist + hub fix text. Archive walks are try/catch fail-open. New invalid-repo_typewarning =W022(W021 is already used twice inverify.cts)..gitignore+eslint.config.mjs— register the two gitignored compiled artifacts.gsd-core/bin/lib/capability-registry.cjs— regenerated.Reconciliations (called out for review)
phaseDirNameReaccepts\d{2,}by upstream contract (tests/26-w005-...asserts999.1-foois valid in standalone). Restoring a strict 2-digit standalone regex regressed that upstream test, so standalone keeps the shared regex; hub's only W005 relaxation is the_-prefix skip. T1/T6 reconciled to the engine's real behavior (documented inline).repo_typeusesW022; portedW021asserts updated.Verification
npm run build→ exit 0node scripts/gen-capability-registry.cjs --check→ in sync;repo_typefederated + absent from central manifestlint:ciclean on all hub fileshub v1 milestone current/phase/phases/manifest/spoke→ versioned JSON,generator_version 1.0.0;hub v2rejected) + relaxation smokes (W005/W006/W007/W019 suppressed under hub, W022 fires on bad value) greenhttps://claude.ai/code/session_01Jo32HyGuio7m4BDxLbBYvf