@bevel-software/platform-core-backend 0.35.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-guide/directory-structure.md +1 -1
- package/agent-guide/onboarding.md +111 -0
- package/agent-guide/start-here.md +1 -0
- package/agent-guide/tool-manuals.md +1 -0
- package/dist/core/catalog-cache-invalidation.d.ts +2 -2
- package/dist/core/catalog-cache-invalidation.d.ts.map +1 -1
- package/dist/core/compose-embed.d.ts +2 -2
- package/dist/core/compose-embed.d.ts.map +1 -1
- package/dist/core/compose-embed.js +1 -1
- package/dist/core/compose-embed.js.map +1 -1
- package/dist/core/core-ports.d.ts +19 -4
- package/dist/core/core-ports.d.ts.map +1 -1
- package/dist/core/core-ports.js.map +1 -1
- package/dist/core/create-core-server.d.ts.map +1 -1
- package/dist/core/create-core-server.js +26 -24
- package/dist/core/create-core-server.js.map +1 -1
- package/dist/core/create-core-services.d.ts +19 -13
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +72 -57
- package/dist/core/create-core-services.js.map +1 -1
- package/dist/core/lifecycle.d.ts +4 -4
- package/dist/core/lifecycle.d.ts.map +1 -1
- package/dist/core/lifecycle.js +5 -5
- package/dist/core/lifecycle.js.map +1 -1
- package/dist/core-config.d.ts +2 -2
- package/dist/core-config.js +3 -3
- package/dist/core-config.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/modules/access/access-control.service.js +1 -1
- package/dist/modules/access/access-control.service.js.map +1 -1
- package/dist/modules/access/access-declarations.d.ts +2 -2
- package/dist/modules/access/access-declarations.d.ts.map +1 -1
- package/dist/modules/access/access-declarations.js +2 -2
- package/dist/modules/access/access-declarations.js.map +1 -1
- package/dist/modules/access/access-mutation.service.d.ts +2 -2
- package/dist/modules/access/access-mutation.service.d.ts.map +1 -1
- package/dist/modules/access/access-mutation.service.js +2 -2
- package/dist/modules/access/access-mutation.service.js.map +1 -1
- package/dist/modules/access/access-requests.routes.d.ts +2 -2
- package/dist/modules/access/access-requests.routes.d.ts.map +1 -1
- package/dist/modules/access/access-requests.routes.js +5 -5
- package/dist/modules/access/access-requests.routes.js.map +1 -1
- package/dist/modules/access/access-requests.service.d.ts +2 -2
- package/dist/modules/access/access-requests.service.d.ts.map +1 -1
- package/dist/modules/access/access-requests.service.js +11 -11
- package/dist/modules/access/access-requests.service.js.map +1 -1
- package/dist/modules/access/access.routes.d.ts +2 -2
- package/dist/modules/access/access.routes.d.ts.map +1 -1
- package/dist/modules/access/access.routes.js +9 -9
- package/dist/modules/access/access.routes.js.map +1 -1
- package/dist/modules/access/admin-locked-commit.d.ts +5 -5
- package/dist/modules/access/admin-locked-commit.d.ts.map +1 -1
- package/dist/modules/access/admin-locked-commit.js +7 -7
- package/dist/modules/access/admin-locked-commit.js.map +1 -1
- package/dist/modules/access/admin-route-helpers.d.ts +1 -1
- package/dist/modules/access/admin-route-helpers.js +5 -5
- package/dist/modules/access/admin-route-helpers.js.map +1 -1
- package/dist/modules/access/change-read-gate.d.ts +1 -1
- package/dist/modules/access/change-read-gate.js +1 -1
- package/dist/modules/access/groups-admin.service.d.ts +7 -7
- package/dist/modules/access/groups-admin.service.d.ts.map +1 -1
- package/dist/modules/access/groups-admin.service.js +6 -6
- package/dist/modules/access/groups-admin.service.js.map +1 -1
- package/dist/modules/access/reference-scan.d.ts +1 -1
- package/dist/modules/access/roles-admin.service.d.ts +7 -7
- package/dist/modules/access/roles-admin.service.d.ts.map +1 -1
- package/dist/modules/access/roles-admin.service.js +8 -8
- package/dist/modules/access/roles-admin.service.js.map +1 -1
- package/dist/modules/access/synced-groups-committer.d.ts +4 -4
- package/dist/modules/access/synced-groups-committer.d.ts.map +1 -1
- package/dist/modules/access/synced-groups-committer.js +7 -7
- package/dist/modules/access/synced-groups-committer.js.map +1 -1
- package/dist/modules/access/user-access-removal.service.d.ts +6 -6
- package/dist/modules/access/user-access-removal.service.d.ts.map +1 -1
- package/dist/modules/access/user-access-removal.service.js +4 -4
- package/dist/modules/access/user-access-removal.service.js.map +1 -1
- package/dist/modules/access-model/access-errors.d.ts +4 -4
- package/dist/modules/access-model/access-errors.d.ts.map +1 -1
- package/dist/modules/access-model/access-errors.js +4 -4
- package/dist/modules/access-model/access-errors.js.map +1 -1
- package/dist/modules/access-model/access-grammar.d.ts +1 -1
- package/dist/modules/access-model/access-grammar.js +4 -4
- package/dist/modules/access-model/change-gate.d.ts +1 -1
- package/dist/modules/access-model/change-gate.js +1 -1
- package/dist/modules/access-model/roles-yaml-guard.d.ts +4 -4
- package/dist/modules/access-model/roles-yaml-guard.d.ts.map +1 -1
- package/dist/modules/access-model/roles-yaml-guard.js +4 -4
- package/dist/modules/access-model/roles-yaml-guard.js.map +1 -1
- package/dist/modules/agent-guide/agent-guide.d.ts +19 -14
- package/dist/modules/agent-guide/agent-guide.d.ts.map +1 -1
- package/dist/modules/agent-guide/agent-guide.js +42 -18
- package/dist/modules/agent-guide/agent-guide.js.map +1 -1
- package/dist/modules/agent-guide/guide-budget.d.ts +5 -2
- package/dist/modules/agent-guide/guide-budget.d.ts.map +1 -1
- package/dist/modules/agent-guide/guide-budget.js +6 -2
- package/dist/modules/agent-guide/guide-budget.js.map +1 -1
- package/dist/modules/agent-instructions/agent-instructions.routes.d.ts +12 -5
- package/dist/modules/agent-instructions/agent-instructions.routes.d.ts.map +1 -1
- package/dist/modules/agent-instructions/agent-instructions.routes.js +13 -6
- package/dist/modules/agent-instructions/agent-instructions.routes.js.map +1 -1
- package/dist/modules/agent-instructions/compose.d.ts +15 -8
- package/dist/modules/agent-instructions/compose.d.ts.map +1 -1
- package/dist/modules/agent-instructions/compose.js +24 -10
- package/dist/modules/agent-instructions/compose.js.map +1 -1
- package/dist/modules/agent-instructions/shared-file-rules.d.ts +14 -6
- package/dist/modules/agent-instructions/shared-file-rules.d.ts.map +1 -1
- package/dist/modules/agent-instructions/shared-file-rules.js +51 -11
- package/dist/modules/agent-instructions/shared-file-rules.js.map +1 -1
- package/dist/modules/auth/account-erasure.service.d.ts +36 -7
- package/dist/modules/auth/account-erasure.service.d.ts.map +1 -1
- package/dist/modules/auth/account-erasure.service.js +30 -10
- package/dist/modules/auth/account-erasure.service.js.map +1 -1
- package/dist/modules/auth/account-hooks.d.ts +20 -0
- package/dist/modules/auth/account-hooks.d.ts.map +1 -1
- package/dist/modules/auth/account-hooks.js +10 -0
- package/dist/modules/auth/account-hooks.js.map +1 -1
- package/dist/modules/auth/account-switch-lock.js +2 -2
- package/dist/modules/auth/account-switch-lock.js.map +1 -1
- package/dist/modules/auth/account.routes.d.ts +7 -2
- package/dist/modules/auth/account.routes.d.ts.map +1 -1
- package/dist/modules/auth/account.routes.js +23 -4
- package/dist/modules/auth/account.routes.js.map +1 -1
- package/dist/modules/auth/auth.service.d.ts +1 -1
- package/dist/modules/auth/auth.service.js +4 -4
- package/dist/modules/auth/auth.service.js.map +1 -1
- package/dist/modules/auth/index.d.ts +1 -0
- package/dist/modules/auth/index.d.ts.map +1 -1
- package/dist/modules/database/connection.d.ts.map +1 -1
- package/dist/modules/database/connection.js +11 -0
- package/dist/modules/database/connection.js.map +1 -1
- package/dist/modules/database/core-schema.js +2 -2
- package/dist/modules/database/core-schema.js.map +1 -1
- package/dist/modules/diff/diff.routes.d.ts +3 -3
- package/dist/modules/diff/diff.routes.d.ts.map +1 -1
- package/dist/modules/diff/diff.routes.js +7 -7
- package/dist/modules/diff/diff.routes.js.map +1 -1
- package/dist/modules/embed/embed.routes.js +1 -1
- package/dist/modules/embed/embed.routes.js.map +1 -1
- package/dist/modules/embed/embed.service.d.ts +4 -4
- package/dist/modules/embed/embed.service.d.ts.map +1 -1
- package/dist/modules/embed/embed.service.js +18 -18
- package/dist/modules/embed/embed.service.js.map +1 -1
- package/dist/modules/kb-fs/branch-name.js +8 -8
- package/dist/modules/kb-fs/branch-name.js.map +1 -1
- package/dist/modules/kb-fs/file-change-notifier.d.ts +51 -26
- package/dist/modules/kb-fs/file-change-notifier.d.ts.map +1 -1
- package/dist/modules/kb-fs/file-change-notifier.js +6 -8
- package/dist/modules/kb-fs/file-change-notifier.js.map +1 -1
- package/dist/modules/kb-fs/locking-filesystem.d.ts +9 -16
- package/dist/modules/kb-fs/locking-filesystem.d.ts.map +1 -1
- package/dist/modules/kb-fs/locking-filesystem.js +31 -39
- package/dist/modules/kb-fs/locking-filesystem.js.map +1 -1
- package/dist/modules/kb-fs/repo-path.js +5 -5
- package/dist/modules/kb-fs/repo-path.js.map +1 -1
- package/dist/modules/kb-fs/tmp-ref.d.ts +2 -2
- package/dist/modules/kb-fs/tmp-ref.d.ts.map +1 -1
- package/dist/modules/kb-fs/tmp-ref.js +2 -2
- package/dist/modules/kb-fs/tmp-ref.js.map +1 -1
- package/dist/modules/kb-sync/index.d.ts +1 -1
- package/dist/modules/kb-sync/index.d.ts.map +1 -1
- package/dist/modules/kb-sync/kb-sync.interface.d.ts +3 -3
- package/dist/modules/kb-sync/kb-sync.interface.d.ts.map +1 -1
- package/dist/modules/kb-sync/kb-sync.service.d.ts +3 -3
- package/dist/modules/kb-sync/kb-sync.service.d.ts.map +1 -1
- package/dist/modules/kb-sync/kb-sync.service.js +10 -10
- package/dist/modules/kb-sync/kb-sync.service.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +11 -4
- package/dist/modules/mcp/mcp.service.d.ts.map +1 -1
- package/dist/modules/mcp/mcp.service.js +75 -19
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/onboarding/onboarding.contract.d.ts +1 -1
- package/dist/modules/onboarding/onboarding.routes.js +2 -2
- package/dist/modules/onboarding/onboarding.routes.js.map +1 -1
- package/dist/modules/onboarding/starter-pack.service.d.ts +5 -7
- package/dist/modules/onboarding/starter-pack.service.d.ts.map +1 -1
- package/dist/modules/onboarding/starter-pack.service.js +4 -4
- package/dist/modules/onboarding/starter-pack.service.js.map +1 -1
- package/dist/modules/plugins/join-request-jobs.service.d.ts +2 -2
- package/dist/modules/plugins/join-request-jobs.service.d.ts.map +1 -1
- package/dist/modules/plugins/join-request-jobs.service.js +7 -7
- package/dist/modules/plugins/join-request-jobs.service.js.map +1 -1
- package/dist/modules/plugins/join-requests.service.d.ts +3 -3
- package/dist/modules/plugins/join-requests.service.d.ts.map +1 -1
- package/dist/modules/plugins/join-requests.service.js +5 -5
- package/dist/modules/plugins/join-requests.service.js.map +1 -1
- package/dist/modules/plugins/plugin-rename.service.js +1 -1
- package/dist/modules/plugins/plugin-rename.service.js.map +1 -1
- package/dist/modules/plugins/plugins.routes.d.ts +2 -2
- package/dist/modules/plugins/plugins.routes.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.routes.js +8 -8
- package/dist/modules/plugins/plugins.routes.js.map +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.d.ts +77 -2
- package/dist/modules/secrets-vault/db-secrets-vault.service.d.ts.map +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.js +479 -53
- package/dist/modules/secrets-vault/db-secrets-vault.service.js.map +1 -1
- package/dist/modules/secrets-vault/index.d.ts +2 -1
- package/dist/modules/secrets-vault/index.d.ts.map +1 -1
- package/dist/modules/secrets-vault/index.js +1 -0
- package/dist/modules/secrets-vault/index.js.map +1 -1
- package/dist/modules/secrets-vault/managed-sign-in-erasure.d.ts +36 -0
- package/dist/modules/secrets-vault/managed-sign-in-erasure.d.ts.map +1 -0
- package/dist/modules/secrets-vault/managed-sign-in-erasure.js +37 -0
- package/dist/modules/secrets-vault/managed-sign-in-erasure.js.map +1 -0
- package/dist/modules/secrets-vault/secrets-vault.contract.d.ts +152 -0
- package/dist/modules/secrets-vault/secrets-vault.contract.d.ts.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.contract.js.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts +7 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.js +125 -10
- package/dist/modules/secrets-vault/secrets-vault.routes.js.map +1 -1
- package/dist/modules/settings/connection-check.js +1 -1
- package/dist/modules/settings/connection-check.js.map +1 -1
- package/dist/modules/settings/deployment-settings.service.js +1 -1
- package/dist/modules/settings/git-root-folders.js +1 -1
- package/dist/modules/settings/git-root-folders.js.map +1 -1
- package/dist/modules/settings/setup.routes.d.ts +1 -1
- package/dist/modules/settings/setup.routes.js +1 -1
- package/dist/modules/skills/pending-skills.service.d.ts +3 -3
- package/dist/modules/skills/pending-skills.service.d.ts.map +1 -1
- package/dist/modules/skills/pending-skills.service.js +4 -4
- package/dist/modules/skills/pending-skills.service.js.map +1 -1
- package/dist/modules/skills/skill-access-requests.routes.d.ts +2 -2
- package/dist/modules/skills/skill-access-requests.routes.d.ts.map +1 -1
- package/dist/modules/skills/skill-access-requests.routes.js +5 -5
- package/dist/modules/skills/skill-access-requests.routes.js.map +1 -1
- package/dist/modules/tool-helpers/tool-context.d.ts +4 -4
- package/dist/modules/tool-helpers/tool-context.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-context.js +2 -2
- package/dist/modules/tool-helpers/tool-context.js.map +1 -1
- package/dist/modules/tool-helpers/tool-handler.js +2 -2
- package/dist/modules/tool-helpers/tool-handler.js.map +1 -1
- package/dist/modules/tool-helpers/tool.contract.d.ts +4 -4
- package/dist/modules/tool-helpers/tool.contract.d.ts.map +1 -1
- package/dist/modules/tool-manuals/mcp-server-edit.service.js +1 -1
- package/dist/modules/tool-manuals/mcp-server-edit.service.js.map +1 -1
- package/dist/modules/tool-manuals/pending-tools.service.d.ts +3 -3
- package/dist/modules/tool-manuals/pending-tools.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/pending-tools.service.js +4 -4
- package/dist/modules/tool-manuals/pending-tools.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-delete.service.js +1 -1
- package/dist/modules/tool-manuals/tool-delete.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.contract.d.ts +43 -3
- package/dist/modules/tool-manuals/tool-manuals.contract.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts +6 -0
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.js +51 -5
- package/dist/modules/tool-manuals/tool-manuals.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts +3 -0
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.js +36 -15
- package/dist/modules/tool-manuals/tool-manuals.tools.js.map +1 -1
- package/dist/modules/version-control/agent-tools/change-request-read-shape.d.ts.map +1 -0
- package/dist/modules/version-control/agent-tools/change-request-read-shape.js.map +1 -0
- package/dist/modules/version-control/agent-tools/change-request-read.tools.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/agent-tools/change-request-read.tools.js +2 -2
- package/dist/modules/version-control/agent-tools/change-request-read.tools.js.map +1 -0
- package/dist/modules/version-control/agent-tools/change-request-summary.d.ts.map +1 -0
- package/dist/modules/version-control/agent-tools/change-request-summary.js.map +1 -0
- package/dist/modules/{workflow/agent-tools/workflow.tools.d.ts → version-control/agent-tools/version-control.tools.d.ts} +4 -4
- package/dist/modules/version-control/agent-tools/version-control.tools.d.ts.map +1 -0
- package/dist/modules/{workflow/agent-tools/workflow.tools.js → version-control/agent-tools/version-control.tools.js} +31 -31
- package/dist/modules/version-control/agent-tools/version-control.tools.js.map +1 -0
- package/dist/modules/{workflow → version-control}/change-request-hooks.d.ts +1 -1
- package/dist/modules/version-control/change-request-hooks.d.ts.map +1 -0
- package/dist/modules/version-control/change-request-hooks.js.map +1 -0
- package/dist/modules/version-control/change-request-review/approval-lock.d.ts.map +1 -0
- package/dist/modules/version-control/change-request-review/approval-lock.js.map +1 -0
- package/dist/modules/{workflow/review-workflow/review-workflow.interface.d.ts → version-control/change-request-review/change-request-review.interface.d.ts} +2 -2
- package/dist/modules/version-control/change-request-review/change-request-review.interface.d.ts.map +1 -0
- package/dist/modules/version-control/change-request-review/change-request-review.interface.js +2 -0
- package/dist/modules/version-control/change-request-review/change-request-review.interface.js.map +1 -0
- package/dist/modules/{workflow/review-workflow/review-workflow.service.d.ts → version-control/change-request-review/change-request-review.service.d.ts} +3 -3
- package/dist/modules/version-control/change-request-review/change-request-review.service.d.ts.map +1 -0
- package/dist/modules/{workflow/review-workflow/review-workflow.service.js → version-control/change-request-review/change-request-review.service.js} +26 -26
- package/dist/modules/version-control/change-request-review/change-request-review.service.js.map +1 -0
- package/dist/modules/{workflow → version-control}/event-bus.d.ts +8 -8
- package/dist/modules/version-control/event-bus.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/event-bus.js +4 -4
- package/dist/modules/version-control/event-bus.js.map +1 -0
- package/dist/modules/{workflow → version-control}/events-delivery.d.ts +4 -4
- package/dist/modules/version-control/events-delivery.d.ts.map +1 -0
- package/dist/modules/version-control/events-delivery.js.map +1 -0
- package/dist/modules/{workflow → version-control}/events.routes.d.ts +4 -4
- package/dist/modules/version-control/events.routes.d.ts.map +1 -0
- package/dist/modules/version-control/events.routes.js.map +1 -0
- package/dist/modules/{workflow → version-control}/file-lock.service.d.ts +2 -2
- package/dist/modules/version-control/file-lock.service.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/file-lock.service.js +6 -6
- package/dist/modules/version-control/file-lock.service.js.map +1 -0
- package/dist/modules/version-control/git/change-request-link.d.ts.map +1 -0
- package/dist/modules/version-control/git/change-request-link.js.map +1 -0
- package/dist/modules/version-control/git/git-version.d.ts.map +1 -0
- package/dist/modules/version-control/git/git-version.js.map +1 -0
- package/dist/modules/{workflow → version-control}/git/git.service.d.ts +26 -8
- package/dist/modules/version-control/git/git.service.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/git/git.service.js +106 -55
- package/dist/modules/version-control/git/git.service.js.map +1 -0
- package/dist/modules/version-control/git/merge-commit.d.ts.map +1 -0
- package/dist/modules/version-control/git/merge-commit.js.map +1 -0
- package/dist/modules/version-control/git/node-git-runner.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/git/node-git-runner.js +1 -1
- package/dist/modules/version-control/git/node-git-runner.js.map +1 -0
- package/dist/modules/{workflow → version-control}/git/pull-request.service.d.ts +5 -5
- package/dist/modules/version-control/git/pull-request.service.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/git/pull-request.service.js +10 -10
- package/dist/modules/version-control/git/pull-request.service.js.map +1 -0
- package/dist/modules/{workflow → version-control}/index.d.ts +6 -5
- package/dist/modules/version-control/index.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/index.js +3 -2
- package/dist/modules/version-control/index.js.map +1 -0
- package/dist/modules/{workflow → version-control}/pending-commits.service.d.ts +2 -2
- package/dist/modules/version-control/pending-commits.service.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/pending-commits.service.js +2 -2
- package/dist/modules/version-control/pending-commits.service.js.map +1 -0
- package/dist/modules/{workflow → version-control}/pending-commits.worker.d.ts +5 -5
- package/dist/modules/version-control/pending-commits.worker.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/pending-commits.worker.js +3 -3
- package/dist/modules/version-control/pending-commits.worker.js.map +1 -0
- package/dist/modules/{workflow → version-control}/read-on-branch.d.ts +2 -2
- package/dist/modules/version-control/read-on-branch.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/read-on-branch.js +2 -2
- package/dist/modules/version-control/read-on-branch.js.map +1 -0
- package/dist/modules/version-control/recovery-bot.d.ts.map +1 -0
- package/dist/modules/version-control/recovery-bot.js.map +1 -0
- package/dist/modules/version-control/sanitize-error.d.ts.map +1 -0
- package/dist/modules/version-control/sanitize-error.js.map +1 -0
- package/dist/modules/{workflow/workflow-hooks.d.ts → version-control/version-control-hooks.d.ts} +33 -6
- package/dist/modules/version-control/version-control-hooks.d.ts.map +1 -0
- package/dist/modules/{workflow/workflow-hooks.js → version-control/version-control-hooks.js} +20 -3
- package/dist/modules/version-control/version-control-hooks.js.map +1 -0
- package/dist/modules/{workflow/workflow.routes.d.ts → version-control/version-control.routes.d.ts} +6 -5
- package/dist/modules/version-control/version-control.routes.d.ts.map +1 -0
- package/dist/modules/{workflow/workflow.routes.js → version-control/version-control.routes.js} +61 -60
- package/dist/modules/version-control/version-control.routes.js.map +1 -0
- package/dist/modules/{workflow/workflow.service.d.ts → version-control/version-control.service.d.ts} +26 -46
- package/dist/modules/version-control/version-control.service.d.ts.map +1 -0
- package/dist/modules/{workflow/workflow.service.js → version-control/version-control.service.js} +93 -107
- package/dist/modules/version-control/version-control.service.js.map +1 -0
- package/dist/modules/workspace/agent-access.gate.d.ts +5 -5
- package/dist/modules/workspace/agent-access.gate.d.ts.map +1 -1
- package/dist/modules/workspace/agent-access.gate.js +1 -1
- package/dist/modules/workspace/git-internals.middleware.d.ts +1 -1
- package/dist/modules/workspace/git-internals.middleware.js +2 -2
- package/dist/modules/workspace/kb-repository.js +1 -1
- package/dist/modules/workspace/kb-repository.js.map +1 -1
- package/dist/modules/workspace/startup/kb-git.d.ts +1 -1
- package/dist/modules/workspace/startup/kb-git.d.ts.map +1 -1
- package/dist/modules/workspace/startup/kb-git.js +1 -1
- package/dist/modules/workspace/startup/kb-git.js.map +1 -1
- package/dist/modules/workspace/startup/steps/seed-tree.d.ts +2 -2
- package/dist/modules/workspace/startup/steps/seed-tree.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/seed-tree.js +1 -1
- package/dist/modules/workspace/startup/steps/seed-tree.js.map +1 -1
- package/dist/modules/workspace/startup/steps/template-files.step.d.ts +2 -2
- package/dist/modules/workspace/startup/steps/template-files.step.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/template-files.step.js +2 -2
- package/dist/modules/workspace/startup/steps/template-files.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/template-source.d.ts +17 -4
- package/dist/modules/workspace/startup/steps/template-source.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/template-source.js +8 -5
- package/dist/modules/workspace/startup/steps/template-source.js.map +1 -1
- package/dist/modules/workspace/workspace-tmp.js +3 -3
- package/dist/modules/workspace/workspace-tmp.js.map +1 -1
- package/dist/modules/workspace/workspace.routes.d.ts +4 -4
- package/dist/modules/workspace/workspace.routes.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.routes.js +22 -22
- package/dist/modules/workspace/workspace.routes.js.map +1 -1
- package/dist/modules/workspace/workspace.service.d.ts +6 -6
- package/dist/modules/workspace/workspace.service.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.service.js +11 -11
- package/dist/modules/workspace/workspace.service.js.map +1 -1
- package/dist/modules/workspace/workspace.tools.d.ts +2 -1
- package/dist/modules/workspace/workspace.tools.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.tools.js +15 -10
- package/dist/modules/workspace/workspace.tools.js.map +1 -1
- package/dist/shared/canonical-file-identity.d.ts +2 -2
- package/dist/shared/canonical-file-identity.js +5 -5
- package/dist/shared/canonical-file-identity.js.map +1 -1
- package/dist/shared/domain-errors.d.ts +39 -39
- package/dist/shared/domain-errors.d.ts.map +1 -1
- package/dist/shared/domain-errors.js +44 -44
- package/dist/shared/domain-errors.js.map +1 -1
- package/dist/shared/fire-and-forget.d.ts +14 -0
- package/dist/shared/fire-and-forget.d.ts.map +1 -0
- package/dist/shared/fire-and-forget.js +23 -0
- package/dist/shared/fire-and-forget.js.map +1 -0
- package/dist/shared/git.contract.d.ts +1 -1
- package/dist/shared/git.contract.js +1 -1
- package/dist/shared/http-errors.d.ts +3 -3
- package/dist/shared/http-errors.d.ts.map +1 -1
- package/dist/shared/http-errors.js +1 -1
- package/dist/shared/http-errors.js.map +1 -1
- package/dist/shared/pending-proposals.d.ts +3 -3
- package/dist/shared/pending-proposals.d.ts.map +1 -1
- package/dist/shared/pending-proposals.js +2 -2
- package/dist/shared/pending-proposals.js.map +1 -1
- package/dist/tenancy/static-tenant-source.js +1 -1
- package/dist/tenancy/static-tenant-source.js.map +1 -1
- package/migrations/0012_agent_audit.sql +40 -40
- package/migrations/0013_agent_identity_and_key_soft_delete.sql +29 -29
- package/migrations/meta/0012_snapshot.json +2246 -2246
- package/migrations/meta/0013_snapshot.json +2258 -2258
- package/package.json +4 -4
- package/src/__tests__/account-admin.ts +27 -0
- package/src/__tests__/capturing-logger.ts +36 -0
- package/src/__tests__/hexis-catalog.ts +4 -4
- package/src/__tests__/kb-context.ts +30 -30
- package/src/__tests__/kb-layout-config.test.ts +21 -0
- package/src/__tests__/open-change-gate.ts +1 -1
- package/src/__tests__/real-access.ts +16 -0
- package/src/__tests__/real-auth.ts +13 -0
- package/src/__tests__/real-readers.ts +27 -0
- package/src/__tests__/real-version-control.ts +22 -0
- package/src/__tests__/tool-handler.ts +15 -0
- package/src/__tests__/tool-wiring.ts +10 -4
- package/src/__tests__/workspace-service.ts +1 -1
- package/src/core/__tests__/catalog-cache-invalidation.test.ts +3 -3
- package/src/core/__tests__/commit-announcements-wired-once.test.ts +53 -0
- package/src/core/__tests__/compose-embed.test.ts +1 -1
- package/src/core/__tests__/damaged-document.tools.test.ts +3 -3
- package/src/core/__tests__/erasure-slices-wired-once.test.ts +46 -0
- package/src/core/__tests__/gated-boot.test.ts +2 -2
- package/src/core/__tests__/lifecycle.test.ts +9 -9
- package/src/core/catalog-cache-invalidation.ts +2 -2
- package/src/core/compose-embed.ts +3 -3
- package/src/core/core-ports.ts +19 -4
- package/src/core/create-core-server.ts +39 -25
- package/src/core/create-core-services.ts +83 -65
- package/src/core/lifecycle.ts +9 -9
- package/src/core-config.ts +3 -3
- package/src/index.ts +5 -5
- package/src/modules/access/__tests__/access-control.admin-root-floor.test.ts +4 -4
- package/src/modules/access/__tests__/access-own-read-grant.test.ts +14 -14
- package/src/modules/access/__tests__/access-requests.routes.test.ts +23 -23
- package/src/modules/access/__tests__/access.routes.admins.test.ts +4 -4
- package/src/modules/access/__tests__/access.routes.batch.test.ts +4 -4
- package/src/modules/access/__tests__/access.routes.folder-governs.test.ts +6 -6
- package/src/modules/access/__tests__/access.routes.group-grant.test.ts +6 -6
- package/src/modules/access/__tests__/access.routes.overrides.test.ts +5 -5
- package/src/modules/access/__tests__/access.routes.proposal-branch.test.ts +6 -6
- package/src/modules/access/__tests__/access.routes.prospective.test.ts +3 -3
- package/src/modules/access/__tests__/access.routes.revoke.test.ts +6 -6
- package/src/modules/access/__tests__/access.routes.unknown-email.test.ts +6 -6
- package/src/modules/access/__tests__/admin-locked-commit.test.ts +6 -6
- package/src/modules/access/__tests__/admin-route-helpers.test.ts +5 -5
- package/src/modules/access/__tests__/groups-admin.service.test.ts +44 -44
- package/src/modules/access/__tests__/roles-admin.security.test.ts +14 -13
- package/src/modules/access/__tests__/roles-admin.service.test.ts +34 -34
- package/src/modules/access/__tests__/roles-capabilities.test.ts +29 -29
- package/src/modules/access/__tests__/roles.routes.test.ts +11 -11
- package/src/modules/access/__tests__/synced-groups-committer.test.ts +14 -14
- package/src/modules/access/__tests__/user-access-removal.service.test.ts +33 -33
- package/src/modules/access/access-control.service.ts +1 -1
- package/src/modules/access/access-declarations.ts +2 -2
- package/src/modules/access/access-mutation.service.ts +2 -2
- package/src/modules/access/access-requests.routes.ts +7 -7
- package/src/modules/access/access-requests.service.ts +13 -13
- package/src/modules/access/access.routes.ts +11 -11
- package/src/modules/access/admin-locked-commit.ts +11 -11
- package/src/modules/access/admin-route-helpers.ts +5 -5
- package/src/modules/access/change-read-gate.ts +1 -1
- package/src/modules/access/groups-admin.service.ts +7 -7
- package/src/modules/access/reference-scan.ts +1 -1
- package/src/modules/access/roles-admin.service.ts +9 -9
- package/src/modules/access/synced-groups-committer.ts +11 -11
- package/src/modules/access/user-access-removal.service.ts +7 -7
- package/src/modules/access-model/__tests__/access-grammar.test.ts +2 -2
- package/src/modules/access-model/access-errors.ts +4 -4
- package/src/modules/access-model/access-grammar.ts +4 -4
- package/src/modules/access-model/change-gate.ts +1 -1
- package/src/modules/access-model/roles-yaml-guard.ts +4 -4
- package/src/modules/agent-guide/__tests__/agent-guide.test.ts +19 -4
- package/src/modules/agent-guide/__tests__/agent-guide.tools.test.ts +1 -1
- package/src/modules/agent-guide/__tests__/guide-matches-code.test.ts +2 -2
- package/src/modules/agent-guide/agent-guide.ts +48 -22
- package/src/modules/agent-guide/guide-budget.ts +6 -2
- package/src/modules/agent-instructions/__tests__/agent-instructions.route.test.ts +4 -5
- package/src/modules/agent-instructions/__tests__/compose.test.ts +1 -1
- package/src/modules/agent-instructions/__tests__/shared-file-rules.test.ts +113 -7
- package/src/modules/agent-instructions/agent-instructions.routes.ts +12 -5
- package/src/modules/agent-instructions/compose.ts +24 -9
- package/src/modules/agent-instructions/shared-file-rules.ts +53 -11
- package/src/modules/agent-scope/__tests__/agent-surfaces.connect-as.test.ts +1 -1
- package/src/modules/audit/__tests__/agent-rest-audit.middleware.test.ts +113 -113
- package/src/modules/audit/__tests__/event-classifier.test.ts +121 -121
- package/src/modules/audit/event-classifier.ts +155 -155
- package/src/modules/auth/__tests__/account-deactivation.test.ts +1 -1
- package/src/modules/auth/__tests__/account-erasure.approval-gate.test.ts +4 -4
- package/src/modules/auth/__tests__/account-erasure.participants.test.ts +56 -0
- package/src/modules/auth/__tests__/account-switch-lock.pg.test.ts +2 -2
- package/src/modules/auth/__tests__/account-switch-lock.test.ts +2 -2
- package/src/modules/auth/__tests__/account.routes.test.ts +73 -11
- package/src/modules/auth/__tests__/auth.service.test.ts +1 -1
- package/src/modules/auth/account-erasure.service.ts +27 -9
- package/src/modules/auth/account-hooks.ts +34 -0
- package/src/modules/auth/account-switch-lock.ts +2 -2
- package/src/modules/auth/account.routes.ts +23 -5
- package/src/modules/auth/auth.service.ts +4 -4
- package/src/modules/auth/index.ts +1 -0
- package/src/modules/database/__tests__/advisory-lock.test.ts +169 -169
- package/src/modules/database/__tests__/connection.pg.test.ts +55 -0
- package/src/modules/database/__tests__/connection.test.ts +30 -0
- package/src/modules/database/__tests__/migrations-unqualified.test.ts +32 -32
- package/src/modules/database/connection.ts +12 -0
- package/src/modules/database/core-schema.ts +2 -2
- package/src/modules/diff/__tests__/diff.routes.read-gate.test.ts +2 -2
- package/src/modules/diff/__tests__/diff.routes.rejectPathsLocked.test.ts +12 -12
- package/src/modules/diff/diff.routes.ts +8 -8
- package/src/modules/embed/__tests__/embed.service.lock.test.ts +7 -7
- package/src/modules/embed/__tests__/embed.service.test.ts +48 -62
- package/src/modules/embed/__tests__/embed.tools.test.ts +1 -1
- package/src/modules/embed/embed.routes.ts +1 -1
- package/src/modules/embed/embed.service.ts +17 -17
- package/src/modules/kb-fs/__tests__/branch-name.test.ts +2 -2
- package/src/modules/kb-fs/__tests__/file-change-notifier.test.ts +23 -4
- package/src/modules/kb-fs/__tests__/locking-filesystem.test.ts +264 -305
- package/src/modules/kb-fs/__tests__/move-with-edits.test.ts +103 -40
- package/src/modules/kb-fs/__tests__/repo-path.test.ts +8 -8
- package/src/modules/kb-fs/branch-name.ts +8 -8
- package/src/modules/kb-fs/file-change-notifier.ts +55 -32
- package/src/modules/kb-fs/locking-filesystem.ts +34 -48
- package/src/modules/kb-fs/repo-path.ts +5 -5
- package/src/modules/kb-fs/tmp-ref.ts +3 -3
- package/src/modules/kb-sync/__tests__/kb-sync.service.test.ts +36 -36
- package/src/modules/kb-sync/index.ts +1 -1
- package/src/modules/kb-sync/kb-sync.interface.ts +3 -3
- package/src/modules/kb-sync/kb-sync.service.ts +9 -9
- package/src/modules/marketplace/__tests__/github-facade.test.ts +1 -1
- package/src/modules/marketplace/__tests__/marketplace-git.test.ts +1 -1
- package/src/modules/mcp/__tests__/mcp-proxy-helpers.test.ts +4 -2
- package/src/modules/mcp/__tests__/mcp.e2e.test.ts +69 -8
- package/src/modules/mcp/__tests__/mcp.service.test.ts +91 -13
- package/src/modules/mcp/__tests__/read-only-hint.pg.test.ts +194 -0
- package/src/modules/mcp/mcp.service.ts +89 -28
- package/src/modules/onboarding/__tests__/starter-pack.service.test.ts +59 -59
- package/src/modules/onboarding/onboarding.contract.ts +1 -1
- package/src/modules/onboarding/onboarding.routes.ts +2 -2
- package/src/modules/onboarding/starter-pack.service.ts +7 -9
- package/src/modules/plugins/__tests__/bundle-dialect.e2e.test.ts +1 -1
- package/src/modules/plugins/__tests__/compile-marketplace.test.ts +1 -1
- package/src/modules/plugins/__tests__/join-request-jobs.service.test.ts +43 -43
- package/src/modules/plugins/__tests__/join-requests.service.test.ts +19 -19
- package/src/modules/plugins/__tests__/join-requests.settlement.test.ts +26 -26
- package/src/modules/plugins/__tests__/plugin-rename.service.test.ts +46 -21
- package/src/modules/plugins/__tests__/plugins.routes.test.ts +31 -31
- package/src/modules/plugins/join-request-jobs.service.ts +10 -10
- package/src/modules/plugins/join-requests.service.ts +4 -4
- package/src/modules/plugins/plugin-rename.service.ts +1 -1
- package/src/modules/plugins/plugins.routes.ts +9 -9
- package/src/modules/secrets-vault/__tests__/db-secrets-vault.managed.test.ts +773 -0
- package/src/modules/secrets-vault/__tests__/db-secrets-vault.oauth.test.ts +28 -1
- package/src/modules/secrets-vault/__tests__/managed-sign-in.route.test.ts +351 -0
- package/src/modules/secrets-vault/db-secrets-vault.service.ts +562 -95
- package/src/modules/secrets-vault/index.ts +7 -0
- package/src/modules/secrets-vault/managed-sign-in-erasure.ts +41 -0
- package/src/modules/secrets-vault/secrets-variable-loader.ts +134 -134
- package/src/modules/secrets-vault/secrets-vault.contract.ts +152 -0
- package/src/modules/secrets-vault/secrets-vault.routes.ts +157 -10
- package/src/modules/settings/__tests__/repository-source.test.ts +1 -1
- package/src/modules/settings/__tests__/setup.routes.layout-phase.test.ts +1 -1
- package/src/modules/settings/__tests__/setup.routes.managed-phase.test.ts +1 -1
- package/src/modules/settings/connection-check.ts +1 -1
- package/src/modules/settings/deployment-settings.service.ts +1 -1
- package/src/modules/settings/git-root-folders.ts +1 -1
- package/src/modules/settings/setup.routes.ts +1 -1
- package/src/modules/skills/__tests__/allowed-tools-warn.tools.test.ts +3 -3
- package/src/modules/skills/__tests__/branch-skills.tools.test.ts +1 -1
- package/src/modules/skills/__tests__/pending-skills.service.test.ts +8 -8
- package/src/modules/skills/__tests__/skill-access-requests.routes.test.ts +18 -18
- package/src/modules/skills/__tests__/skills.service.test.ts +3 -3
- package/src/modules/skills/pending-skills.service.ts +3 -3
- package/src/modules/skills/skill-access-requests.routes.ts +7 -7
- package/src/modules/tool-helpers/__tests__/agent-roles-write.test.ts +4 -4
- package/src/modules/tool-helpers/__tests__/branch-declaration.test.ts +3 -3
- package/src/modules/tool-helpers/__tests__/can-write.tools.test.ts +3 -3
- package/src/modules/tool-helpers/__tests__/phase4-tools.test.ts +4 -4
- package/src/modules/tool-helpers/__tests__/tools-surface.test.ts +3 -3
- package/src/modules/tool-helpers/__tests__/validate-token.test.ts +1 -1
- package/src/modules/tool-helpers/tool-context.ts +6 -6
- package/src/modules/tool-helpers/tool-handler.ts +2 -2
- package/src/modules/tool-helpers/tool.contract.ts +4 -4
- package/src/modules/tool-manuals/__tests__/pending-tools.service.test.ts +9 -9
- package/src/modules/tool-manuals/__tests__/tool-manuals.managed-sign-in.test.ts +89 -0
- package/src/modules/tool-manuals/__tests__/tool-manuals.restart.test.ts +1 -1
- package/src/modules/tool-manuals/__tests__/tool-manuals.tools.test.ts +36 -1
- package/src/modules/tool-manuals/mcp-server-edit.service.ts +1 -1
- package/src/modules/tool-manuals/pending-tools.service.ts +3 -3
- package/src/modules/tool-manuals/tool-delete.service.ts +1 -1
- package/src/modules/tool-manuals/tool-manuals.contract.ts +41 -3
- package/src/modules/tool-manuals/tool-manuals.service.ts +53 -5
- package/src/modules/tool-manuals/tool-manuals.tools.ts +41 -15
- package/src/modules/tool-registry/__tests__/own-tool-schemas.test.ts +4 -4
- package/src/modules/tool-registry/__tests__/read-only-hints.test.ts +3 -3
- package/src/modules/tool-registry/__tests__/tool-description-length.test.ts +6 -6
- package/src/modules/{workflow → version-control}/__tests__/apply-failure.test.ts +54 -54
- package/src/modules/{workflow → version-control}/__tests__/event-bus.test.ts +27 -27
- package/src/modules/{workflow → version-control}/__tests__/events-delivery.test.ts +37 -37
- package/src/modules/{workflow → version-control}/__tests__/file-lock.service.deletion-gate.test.ts +2 -2
- package/src/modules/{workflow → version-control}/__tests__/file-lock.service.path-identity.test.ts +8 -8
- package/src/modules/{workflow → version-control}/__tests__/merge-announces-tree.test.ts +11 -11
- package/src/modules/{workflow → version-control}/__tests__/pending-commits.worker.concurrency.test.ts +9 -9
- package/src/modules/{workflow → version-control}/__tests__/pending-commits.worker.test.ts +25 -25
- package/src/modules/{workflow → version-control}/__tests__/preserve-roles-yaml.test.ts +42 -42
- package/src/modules/version-control/__tests__/public-surface.test.ts +114 -0
- package/src/modules/{workflow/__tests__/workflow.routes.folder-proposals.test.ts → version-control/__tests__/version-control.routes.folder-proposals.test.ts} +18 -18
- package/src/modules/{workflow/__tests__/workflow.routes.fork-point-file.test.ts → version-control/__tests__/version-control.routes.fork-point-file.test.ts} +19 -19
- package/src/modules/{workflow/__tests__/workflow.routes.history-read-gate.test.ts → version-control/__tests__/version-control.routes.history-read-gate.test.ts} +13 -13
- package/src/modules/{workflow/__tests__/workflow.routes.lock-path.test.ts → version-control/__tests__/version-control.routes.lock-path.test.ts} +18 -18
- package/src/modules/{workflow/__tests__/workflow.routes.open-change-request.test.ts → version-control/__tests__/version-control.routes.open-change-request.test.ts} +7 -7
- package/src/modules/{workflow/__tests__/workflow.routes.push-refused.test.ts → version-control/__tests__/version-control.routes.push-refused.test.ts} +14 -14
- package/src/modules/{workflow/__tests__/workflow.service.branch-in-use.test.ts → version-control/__tests__/version-control.service.branch-in-use.test.ts} +6 -6
- package/src/modules/{workflow/__tests__/workflow.service.commitFileWhileLocked.test.ts → version-control/__tests__/version-control.service.commitFileWhileLocked.test.ts} +14 -14
- package/src/modules/{workflow/__tests__/workflow.service.delete-branch.test.ts → version-control/__tests__/version-control.service.delete-branch.test.ts} +14 -14
- package/src/modules/{workflow/__tests__/workflow.service.deleted-branch-sweep.test.ts → version-control/__tests__/version-control.service.deleted-branch-sweep.test.ts} +4 -4
- package/src/modules/{workflow/__tests__/workflow.service.facade.test.ts → version-control/__tests__/version-control.service.facade.test.ts} +100 -102
- package/src/modules/{workflow/__tests__/workflow.service.folder-proposals.test.ts → version-control/__tests__/version-control.service.folder-proposals.test.ts} +7 -7
- package/src/modules/{workflow/__tests__/workflow.service.platform-restore.test.ts → version-control/__tests__/version-control.service.platform-restore.test.ts} +6 -6
- package/src/modules/{workflow/__tests__/workflow.service.read-gate.test.ts → version-control/__tests__/version-control.service.read-gate.test.ts} +9 -9
- package/src/modules/{workflow/__tests__/workflow.service.releaseLock.test.ts → version-control/__tests__/version-control.service.releaseLock.test.ts} +85 -75
- package/src/modules/{workflow/__tests__/workflow.service.repository-replaced.test.ts → version-control/__tests__/version-control.service.repository-replaced.test.ts} +4 -4
- package/src/modules/{workflow/__tests__/workflow.service.sync.test.ts → version-control/__tests__/version-control.service.sync.test.ts} +17 -17
- package/src/modules/{workflow/__tests__/workflow.service.update-change-request.pg.test.ts → version-control/__tests__/version-control.service.update-change-request.pg.test.ts} +6 -6
- package/src/modules/{workflow/__tests__/workflow.service.update-change-request.test.ts → version-control/__tests__/version-control.service.update-change-request.test.ts} +11 -11
- package/src/modules/{workflow/__tests__/workflow.service.update-from-target.test.ts → version-control/__tests__/version-control.service.update-from-target.test.ts} +22 -22
- package/src/modules/{workflow → version-control}/agent-tools/__tests__/change-request-read.tools.test.ts +3 -3
- package/src/modules/{workflow → version-control}/agent-tools/__tests__/update-change-request.parity.test.ts +16 -16
- package/src/modules/{workflow/agent-tools/__tests__/workflow.tools.test.ts → version-control/agent-tools/__tests__/version-control.tools.test.ts} +9 -9
- package/src/modules/{workflow → version-control}/agent-tools/change-request-read.tools.ts +2 -2
- package/src/modules/{workflow/agent-tools/workflow.tools.ts → version-control/agent-tools/version-control.tools.ts} +30 -30
- package/src/modules/{workflow → version-control}/change-request-hooks.ts +1 -1
- package/src/modules/{workflow/review-workflow → version-control/change-request-review}/__tests__/approval-states.test.ts +5 -5
- package/src/modules/{workflow/review-workflow → version-control/change-request-review}/__tests__/cancel-pr.test.ts +8 -8
- package/src/modules/{workflow/review-workflow → version-control/change-request-review}/__tests__/carry-approvals-forward.test.ts +6 -6
- package/src/modules/{workflow/review-workflow → version-control/change-request-review}/__tests__/erase-approver.test.ts +5 -5
- package/src/modules/{workflow/review-workflow → version-control/change-request-review}/__tests__/merge-gate.test.ts +3 -3
- package/src/modules/{workflow/review-workflow → version-control/change-request-review}/__tests__/merge-records-own-commit.test.ts +3 -3
- package/src/modules/{workflow/review-workflow/review-workflow.interface.ts → version-control/change-request-review/change-request-review.interface.ts} +1 -1
- package/src/modules/{workflow/review-workflow/review-workflow.service.ts → version-control/change-request-review/change-request-review.service.ts} +28 -28
- package/src/modules/{workflow → version-control}/event-bus.ts +14 -14
- package/src/modules/{workflow → version-control}/events-delivery.ts +11 -11
- package/src/modules/{workflow → version-control}/events.routes.ts +5 -5
- package/src/modules/{workflow → version-control}/file-lock.service.ts +6 -6
- package/src/modules/{workflow → version-control}/git/__tests__/git-test-helpers.ts +3 -3
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.accessGating.test.ts +5 -5
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.appliedChange.test.ts +4 -4
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.changedFilesForPr.test.ts +16 -16
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.changedPathsMemo.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.commitChanges.test.ts +3 -3
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.commitFile.strayPath.test.ts +10 -10
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.commitFile.test.ts +3 -3
- package/src/modules/version-control/git/__tests__/git.service.commitLanded.test.ts +199 -0
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.createBranch.test.ts +3 -3
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.deleteBranch.test.ts +7 -7
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.diffFileAtCommit.test.ts +9 -9
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.diffFileBetweenBranches.test.ts +23 -23
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.fileBytesAtCommit.test.ts +7 -7
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.fileContentsAtCommit.test.ts +3 -3
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.forkPoint.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.history-guards.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.list-branches.test.ts +12 -12
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.listTrackedFiles.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.logForFile.test.ts +6 -6
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.mergeChangeRequest.test.ts +99 -22
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.mergeIntoBranch.test.ts +16 -16
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.pendingChanges.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.postMergePull.test.ts +5 -5
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.prFetchFailure.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.pull.test.ts +12 -12
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.readFileAtRef.test.ts +3 -3
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.revertPathsAndPush.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.status.test.ts +4 -4
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.syncFromRemote.test.ts +8 -8
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.worktrees.test.ts +4 -4
- package/src/modules/{workflow → version-control}/git/__tests__/pull-request.service.list-fetch.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/pull-request.service.test.ts +6 -6
- package/src/modules/{workflow → version-control}/git/git.service.ts +112 -59
- package/src/modules/{workflow → version-control}/git/node-git-runner.ts +1 -1
- package/src/modules/{workflow → version-control}/git/pull-request.service.ts +12 -12
- package/src/modules/{workflow → version-control}/index.ts +6 -5
- package/src/modules/{workflow → version-control}/pending-commits.service.ts +2 -2
- package/src/modules/{workflow → version-control}/pending-commits.worker.ts +8 -8
- package/src/modules/{workflow → version-control}/read-on-branch.ts +2 -2
- package/src/modules/{workflow/workflow-hooks.ts → version-control/version-control-hooks.ts} +44 -5
- package/src/modules/{workflow/workflow.routes.ts → version-control/version-control.routes.ts} +64 -63
- package/src/modules/{workflow/workflow.service.ts → version-control/version-control.service.ts} +96 -109
- package/src/modules/workspace/__tests__/agent-access.gate.test.ts +8 -8
- package/src/modules/workspace/__tests__/agent-downloads.test.ts +13 -16
- package/src/modules/workspace/__tests__/agent-uploads.test.ts +11 -12
- package/src/modules/workspace/__tests__/escape-sequences.routes.test.ts +11 -16
- package/src/modules/workspace/__tests__/file-stat-access.test.ts +3 -3
- package/src/modules/workspace/__tests__/git-internals.security.test.ts +27 -27
- package/src/modules/workspace/__tests__/kb-repository.test.ts +1 -1
- package/src/modules/workspace/__tests__/rest-tool-arguments.test.ts +3 -3
- package/src/modules/workspace/__tests__/start-session.default-branch.test.ts +152 -0
- package/src/modules/workspace/__tests__/workspace-paths-inside-the-repo.test.ts +6 -6
- package/src/modules/workspace/__tests__/workspace-tmp.tools.test.ts +13 -14
- package/src/modules/workspace/__tests__/workspace.routes.at-ref.test.ts +6 -6
- package/src/modules/workspace/__tests__/workspace.routes.branch-errors.test.ts +4 -4
- package/src/modules/workspace/__tests__/workspace.routes.create-grant.test.ts +6 -6
- package/src/modules/workspace/__tests__/workspace.routes.delete.test.ts +8 -8
- package/src/modules/workspace/__tests__/workspace.routes.download-implies-read.test.ts +4 -4
- package/src/modules/workspace/__tests__/workspace.routes.download.test.ts +6 -6
- package/src/modules/workspace/__tests__/workspace.routes.file-writes.test.ts +6 -6
- package/src/modules/workspace/__tests__/workspace.routes.folder-zip-access.test.ts +4 -4
- package/src/modules/workspace/__tests__/workspace.routes.folders.test.ts +6 -6
- package/src/modules/workspace/__tests__/workspace.routes.move-platform-files.test.ts +7 -7
- package/src/modules/workspace/__tests__/workspace.routes.read-gate.test.ts +13 -13
- package/src/modules/workspace/__tests__/workspace.service.any-workspace-credentials.test.ts +1 -1
- package/src/modules/workspace/__tests__/workspace.service.replaced-repository.test.ts +1 -1
- package/src/modules/workspace/__tests__/workspace.service.worktrees.test.ts +1 -1
- package/src/modules/workspace/__tests__/workspace.tools.agents-file.test.ts +5 -5
- package/src/modules/workspace/__tests__/workspace.tools.branch-errors.test.ts +5 -5
- package/src/modules/workspace/__tests__/workspace.tools.test.ts +27 -27
- package/src/modules/workspace/agent-access.gate.ts +5 -5
- package/src/modules/workspace/git-internals.middleware.ts +2 -2
- package/src/modules/workspace/kb-repository.ts +1 -1
- package/src/modules/workspace/startup/__tests__/kb-startup-runner.degraded.test.ts +1 -1
- package/src/modules/workspace/startup/__tests__/kb-startup-runner.test.ts +1 -1
- package/src/modules/workspace/startup/__tests__/kb-startup-runner.worktrees.test.ts +1 -1
- package/src/modules/workspace/startup/kb-git.ts +1 -1
- package/src/modules/workspace/startup/steps/__tests__/steps.test.ts +94 -70
- package/src/modules/workspace/startup/steps/seed-tree.ts +4 -5
- package/src/modules/workspace/startup/steps/template-files.step.ts +4 -5
- package/src/modules/workspace/startup/steps/template-source.ts +21 -6
- package/src/modules/workspace/workspace-tmp.ts +4 -4
- package/src/modules/workspace/workspace.routes.ts +26 -26
- package/src/modules/workspace/workspace.service.ts +11 -11
- package/src/modules/workspace/workspace.tools.ts +17 -10
- package/src/shared/__tests__/canonical-file-identity.test.ts +5 -5
- package/src/shared/__tests__/fire-and-forget.test.ts +39 -0
- package/src/shared/__tests__/http-errors.test.ts +4 -4
- package/src/shared/canonical-file-identity.ts +5 -5
- package/src/shared/domain-errors.ts +44 -44
- package/src/shared/fire-and-forget.ts +26 -0
- package/src/shared/git.contract.ts +1 -1
- package/src/shared/http-errors.ts +3 -3
- package/src/shared/kb-context.ts +130 -130
- package/src/shared/pending-proposals.ts +4 -4
- package/src/tenancy/__tests__/tenant-host.test.ts +372 -372
- package/src/tenancy/__tests__/tenant-runtime.test.ts +221 -221
- package/src/tenancy/__tests__/tenant-secrets.test.ts +35 -35
- package/src/tenancy/index.ts +35 -35
- package/src/tenancy/static-tenant-source.ts +1 -1
- package/src/tenancy/tenant-host.ts +261 -261
- package/src/tenancy/tenant-runtime.ts +208 -208
- package/src/tenancy/tenant-source.contract.ts +59 -59
- package/dist/modules/workflow/agent-tools/change-request-read-shape.d.ts.map +0 -1
- package/dist/modules/workflow/agent-tools/change-request-read-shape.js.map +0 -1
- package/dist/modules/workflow/agent-tools/change-request-read.tools.d.ts.map +0 -1
- package/dist/modules/workflow/agent-tools/change-request-read.tools.js.map +0 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.d.ts.map +0 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.js.map +0 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts.map +0 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.js.map +0 -1
- package/dist/modules/workflow/change-request-hooks.d.ts.map +0 -1
- package/dist/modules/workflow/change-request-hooks.js.map +0 -1
- package/dist/modules/workflow/event-bus.d.ts.map +0 -1
- package/dist/modules/workflow/event-bus.js.map +0 -1
- package/dist/modules/workflow/events-delivery.d.ts.map +0 -1
- package/dist/modules/workflow/events-delivery.js.map +0 -1
- package/dist/modules/workflow/events.routes.d.ts.map +0 -1
- package/dist/modules/workflow/events.routes.js.map +0 -1
- package/dist/modules/workflow/file-lock.service.d.ts.map +0 -1
- package/dist/modules/workflow/file-lock.service.js.map +0 -1
- package/dist/modules/workflow/git/change-request-link.d.ts.map +0 -1
- package/dist/modules/workflow/git/change-request-link.js.map +0 -1
- package/dist/modules/workflow/git/git-version.d.ts.map +0 -1
- package/dist/modules/workflow/git/git-version.js.map +0 -1
- package/dist/modules/workflow/git/git.service.d.ts.map +0 -1
- package/dist/modules/workflow/git/git.service.js.map +0 -1
- package/dist/modules/workflow/git/merge-commit.d.ts.map +0 -1
- package/dist/modules/workflow/git/merge-commit.js.map +0 -1
- package/dist/modules/workflow/git/node-git-runner.d.ts.map +0 -1
- package/dist/modules/workflow/git/node-git-runner.js.map +0 -1
- package/dist/modules/workflow/git/pull-request.service.d.ts.map +0 -1
- package/dist/modules/workflow/git/pull-request.service.js.map +0 -1
- package/dist/modules/workflow/index.d.ts.map +0 -1
- package/dist/modules/workflow/index.js.map +0 -1
- package/dist/modules/workflow/pending-commits.service.d.ts.map +0 -1
- package/dist/modules/workflow/pending-commits.service.js.map +0 -1
- package/dist/modules/workflow/pending-commits.worker.d.ts.map +0 -1
- package/dist/modules/workflow/pending-commits.worker.js.map +0 -1
- package/dist/modules/workflow/read-on-branch.d.ts.map +0 -1
- package/dist/modules/workflow/read-on-branch.js.map +0 -1
- package/dist/modules/workflow/recovery-bot.d.ts.map +0 -1
- package/dist/modules/workflow/recovery-bot.js.map +0 -1
- package/dist/modules/workflow/review-workflow/approval-lock.d.ts.map +0 -1
- package/dist/modules/workflow/review-workflow/approval-lock.js.map +0 -1
- package/dist/modules/workflow/review-workflow/review-workflow.interface.d.ts.map +0 -1
- package/dist/modules/workflow/review-workflow/review-workflow.interface.js +0 -2
- package/dist/modules/workflow/review-workflow/review-workflow.interface.js.map +0 -1
- package/dist/modules/workflow/review-workflow/review-workflow.service.d.ts.map +0 -1
- package/dist/modules/workflow/review-workflow/review-workflow.service.js.map +0 -1
- package/dist/modules/workflow/sanitize-error.d.ts.map +0 -1
- package/dist/modules/workflow/sanitize-error.js.map +0 -1
- package/dist/modules/workflow/workflow-hooks.d.ts.map +0 -1
- package/dist/modules/workflow/workflow-hooks.js.map +0 -1
- package/dist/modules/workflow/workflow.routes.d.ts.map +0 -1
- package/dist/modules/workflow/workflow.routes.js.map +0 -1
- package/dist/modules/workflow/workflow.service.d.ts.map +0 -1
- package/dist/modules/workflow/workflow.service.js.map +0 -1
- package/src/modules/mcp/__tests__/read-only-hint.e2e.test.ts +0 -213
- /package/dist/modules/{workflow → version-control}/agent-tools/change-request-read-shape.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/agent-tools/change-request-read-shape.js +0 -0
- /package/dist/modules/{workflow → version-control}/agent-tools/change-request-read.tools.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/agent-tools/change-request-summary.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/agent-tools/change-request-summary.js +0 -0
- /package/dist/modules/{workflow → version-control}/change-request-hooks.js +0 -0
- /package/dist/modules/{workflow/review-workflow → version-control/change-request-review}/approval-lock.d.ts +0 -0
- /package/dist/modules/{workflow/review-workflow → version-control/change-request-review}/approval-lock.js +0 -0
- /package/dist/modules/{workflow → version-control}/events-delivery.js +0 -0
- /package/dist/modules/{workflow → version-control}/events.routes.js +0 -0
- /package/dist/modules/{workflow → version-control}/git/change-request-link.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/git/change-request-link.js +0 -0
- /package/dist/modules/{workflow → version-control}/git/git-version.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/git/git-version.js +0 -0
- /package/dist/modules/{workflow → version-control}/git/merge-commit.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/git/merge-commit.js +0 -0
- /package/dist/modules/{workflow → version-control}/git/node-git-runner.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/recovery-bot.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/recovery-bot.js +0 -0
- /package/dist/modules/{workflow → version-control}/sanitize-error.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/sanitize-error.js +0 -0
- /package/src/modules/{workflow → version-control}/__tests__/change-request-hooks.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/__tests__/fake-file-lock-db.ts +0 -0
- /package/src/modules/{workflow → version-control}/__tests__/pending-commits.canonical.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/__tests__/pending-commits.enqueue-if-absent.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/__tests__/pending-commits.repository-replaced.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/__tests__/sanitize-error.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/agent-tools/__tests__/change-request-read-shape.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/agent-tools/change-request-read-shape.ts +0 -0
- /package/src/modules/{workflow → version-control}/agent-tools/change-request-summary.ts +0 -0
- /package/src/modules/{workflow/review-workflow → version-control/change-request-review}/approval-lock.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/branchAuthor.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/change-request-link.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/git-version.failure.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/git-version.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/node-git-runner.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/pull-request.service.getPrDetail.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/pull-request.service.placeholder.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/pull-request.service.viewer-can-cancel.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/pull-request.service.viewer-can-delete.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/pull-request.service.viewer-can-update.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/change-request-link.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/git-version.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/merge-commit.ts +0 -0
- /package/src/modules/{workflow → version-control}/recovery-bot.ts +0 -0
- /package/src/modules/{workflow → version-control}/sanitize-error.ts +0 -0
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
joinBranchFor,
|
|
5
5
|
type AuthUser,
|
|
6
6
|
type ChangeRequest,
|
|
7
|
-
type
|
|
7
|
+
type IVersionControlService,
|
|
8
8
|
} from '@bevel-software/platform-shared';
|
|
9
9
|
import { type WorkspaceService } from '../../workspace/workspace.service.js';
|
|
10
10
|
import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
@@ -82,10 +82,10 @@ function makeHarness(
|
|
|
82
82
|
return text;
|
|
83
83
|
}),
|
|
84
84
|
} as unknown as WorkspaceService;
|
|
85
|
-
const
|
|
85
|
+
const versionControl = {
|
|
86
86
|
rejectChangeRequest: vi.fn(async () => ({ number: 7, state: 'closed' })),
|
|
87
87
|
deleteBranch: vi.fn(async () => undefined),
|
|
88
|
-
} as unknown as
|
|
88
|
+
} as unknown as IVersionControlService;
|
|
89
89
|
const asked: { verb: string; path: string; email: string }[] = [];
|
|
90
90
|
const answer = (verb: 'canRead' | 'canWrite' | 'canOwner' | 'canDownload') =>
|
|
91
91
|
vi.fn(async (_ws: string, email: string, path: string) => {
|
|
@@ -99,8 +99,8 @@ function makeHarness(
|
|
|
99
99
|
canDownload: answer('canDownload'),
|
|
100
100
|
} as unknown as IAccessControl;
|
|
101
101
|
return {
|
|
102
|
-
svc: new JoinRequestsService(workspaceService,
|
|
103
|
-
|
|
102
|
+
svc: new JoinRequestsService(workspaceService, versionControl, testKbContext(), accessControl),
|
|
103
|
+
versionControl,
|
|
104
104
|
asked,
|
|
105
105
|
fetches,
|
|
106
106
|
};
|
|
@@ -112,8 +112,8 @@ describe('a request settles once the person holds what it asked for', () => {
|
|
|
112
112
|
// so an owner grant made in the dialog retires the Can edit request.
|
|
113
113
|
const h = makeHarness(ASKS_WRITE, { canWrite: true });
|
|
114
114
|
await expect(h.svc.list('GTM', folderTarget(FOLDER), [cr()], ACTOR)).resolves.toEqual([]);
|
|
115
|
-
expect(h.
|
|
116
|
-
expect(h.
|
|
115
|
+
expect(h.versionControl.rejectChangeRequest).toHaveBeenCalled();
|
|
116
|
+
expect(h.versionControl.deleteBranch).toHaveBeenCalledWith(expect.anything(), BRANCH, ACTOR);
|
|
117
117
|
});
|
|
118
118
|
|
|
119
119
|
it('asks about the ITEM, not its rules file — a folder request is about the folder', async () => {
|
|
@@ -134,7 +134,7 @@ describe('a request settles once the person holds what it asked for', () => {
|
|
|
134
134
|
const out = await h.svc.list('GTM', folderTarget(FOLDER), [cr()], ACTOR);
|
|
135
135
|
expect(out).toHaveLength(1);
|
|
136
136
|
expect(out[0].proposals.map((p) => p.verb)).toEqual(['write']);
|
|
137
|
-
expect(h.
|
|
137
|
+
expect(h.versionControl.rejectChangeRequest).not.toHaveBeenCalled();
|
|
138
138
|
});
|
|
139
139
|
|
|
140
140
|
it('keeps today\'s literal rule for a proposal naming a ROLE', async () => {
|
|
@@ -145,7 +145,7 @@ describe('a request settles once the person holds what it asked for', () => {
|
|
|
145
145
|
const out = await h.svc.list('GTM', folderTarget(FOLDER), [cr()], ACTOR);
|
|
146
146
|
expect(out).toHaveLength(1);
|
|
147
147
|
expect(out[0].proposals.map((p) => p.label)).toEqual(['role/Analysts']);
|
|
148
|
-
expect(h.
|
|
148
|
+
expect(h.versionControl.rejectChangeRequest).not.toHaveBeenCalled();
|
|
149
149
|
});
|
|
150
150
|
|
|
151
151
|
it('leaves the request open when the resolver cannot answer', async () => {
|
|
@@ -155,7 +155,7 @@ describe('a request settles once the person holds what it asked for', () => {
|
|
|
155
155
|
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
|
|
156
156
|
const out = await h.svc.list('GTM', folderTarget(FOLDER), [cr()], ACTOR);
|
|
157
157
|
expect(out).toHaveLength(1);
|
|
158
|
-
expect(h.
|
|
158
|
+
expect(h.versionControl.rejectChangeRequest).not.toHaveBeenCalled();
|
|
159
159
|
warn.mockRestore();
|
|
160
160
|
});
|
|
161
161
|
});
|
|
@@ -182,27 +182,27 @@ describe('a branch that cannot be read settles nothing', () => {
|
|
|
182
182
|
expect(h.fetches.some((f) => f.force)).toBe(true);
|
|
183
183
|
expect(out).toHaveLength(1);
|
|
184
184
|
expect(out[0].proposals.map((p) => p.verb)).toEqual(['write']);
|
|
185
|
-
expect(h.
|
|
185
|
+
expect(h.versionControl.rejectChangeRequest).not.toHaveBeenCalled();
|
|
186
186
|
});
|
|
187
187
|
|
|
188
188
|
it('leaves the request open — and unclosed — when the branch still cannot be read', async () => {
|
|
189
189
|
const h = makeHarness(undefined);
|
|
190
190
|
await expect(h.svc.list('GTM', folderTarget(FOLDER), [cr()], ACTOR)).resolves.toEqual([]);
|
|
191
|
-
expect(h.
|
|
192
|
-
expect(h.
|
|
191
|
+
expect(h.versionControl.rejectChangeRequest).not.toHaveBeenCalled();
|
|
192
|
+
expect(h.versionControl.deleteBranch).not.toHaveBeenCalled();
|
|
193
193
|
});
|
|
194
194
|
|
|
195
195
|
it('reconcile refuses to settle one it could not read', async () => {
|
|
196
196
|
const h = makeHarness(undefined);
|
|
197
197
|
await expect(h.svc.reconcile('GTM', folderTarget(FOLDER), cr(), ACTOR)).resolves.toBe(false);
|
|
198
|
-
expect(h.
|
|
198
|
+
expect(h.versionControl.rejectChangeRequest).not.toHaveBeenCalled();
|
|
199
199
|
});
|
|
200
200
|
|
|
201
201
|
it('still settles a branch it DID read that proposes nothing', async () => {
|
|
202
202
|
// The distinction has to cut both ways, or nothing would ever retire.
|
|
203
203
|
const h = makeHarness(DEFAULT_MD);
|
|
204
204
|
await expect(h.svc.reconcile('GTM', folderTarget(FOLDER), cr(), ACTOR)).resolves.toBe(true);
|
|
205
|
-
expect(h.
|
|
205
|
+
expect(h.versionControl.rejectChangeRequest).toHaveBeenCalled();
|
|
206
206
|
});
|
|
207
207
|
});
|
|
208
208
|
|
|
@@ -227,7 +227,7 @@ describe('a person the rules explicitly deny', () => {
|
|
|
227
227
|
const out = await h.svc.list('GTM', folderTarget(FOLDER), [cr()], ACTOR);
|
|
228
228
|
expect(out).toHaveLength(1);
|
|
229
229
|
expect(out[0].proposals.map((p) => p.verb)).toEqual(['write']);
|
|
230
|
-
expect(h.
|
|
230
|
+
expect(h.versionControl.rejectChangeRequest).not.toHaveBeenCalled();
|
|
231
231
|
});
|
|
232
232
|
|
|
233
233
|
it('retires it once the grant has landed and the resolver says they write', async () => {
|
|
@@ -254,8 +254,8 @@ describe('a stale ref must not be mistaken for a finished request', () => {
|
|
|
254
254
|
const h = staleHarness();
|
|
255
255
|
const out = await h.svc.list('GTM', folderTarget(FOLDER), [cr()], ACTOR);
|
|
256
256
|
|
|
257
|
-
expect(h.
|
|
258
|
-
expect(h.
|
|
257
|
+
expect(h.versionControl.rejectChangeRequest).not.toHaveBeenCalled();
|
|
258
|
+
expect(h.versionControl.deleteBranch).not.toHaveBeenCalled();
|
|
259
259
|
// And having fetched, it reports the proposal rather than nothing.
|
|
260
260
|
expect(out).toHaveLength(1);
|
|
261
261
|
expect(out[0].proposals.map((p) => p.verb)).toEqual(['write']);
|
|
@@ -264,7 +264,7 @@ describe('a stale ref must not be mistaken for a finished request', () => {
|
|
|
264
264
|
it('reconcile refuses to settle it either', async () => {
|
|
265
265
|
const h = staleHarness();
|
|
266
266
|
await expect(h.svc.reconcile('GTM', folderTarget(FOLDER), cr(), ACTOR)).resolves.toBe(false);
|
|
267
|
-
expect(h.
|
|
267
|
+
expect(h.versionControl.rejectChangeRequest).not.toHaveBeenCalled();
|
|
268
268
|
});
|
|
269
269
|
|
|
270
270
|
it('confirms with a FORCED fetch before closing anything', async () => {
|
|
@@ -272,7 +272,7 @@ describe('a stale ref must not be mistaken for a finished request', () => {
|
|
|
272
272
|
await h.svc.list('GTM', folderTarget(FOLDER), [cr()], ACTOR);
|
|
273
273
|
expect(h.fetches.some((f) => f.force)).toBe(true);
|
|
274
274
|
// Genuinely finished — the confirming read agrees, so it closes.
|
|
275
|
-
expect(h.
|
|
275
|
+
expect(h.versionControl.rejectChangeRequest).toHaveBeenCalled();
|
|
276
276
|
});
|
|
277
277
|
});
|
|
278
278
|
|
|
@@ -318,10 +318,10 @@ describe('a request whose target is a FILE', () => {
|
|
|
318
318
|
return text;
|
|
319
319
|
}),
|
|
320
320
|
} as unknown as WorkspaceService;
|
|
321
|
-
const
|
|
321
|
+
const versionControl = {
|
|
322
322
|
rejectChangeRequest: vi.fn(async () => ({ number: 7, state: 'closed' })),
|
|
323
323
|
deleteBranch: vi.fn(async () => undefined),
|
|
324
|
-
} as unknown as
|
|
324
|
+
} as unknown as IVersionControlService;
|
|
325
325
|
const answer = (verb: string) => vi.fn(async () => holds[verb] ?? false);
|
|
326
326
|
const accessControl = {
|
|
327
327
|
canRead: answer('canRead'),
|
|
@@ -330,8 +330,8 @@ describe('a request whose target is a FILE', () => {
|
|
|
330
330
|
canDownload: answer('canDownload'),
|
|
331
331
|
} as unknown as IAccessControl;
|
|
332
332
|
return {
|
|
333
|
-
svc: new JoinRequestsService(workspaceService,
|
|
334
|
-
|
|
333
|
+
svc: new JoinRequestsService(workspaceService, versionControl, testKbContext(), accessControl),
|
|
334
|
+
versionControl,
|
|
335
335
|
workspaceService,
|
|
336
336
|
};
|
|
337
337
|
}
|
|
@@ -342,8 +342,8 @@ describe('a request whose target is a FILE', () => {
|
|
|
342
342
|
|
|
343
343
|
expect(out).toHaveLength(1);
|
|
344
344
|
expect(out[0].proposals.map((p) => p.verb)).toEqual(['write']);
|
|
345
|
-
expect(h.
|
|
346
|
-
expect(h.
|
|
345
|
+
expect(h.versionControl.rejectChangeRequest).not.toHaveBeenCalled();
|
|
346
|
+
expect(h.versionControl.deleteBranch).not.toHaveBeenCalled();
|
|
347
347
|
});
|
|
348
348
|
|
|
349
349
|
it('reads the FILE itself, never an access.md beside it', async () => {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
2
|
-
import {
|
|
3
|
-
import type { TreeWalkOptions, WalkListener, WalkResult } from '../../../shared/fs.contract.js';
|
|
2
|
+
import { realDisk } from '../../../__tests__/real-disk.js';
|
|
4
3
|
import fs from 'node:fs/promises';
|
|
5
4
|
import path from 'node:path';
|
|
6
5
|
import os from 'node:os';
|
|
7
6
|
import { DEFAULT_BRANCH, pluginDisplayNameOf, type AuthUser } from '@bevel-software/platform-shared';
|
|
8
7
|
|
|
9
|
-
import type { WorkspaceService } from '../../workspace/
|
|
10
|
-
import {
|
|
8
|
+
import type { WorkspaceService } from '../../workspace/index.js';
|
|
9
|
+
import { realAccessControl } from '../../../__tests__/real-access.js';
|
|
11
10
|
import { PushNeedsAgentResolutionError } from '../../../shared/domain-errors.js';
|
|
12
11
|
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
13
12
|
import { KbPluginSource } from '../discovery/kb-plugin-source.js';
|
|
@@ -16,22 +15,22 @@ import { testKbContext } from '../../../__tests__/kb-context.js';
|
|
|
16
15
|
|
|
17
16
|
// The one walk of the checkout, with a switch that makes it report a hole —
|
|
18
17
|
// the way a folder it cannot list would — to every listener on it. The
|
|
19
|
-
// walk is injected, so the switch is a disk that lies, not a module mock
|
|
18
|
+
// walk is injected, so the switch is a disk that lies, not a module mock:
|
|
19
|
+
// the real disk the shared fixture hands out, its walk wrapped.
|
|
20
20
|
const walkMock = { holeInTheWalk: false };
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
): Promise<WalkResult> {
|
|
27
|
-
const result = await super.walkKb(root, listeners, options);
|
|
21
|
+
function holedDisk(): ReturnType<typeof realDisk> {
|
|
22
|
+
const disk = realDisk();
|
|
23
|
+
const walkKb = disk.walkKb.bind(disk);
|
|
24
|
+
disk.walkKb = async (root, listeners, options) => {
|
|
25
|
+
const result = await walkKb(root, listeners, options);
|
|
28
26
|
if (walkMock.holeInTheWalk) {
|
|
29
27
|
const err = Object.assign(new Error('EACCES: permission denied'), { code: 'EACCES' });
|
|
30
28
|
for (const l of listeners) await l.onHole?.('KnowledgeBase/Notes', err);
|
|
31
29
|
result.holes.push('KnowledgeBase/Notes');
|
|
32
30
|
}
|
|
33
31
|
return result;
|
|
34
|
-
}
|
|
32
|
+
};
|
|
33
|
+
return disk;
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
/**
|
|
@@ -58,15 +57,19 @@ describe('PluginRenameService', () => {
|
|
|
58
57
|
let repo: string;
|
|
59
58
|
let commits: { summary: string; paths: string[] }[];
|
|
60
59
|
let failNextCommit: Error | null;
|
|
60
|
+
/** What each workspace-relative path last read as when it was committed — the driver's picture of the tree. */
|
|
61
|
+
let committed: Map<string, string>;
|
|
61
62
|
let failWriteMatching: string | null;
|
|
62
63
|
let invalidated: number;
|
|
63
|
-
let access:
|
|
64
|
+
let access: ReturnType<typeof realAccessControl>;
|
|
64
65
|
let svc: PluginRenameService;
|
|
65
66
|
|
|
67
|
+
// A seed is a committed file: what origin has before the rename runs.
|
|
66
68
|
const write = async (rel: string, text: string) => {
|
|
67
69
|
const abs = path.join(repo, rel);
|
|
68
70
|
await fs.mkdir(path.dirname(abs), { recursive: true });
|
|
69
71
|
await fs.writeFile(abs, text);
|
|
72
|
+
committed.set(`${KB_DIR}/${rel}`, text);
|
|
70
73
|
};
|
|
71
74
|
const read = (rel: string) => fs.readFile(path.join(repo, rel), 'utf-8');
|
|
72
75
|
const manifest = async () => JSON.parse(await read('Plugins/GTM/plugin.json'));
|
|
@@ -77,6 +80,7 @@ describe('PluginRenameService', () => {
|
|
|
77
80
|
commits = [];
|
|
78
81
|
failNextCommit = null;
|
|
79
82
|
failWriteMatching = null;
|
|
83
|
+
committed = new Map();
|
|
80
84
|
walkMock.holeInTheWalk = false;
|
|
81
85
|
invalidated = 0;
|
|
82
86
|
const workspaceService = {
|
|
@@ -101,7 +105,19 @@ describe('PluginRenameService', () => {
|
|
|
101
105
|
failNextCommit = null;
|
|
102
106
|
throw err;
|
|
103
107
|
}
|
|
108
|
+
// Git's rule: a tree whose files all read as they were last committed
|
|
109
|
+
// has nothing to commit, and the service is answered null.
|
|
110
|
+
let changed = false;
|
|
111
|
+
for (const p of paths) {
|
|
112
|
+
const now = await fs.readFile(path.join(root, wsId, p), 'utf-8');
|
|
113
|
+
if (now !== committed.get(p)) {
|
|
114
|
+
changed = true;
|
|
115
|
+
committed.set(p, now);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (!changed) return null;
|
|
104
119
|
commits.push({ summary, paths });
|
|
120
|
+
return { sha: 'c0ffee' } as never;
|
|
105
121
|
},
|
|
106
122
|
};
|
|
107
123
|
|
|
@@ -114,8 +130,8 @@ describe('PluginRenameService', () => {
|
|
|
114
130
|
await write('Skills/Eng/deploy/access.md', DEPLOY_RULES);
|
|
115
131
|
await write('Skills/Eng/deploy/SKILL.md', '---\ndescription: Ship it.\n---\n');
|
|
116
132
|
|
|
117
|
-
access =
|
|
118
|
-
const disk =
|
|
133
|
+
access = realAccessControl(workspaceService, KB_DIR, realDisk());
|
|
134
|
+
const disk = holedDisk();
|
|
119
135
|
svc = new PluginRenameService(workspaceService, driver, access, new KbPluginSource(disk, testKbContext({ kbDirName: KB_DIR })), disk, testKbContext({ kbDirName: KB_DIR }), undefined, () => {
|
|
120
136
|
invalidated += 1;
|
|
121
137
|
});
|
|
@@ -125,7 +141,7 @@ describe('PluginRenameService', () => {
|
|
|
125
141
|
it('refuses to claim a name against a listing with a hole in it — an unreadable folder may hold that very plugin', async () => {
|
|
126
142
|
// Discovery as the walker reports it when a folder exists but could not
|
|
127
143
|
// be read: the plugins it did see, plus the hole.
|
|
128
|
-
const real = new KbPluginSource(
|
|
144
|
+
const real = new KbPluginSource(realDisk(), testKbContext({ kbDirName: KB_DIR }));
|
|
129
145
|
const holed = {
|
|
130
146
|
dialect: 'kb',
|
|
131
147
|
discover: async (root: string) => ({ ...(await real.discover(root)), unreadable: ['Plugins/Hidden'] }),
|
|
@@ -135,7 +151,7 @@ describe('PluginRenameService', () => {
|
|
|
135
151
|
{ commitChanges: async () => { throw new Error('must not commit'); } },
|
|
136
152
|
access,
|
|
137
153
|
holed,
|
|
138
|
-
|
|
154
|
+
realDisk(),
|
|
139
155
|
testKbContext({ kbDirName: KB_DIR }),
|
|
140
156
|
);
|
|
141
157
|
await expect(svcOverHole.rename(manager, 'gtm', { name: 'go-to-market' })).rejects.toMatchObject({
|
|
@@ -156,7 +172,7 @@ describe('PluginRenameService', () => {
|
|
|
156
172
|
});
|
|
157
173
|
|
|
158
174
|
it('tells a NON-manager nothing about the tree — a holed discovery is still just "unknown plugin" to them', async () => {
|
|
159
|
-
const real = new KbPluginSource(
|
|
175
|
+
const real = new KbPluginSource(realDisk(), testKbContext({ kbDirName: KB_DIR }));
|
|
160
176
|
const holed = {
|
|
161
177
|
dialect: 'kb',
|
|
162
178
|
discover: async (root: string) => ({ ...(await real.discover(root)), unreadable: ['Plugins/Hidden'] }),
|
|
@@ -166,7 +182,7 @@ describe('PluginRenameService', () => {
|
|
|
166
182
|
{ commitChanges: async () => { throw new Error('must not commit'); } },
|
|
167
183
|
access,
|
|
168
184
|
holed,
|
|
169
|
-
|
|
185
|
+
realDisk(),
|
|
170
186
|
testKbContext({ kbDirName: KB_DIR }),
|
|
171
187
|
);
|
|
172
188
|
const refusal = await svcOverHole.rename(member, 'gtm', { name: 'go-to-market' }).catch((e: unknown) => e);
|
|
@@ -270,7 +286,7 @@ describe('PluginRenameService', () => {
|
|
|
270
286
|
expect(await read('Skills/Eng/deploy/access.md')).toBe(DEPLOY_RULES);
|
|
271
287
|
// The three answers that must never diverge: the rename's, the
|
|
272
288
|
// discovery source's, and the shared reader's over the file itself.
|
|
273
|
-
const { plugins } = await new KbPluginSource(
|
|
289
|
+
const { plugins } = await new KbPluginSource(realDisk(), testKbContext({ kbDirName: KB_DIR })).discover(repo);
|
|
274
290
|
const found = plugins.find((p) => p.folder === 'Plugins/GTM')!;
|
|
275
291
|
expect([found.name, found.displayName]).toEqual([result.name, result.displayName]);
|
|
276
292
|
expect(pluginDisplayNameOf(JSON.parse(await read('Plugins/GTM/plugin.json')))).toBe(result.displayName);
|
|
@@ -413,6 +429,15 @@ describe('PluginRenameService', () => {
|
|
|
413
429
|
expect(await access.canRead(wsId, member.email, 'Skills/Eng/deploy/SKILL.md')).toBe(true);
|
|
414
430
|
});
|
|
415
431
|
|
|
432
|
+
it('changes no bytes when the manifest already reads as the rename writes it — a clean tree, nothing to commit', async () => {
|
|
433
|
+
// The manifest already reads exactly as the rename will write it.
|
|
434
|
+
const asWritten = `${JSON.stringify({ name: 'gtm', version: '1.0.0', displayName: 'GTM' }, null, 2)}\n`;
|
|
435
|
+
await write('Plugins/GTM/plugin.json', asWritten);
|
|
436
|
+
await svc.rename(manager, 'gtm', { displayName: 'GTM' });
|
|
437
|
+
expect(await read('Plugins/GTM/plugin.json')).toBe(asWritten);
|
|
438
|
+
expect(commits).toEqual([]);
|
|
439
|
+
});
|
|
440
|
+
|
|
416
441
|
it('will not rename a plugin read from an external format — that repository owns its name', async () => {
|
|
417
442
|
await write('Plugins/Ext/plugin.bundle.json', '{"name":"ext"}');
|
|
418
443
|
await write('Plugins/Ext/access.md', GTM_RULES);
|
|
@@ -5,16 +5,16 @@ import path from 'node:path';
|
|
|
5
5
|
import os from 'node:os';
|
|
6
6
|
import express from 'express';
|
|
7
7
|
import { describe, it, expect, afterEach, vi } from 'vitest';
|
|
8
|
-
import {
|
|
8
|
+
import { realDisk } from '../../../__tests__/real-disk.js';
|
|
9
9
|
import { KbPluginSource } from '../discovery/kb-plugin-source.js';
|
|
10
10
|
|
|
11
11
|
import { DEFAULT_BRANCH, joinBranchFor } from '@bevel-software/platform-shared';
|
|
12
|
-
import type { ChangeRequest,
|
|
12
|
+
import type { ChangeRequest, IVersionControlService } from '@bevel-software/platform-shared';
|
|
13
13
|
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
14
|
-
import type { WorkspaceService } from '../../workspace/
|
|
15
|
-
import type { IAccessControl } from '../../access/
|
|
16
|
-
import type { ISkillService, SkillSummary } from '../../skills/
|
|
17
|
-
import type { IToolManualService, ToolManualSummary } from '../../tool-manuals/
|
|
14
|
+
import type { WorkspaceService } from '../../workspace/index.js';
|
|
15
|
+
import type { IAccessControl } from '../../access/index.js';
|
|
16
|
+
import type { ISkillService, SkillSummary } from '../../skills/index.js';
|
|
17
|
+
import type { IToolManualService, ToolManualSummary } from '../../tool-manuals/index.js';
|
|
18
18
|
import { PluginIndexService } from '../plugins.service.js';
|
|
19
19
|
import { createPluginCreationRoutes, createPluginsRoutes } from '../plugins.routes.js';
|
|
20
20
|
import type { JoinRequestsService } from '../join-requests.service.js';
|
|
@@ -30,7 +30,7 @@ import { testKbContext } from '../../../__tests__/kb-context.js';
|
|
|
30
30
|
* verdicts), the fail-closed omission of plugins with no verdict at all, and
|
|
31
31
|
* the join flow that rides on plain change requests.
|
|
32
32
|
*
|
|
33
|
-
* The plugin index is REAL over a temp KB; access control and the
|
|
33
|
+
* The plugin index is REAL over a temp KB; access control and the version-control service are
|
|
34
34
|
* stubs, because what's under test here is the route's use of them.
|
|
35
35
|
*/
|
|
36
36
|
|
|
@@ -137,7 +137,7 @@ async function makeHarness(opts: HarnessOpts = {}) {
|
|
|
137
137
|
eligibleReaders: async () => ({ restricted: true, roles: ['GTM Team'], users: [OLGA] }),
|
|
138
138
|
} as unknown as IAccessControl;
|
|
139
139
|
|
|
140
|
-
const
|
|
140
|
+
const versionControl = {
|
|
141
141
|
listChangeRequestsAuthoredBy: vi.fn(async () => opts.authoredCrs ?? []),
|
|
142
142
|
listChangeRequests: vi.fn(async () => opts.authoredCrs ?? []),
|
|
143
143
|
getChangeRequest: vi.fn(
|
|
@@ -147,7 +147,7 @@ async function makeHarness(opts: HarnessOpts = {}) {
|
|
|
147
147
|
listBranches: vi.fn(async () => []),
|
|
148
148
|
commitChanges: vi.fn(async () => null),
|
|
149
149
|
openChangeRequest: vi.fn(async () => ({ number: 42 })),
|
|
150
|
-
} as unknown as
|
|
150
|
+
} as unknown as IVersionControlService;
|
|
151
151
|
|
|
152
152
|
const skillService = { listSkills: async () => opts.skills ?? [] } as unknown as ISkillService;
|
|
153
153
|
const toolService = {
|
|
@@ -162,7 +162,7 @@ async function makeHarness(opts: HarnessOpts = {}) {
|
|
|
162
162
|
skillService,
|
|
163
163
|
toolService,
|
|
164
164
|
testKbContext({ kbDirName: KB }),
|
|
165
|
-
new KbPluginSource(
|
|
165
|
+
new KbPluginSource(realDisk(), testKbContext({ kbDirName: KB })),
|
|
166
166
|
);
|
|
167
167
|
|
|
168
168
|
const email = opts.email === undefined ? ALI : opts.email;
|
|
@@ -183,7 +183,7 @@ async function makeHarness(opts: HarnessOpts = {}) {
|
|
|
183
183
|
// The records half is REAL over an in-memory table, because the route's
|
|
184
184
|
// whole contract now is "write a row, answer, then do the git" — a stub
|
|
185
185
|
// would assert the route called something, not that the row and the change
|
|
186
|
-
// request are one-to-one. The git it eventually does is the
|
|
186
|
+
// request are one-to-one. The git it eventually does is the version-control service stub
|
|
187
187
|
// above, as it always was.
|
|
188
188
|
const joinRequestStore = new FakeJoinRequestStore();
|
|
189
189
|
// The change requests the store can see are the ones the listing is told
|
|
@@ -191,7 +191,7 @@ async function makeHarness(opts: HarnessOpts = {}) {
|
|
|
191
191
|
// telling the record it names that the request is over.
|
|
192
192
|
for (const c of opts.authoredCrs ?? []) joinRequestStore.changeRequests.set(c.number, c.state);
|
|
193
193
|
const joinRequestJobs = new PluginJoinRequestJobs(joinRequestStore, {
|
|
194
|
-
|
|
194
|
+
versionControl,
|
|
195
195
|
workspaceService,
|
|
196
196
|
kb: testKbContext({ kbDirName: KB }),
|
|
197
197
|
target: async (pluginKey) => {
|
|
@@ -224,7 +224,7 @@ async function makeHarness(opts: HarnessOpts = {}) {
|
|
|
224
224
|
createPluginsRoutes(
|
|
225
225
|
index,
|
|
226
226
|
accessControl,
|
|
227
|
-
|
|
227
|
+
versionControl,
|
|
228
228
|
joinRequests,
|
|
229
229
|
joinRequestJobs,
|
|
230
230
|
provision as never,
|
|
@@ -241,7 +241,7 @@ async function makeHarness(opts: HarnessOpts = {}) {
|
|
|
241
241
|
server,
|
|
242
242
|
baseUrl: `http://127.0.0.1:${addr.port}`,
|
|
243
243
|
accessControl,
|
|
244
|
-
|
|
244
|
+
versionControl,
|
|
245
245
|
workspaceService,
|
|
246
246
|
joinRequests,
|
|
247
247
|
joinRequestJobs,
|
|
@@ -516,9 +516,9 @@ describe('/api/plugins routes', () => {
|
|
|
516
516
|
const h = await makeHarness({ readable: { [ALI]: ['Plugins/Finance/access.md'] } });
|
|
517
517
|
server = h.server;
|
|
518
518
|
// The one thing the endpoint may not do any more is wait for a clone. A
|
|
519
|
-
//
|
|
519
|
+
// a version-control service that never settles stands in for one: the answer must arrive
|
|
520
520
|
// anyway, and say the request is recorded and not yet carried.
|
|
521
|
-
(h.
|
|
521
|
+
(h.versionControl.createBranch as ReturnType<typeof vi.fn>).mockReturnValue(new Promise(() => {}));
|
|
522
522
|
|
|
523
523
|
const res = await fetch(`${h.baseUrl}/api/plugins/finance/join-request`, { method: 'POST' });
|
|
524
524
|
expect(res.status).toBe(200);
|
|
@@ -526,13 +526,13 @@ describe('/api/plugins routes', () => {
|
|
|
526
526
|
expect(h.joinRequestStore.all()).toMatchObject([
|
|
527
527
|
{ requesterEmail: ALI, pluginKey: 'Finance', status: 'pending', changeRequestNumber: null },
|
|
528
528
|
]);
|
|
529
|
-
expect(h.
|
|
529
|
+
expect(h.versionControl.openChangeRequest).not.toHaveBeenCalled();
|
|
530
530
|
});
|
|
531
531
|
|
|
532
532
|
it('join-request: the recorded request is REPORTED as requested before its CR exists', async () => {
|
|
533
533
|
const h = await makeHarness({ readable: { [ALI]: ['Plugins/Finance/access.md'] } });
|
|
534
534
|
server = h.server;
|
|
535
|
-
(h.
|
|
535
|
+
(h.versionControl.createBranch as ReturnType<typeof vi.fn>).mockReturnValue(new Promise(() => {}));
|
|
536
536
|
await fetch(`${h.baseUrl}/api/plugins/finance/join-request`, { method: 'POST' });
|
|
537
537
|
|
|
538
538
|
// A reload one second after the click. No change request exists — the
|
|
@@ -557,7 +557,7 @@ describe('/api/plugins routes', () => {
|
|
|
557
557
|
// The branch is cut from the FOLDER name, as every join branch before the
|
|
558
558
|
// manifest became the identity was — so none of them is orphaned.
|
|
559
559
|
const branch = joinBranchFor(ALI, 'Finance');
|
|
560
|
-
expect(h.
|
|
560
|
+
expect(h.versionControl.createBranch).toHaveBeenCalledWith(wsId, branch, DEFAULT_BRANCH);
|
|
561
561
|
// The write went to the plugin's access.md and added the caller to the
|
|
562
562
|
// BODY's read list (folder rules), leaving the discovery frontmatter alone.
|
|
563
563
|
const write = (h.workspaceService.writeFile as ReturnType<typeof vi.fn>).mock.calls[0];
|
|
@@ -566,8 +566,8 @@ describe('/api/plugins routes', () => {
|
|
|
566
566
|
expect((write[2] as string).indexOf('everyone')).toBeLessThan(
|
|
567
567
|
(write[2] as string).indexOf('Ali Baba'),
|
|
568
568
|
);
|
|
569
|
-
expect(h.
|
|
570
|
-
expect(h.
|
|
569
|
+
expect(h.versionControl.commitChanges).toHaveBeenCalled();
|
|
570
|
+
expect(h.versionControl.openChangeRequest).toHaveBeenCalledWith(
|
|
571
571
|
workspaceIdForBranch(branch),
|
|
572
572
|
expect.objectContaining({ email: ALI }),
|
|
573
573
|
expect.objectContaining({
|
|
@@ -591,7 +591,7 @@ describe('/api/plugins routes', () => {
|
|
|
591
591
|
await h.joinRequestJobs.drain();
|
|
592
592
|
const branch = joinBranchFor(ALI, 'teams/GTM');
|
|
593
593
|
expect(branch).not.toBe(joinBranchFor(ALI, 'GTM'));
|
|
594
|
-
expect(h.
|
|
594
|
+
expect(h.versionControl.createBranch).toHaveBeenCalledWith(wsId, branch, DEFAULT_BRANCH);
|
|
595
595
|
});
|
|
596
596
|
|
|
597
597
|
it('join-request adopts an existing open join CR instead of opening a second one', async () => {
|
|
@@ -603,8 +603,8 @@ describe('/api/plugins routes', () => {
|
|
|
603
603
|
const res = await fetch(`${h.baseUrl}/api/plugins/finance/join-request`, { method: 'POST' });
|
|
604
604
|
expect(res.status).toBe(200);
|
|
605
605
|
await h.joinRequestJobs.drain();
|
|
606
|
-
expect(h.
|
|
607
|
-
expect(h.
|
|
606
|
+
expect(h.versionControl.createBranch).not.toHaveBeenCalled();
|
|
607
|
+
expect(h.versionControl.openChangeRequest).not.toHaveBeenCalled();
|
|
608
608
|
// The record ends up pointing at the request that was already there.
|
|
609
609
|
expect(h.joinRequestStore.all()).toMatchObject([{ status: 'opened', changeRequestNumber: 9 }]);
|
|
610
610
|
});
|
|
@@ -639,13 +639,13 @@ describe('/api/plugins routes', () => {
|
|
|
639
639
|
await h.joinRequestJobs.drain();
|
|
640
640
|
|
|
641
641
|
expect(h.joinRequestStore.all()).toHaveLength(1);
|
|
642
|
-
expect(h.
|
|
642
|
+
expect(h.versionControl.openChangeRequest).toHaveBeenCalledTimes(1);
|
|
643
643
|
});
|
|
644
644
|
|
|
645
645
|
it('join-request: a failure is recorded, and the listing hands the plugin back with the reason', async () => {
|
|
646
646
|
const error = vi.spyOn(console, 'error').mockImplementation(() => {});
|
|
647
647
|
const h = await makeHarness({ readable: { [ALI]: ['Plugins/Finance/access.md'] } });
|
|
648
|
-
(h.
|
|
648
|
+
(h.versionControl.openChangeRequest as ReturnType<typeof vi.fn>).mockRejectedValue(
|
|
649
649
|
new Error('the remote refused the push'),
|
|
650
650
|
);
|
|
651
651
|
server = h.server;
|
|
@@ -670,7 +670,7 @@ describe('/api/plugins routes', () => {
|
|
|
670
670
|
it('join-request: a click after a failure RETRIES the recorded request rather than recording a second', async () => {
|
|
671
671
|
const error = vi.spyOn(console, 'error').mockImplementation(() => {});
|
|
672
672
|
const h = await makeHarness({ readable: { [ALI]: ['Plugins/Finance/access.md'] } });
|
|
673
|
-
(h.
|
|
673
|
+
(h.versionControl.openChangeRequest as ReturnType<typeof vi.fn>).mockRejectedValueOnce(
|
|
674
674
|
new Error('the remote refused the push'),
|
|
675
675
|
);
|
|
676
676
|
server = h.server;
|
|
@@ -685,7 +685,7 @@ describe('/api/plugins routes', () => {
|
|
|
685
685
|
expect(rows).toHaveLength(1);
|
|
686
686
|
expect(rows[0].id).toBe(failed.id);
|
|
687
687
|
expect(rows[0]).toMatchObject({ status: 'opened', changeRequestNumber: 42, failureReason: null });
|
|
688
|
-
expect(h.
|
|
688
|
+
expect(h.versionControl.openChangeRequest).toHaveBeenCalledTimes(2);
|
|
689
689
|
error.mockRestore();
|
|
690
690
|
});
|
|
691
691
|
|
|
@@ -706,7 +706,7 @@ describe('/api/plugins routes', () => {
|
|
|
706
706
|
await h.joinRequestJobs.sweep();
|
|
707
707
|
await h.joinRequestJobs.drain();
|
|
708
708
|
|
|
709
|
-
expect(h.
|
|
709
|
+
expect(h.versionControl.openChangeRequest).toHaveBeenCalledTimes(1);
|
|
710
710
|
expect(h.joinRequestStore.all()).toMatchObject([{ status: 'opened', changeRequestNumber: 42 }]);
|
|
711
711
|
});
|
|
712
712
|
|
|
@@ -761,7 +761,7 @@ describe('/api/plugins routes', () => {
|
|
|
761
761
|
expect(rows).toHaveLength(1);
|
|
762
762
|
expect(rows[0].id).toBe(answered.id);
|
|
763
763
|
expect(rows[0]).toMatchObject({ status: 'opened', changeRequestNumber: 42 });
|
|
764
|
-
expect(h.
|
|
764
|
+
expect(h.versionControl.openChangeRequest).toHaveBeenCalledTimes(1);
|
|
765
765
|
});
|
|
766
766
|
|
|
767
767
|
it('an opened record whose request is still open counts, before the open listing knows it', async () => {
|
|
@@ -811,7 +811,7 @@ describe('/api/plugins routes', () => {
|
|
|
811
811
|
|
|
812
812
|
it('degrades hasRequested to false when the CR lookup throws', async () => {
|
|
813
813
|
const h = await makeHarness({ readable: { [ALI]: ['Plugins/Finance/access.md'] } });
|
|
814
|
-
(h.
|
|
814
|
+
(h.versionControl.listChangeRequestsAuthoredBy as ReturnType<typeof vi.fn>).mockRejectedValueOnce(
|
|
815
815
|
new Error('gh down'),
|
|
816
816
|
);
|
|
817
817
|
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
joinBranchFor,
|
|
3
3
|
type AuthUser,
|
|
4
4
|
type ChangeRequestState,
|
|
5
|
-
type
|
|
5
|
+
type IVersionControlService,
|
|
6
6
|
} from '@bevel-software/platform-shared';
|
|
7
7
|
import { DrizzleQueryError } from 'drizzle-orm';
|
|
8
8
|
import { spliceGrant } from '../access-model/index.js';
|
|
9
|
-
import { sanitizeError } from '../
|
|
9
|
+
import { sanitizeError } from '../version-control/index.js';
|
|
10
10
|
import { logger } from '../../shared/logging.js';
|
|
11
11
|
import { printable } from '../../shared/printable.js';
|
|
12
12
|
import type { KbContext } from '../../shared/kb-context.js';
|
|
@@ -139,8 +139,8 @@ export interface JoinRequestTarget {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
export interface JoinRequestJobsDeps {
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
versionControl: Pick<
|
|
143
|
+
IVersionControlService,
|
|
144
144
|
| 'createBranch'
|
|
145
145
|
| 'listBranches'
|
|
146
146
|
| 'commitChanges'
|
|
@@ -521,7 +521,7 @@ export class PluginJoinRequestJobs {
|
|
|
521
521
|
claim: ClaimedJoinRequest,
|
|
522
522
|
stillOurs: () => Promise<void>,
|
|
523
523
|
): Promise<void> {
|
|
524
|
-
const {
|
|
524
|
+
const { versionControl, workspaceService, kb } = this.deps;
|
|
525
525
|
const { kbDirName } = kb;
|
|
526
526
|
const target = await this.deps.target(record.pluginKey);
|
|
527
527
|
if (!target) throw new Error('the plugin is no longer available');
|
|
@@ -540,7 +540,7 @@ export class PluginJoinRequestJobs {
|
|
|
540
540
|
// shows nothing to adopt. Paying a round-trip here is the point: it buys
|
|
541
541
|
// the "one recorded request, one change request" promise, and it is off
|
|
542
542
|
// the answer path entirely.
|
|
543
|
-
const mine = await
|
|
543
|
+
const mine = await versionControl.listChangeRequestsAuthoredBy(record.requesterEmail, {
|
|
544
544
|
fresh: true,
|
|
545
545
|
});
|
|
546
546
|
const open = mine.find((cr) => cr.state === 'open' && cr.branch === branch);
|
|
@@ -596,7 +596,7 @@ export class PluginJoinRequestJobs {
|
|
|
596
596
|
// replaced, and it left recorded requests owed forever.
|
|
597
597
|
await stillOurs();
|
|
598
598
|
await workspaceService.writeFile(ws.id, accessPath, spliced.text);
|
|
599
|
-
await
|
|
599
|
+
await versionControl.commitChanges(ws.id, user, `Request access to ${target.displayName}`);
|
|
600
600
|
}
|
|
601
601
|
// The last gate, and the one that matters most: everything above is
|
|
602
602
|
// idempotent and reusable — a branch, a commit on it — but a change
|
|
@@ -619,7 +619,7 @@ export class PluginJoinRequestJobs {
|
|
|
619
619
|
if (!still || still.id !== user.id) {
|
|
620
620
|
throw new Error('the account that asked no longer exists');
|
|
621
621
|
}
|
|
622
|
-
const detail = await
|
|
622
|
+
const detail = await versionControl.openChangeRequest(ws.id, user, {
|
|
623
623
|
sourceBranch: branch,
|
|
624
624
|
targetBranch: kb.defaultBranch,
|
|
625
625
|
// People read these: the display name, not the identifier.
|
|
@@ -653,10 +653,10 @@ export class PluginJoinRequestJobs {
|
|
|
653
653
|
private async ensureBranch(branch: string): Promise<void> {
|
|
654
654
|
const wsId = this.deps.kb.defaultWorkspaceId();
|
|
655
655
|
try {
|
|
656
|
-
await this.deps.
|
|
656
|
+
await this.deps.versionControl.createBranch(wsId, branch, this.deps.kb.defaultBranch);
|
|
657
657
|
return;
|
|
658
658
|
} catch (err) {
|
|
659
|
-
const branches = await this.deps.
|
|
659
|
+
const branches = await this.deps.versionControl.listBranches(wsId, {
|
|
660
660
|
freshFetch: true,
|
|
661
661
|
strictFetch: true,
|
|
662
662
|
});
|