Skip to content

refactor(buddy): move protocol + docs governance commands out of userland into core#2192

Merged
glennmichael123 merged 1 commit into
mainfrom
refactor/protocol-docs-commands-to-core
Jul 24, 2026
Merged

refactor(buddy): move protocol + docs governance commands out of userland into core#2192
glennmichael123 merged 1 commit into
mainfrom
refactor/protocol-docs-commands-to-core

Conversation

@glennmichael123

Copy link
Copy Markdown
Member

Addresses @chrisbreuer's review: the protocol-conformance + docs-freshness tooling was added under app/Commands/{protocol,docs} (userland) in #2168, but these are core framework-repo commands, not app code. This moves them where they belong.

What moved

app/Commands/{protocol,docs,run-tool.ts,Protocol.ts,Docs.ts}storage/framework/core/buddy/src/commands/ (27 files, history preserved via git mv).

  • Protocol.ts/Docs.ts → named-export core registrars (export function protocol(buddy) / docs(buddy)), matching every other built-in command.
  • 22 protocol:* / docs:* entries registered in the core lazy-command loader (lazy-commands.ts) + the commands barrel (index.ts).
  • app/Commands.ts drops the protocol/docs registrations (keeps the inspire example - that one is a userland sample).
  • The protocol suite + evidence DATA stays under .github/protocol/ (unchanged); only the tooling moved.

Fixes required by the move

  • Repo-root path depth (import.meta.dir) + cross-package imports rewritten for the deeper location.
  • CI workflow (ci.yml, desktop-lifecycle.yml) + generated-doc header paths updated.
  • 6 latent strict-null type errors the looser app/ tsconfig had hidden (regex-group / buffer-index access under noUncheckedIndexedAccess) - fixed with proper guards so the tooling passes the strict framework typecheck.

Verified

  • Framework typecheck: clean in all moved files (the only remaining errors are pre-existing local ts-cloud/stripe dep drift, which CI is green on).
  • Lint: clean. Moved tests: 48/48 pass.
  • ./buddy protocol:manifest:check and docs:* wire + run correctly end-to-end.

CI note

protocol-conformance stays red on the pre-existing #2179 governance-evidence drift (orphaned bf1245e source-manifest pin - git rev-parse on a GC'd commit), which fails on main independently of this move. Separately, I noticed docs:buddy:check bakes a machine-specific --project default path into the generated reference, so it can't match across machines - also a governance-evidence/generator issue for that same refresh, not this move.

…nd into core

The protocol-conformance and docs-freshness tooling lived under
app/Commands/{protocol,docs} (userland), but these are framework-repo core
commands, not app code. Move them into storage/framework/core/buddy/src/commands/
and register them through the core lazy-command loader + barrel, like every other
built-in command.

- git-mv the 27 tooling + test files, preserving history
- Protocol.ts/Docs.ts become named-export core registrars (protocol()/docs())
- 22 protocol:* / docs:* entries added to lazy-commands.ts; commands barrel updated
- fix repo-root path depth (import.meta.dir) + cross-package imports for the new
  location; update CI workflow + generated-doc paths
- app/Commands.ts drops the protocol/docs registrations (keeps the inspire example)
- fix 6 latent strict-null type errors the looser app/ tsconfig had hidden
  (regex-group / buffer-index access) so the tooling passes framework typecheck

Verified: framework typecheck clean in the moved files, lint clean, 48/48 moved
tests pass, buddy protocol:* / docs:* wire + run correctly.

protocol-conformance CI stays red on the pre-existing #2179 governance-evidence
drift (orphaned bf1245e pin), unrelated to this move.
@github-actions github-actions Bot added docs @stacksjs/docs storage @stacksjs/storage buddy Buddy core app labels Jul 24, 2026
@glennmichael123
glennmichael123 merged commit c2e524b into main Jul 24, 2026
8 of 13 checks passed
@glennmichael123
glennmichael123 deleted the refactor/protocol-docs-commands-to-core branch July 24, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app buddy Buddy core docs @stacksjs/docs storage @stacksjs/storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant