Skip to content

[OpenSpec] ai-copilot-documents-and-code-help #968

Open

Description

@github-actions

⚠️ OpenSpec-managed issue — this content is automatically synced
from the openspec/ directory. Manual edits will be overwritten on next sync.

Artifacts

Specs

Tasks

  • T01: Move resolveTaskProcessingManager() and runTextToTextTask() from lib/Service/CopilotService.php into lib/Service/Copilot/CopilotTextTask.php and call it from CopilotService, with no change in behaviour (REQ-BQCH-002). Verify: the existing tests/Unit/Service/CopilotServiceTest.php stays green, plus a new tests/Unit/Service/Copilot/CopilotTextTaskTest.php for the timeout and failure envelopes.
  • T02: Add lib/Service/Copilot/CopilotAssistService.php with the four targets, the write and explain modes, one repair round-trip and the checks of D2, including a PHP mirror of isCellConditionValid() driven by a shared fixture file (REQ-BQCH-002, REQ-BQCH-003). Verify: PHPUnit tests/Unit/Service/Copilot/CopilotAssistServiceTest.php for each target, the repair round-trip and the 422; tests/utils/feelCell.spec.js reads the same fixture file.
  • T03: Add CopilotController::assist() and the route POST /api/copilot/assist in appinfo/routes.php beside the other copilot routes, #[NoAdminRequired] and #[UserRateLimit(limit: 60, period: 3600)], requiring appSlug and running assertWriteRoleOnApp(); resolve the target schema only among the app's schemas (REQ-BQCH-004). Verify: PHPUnit tests/Unit/Controller/CopilotControllerTest.php cases for 403 viewer, a foreign schema slug and zero writes.
  • T04: Add src/components/copilot/CopilotAssistButton.vue and src/dialogs/CopilotAssistDialog.vue, with an assist() call in src/services/copilot.js; the button renders nothing when the health probe says unavailable (REQ-BQCH-001, REQ-BQCH-003). Verify: vitest tests/components/CopilotAssistButton.spec.js and tests/dialogs/CopilotAssistDialog.spec.js for hidden when unavailable, Accept writes the staged value, Reject writes nothing.
  • T05: Mount the button in ConditionActionRuleEditor.vue (condition), DecisionTableEditor.vue (propose a row), and AutomationEditDialog.vue (field mapping and payload template), passing names only as context (REQ-BQCH-001, REQ-BQCH-004). Verify: extend tests/dialogs/AutomationEditDialog.spec.js, and a Playwright spec tests/e2e/copilot-assist.spec.ts that asks for a rule condition, accepts it, and saves the rule.
  • T06: Add "Add a document" to src/dialogs/CopilotGenerateDialog.vue with the Nextcloud file picker, send documentFileId through requestPlan(), and read the file as the user in CopilotService::plan() with the type list and the 60,000 character cap of D6 (REQ-BQCH-005). Verify: PHPUnit cases in tests/Unit/Service/CopilotServiceTest.php for an unreadable file id (404), an unsupported type and an oversized document; extend tests/dialogs/CopilotGenerateDialog.spec.js.
  • T07: Add stories[] to the plan prompt in CopilotPromptBuilder, to CopilotPlanValidator (role, goal and servedBy checks) and to the review in CopilotGenerateDialog.vue (REQ-BQCH-006). Verify: tests/Unit/Service/CopilotPlanValidatorTest.php cases for a story without a goal and a servedBy pointing at a menu step; extend tests/e2e/copilot-wizard-generate.spec.ts to assert the "User stories" group.
  • T08: Declare stories on Application in a new fragment lib/Settings/register.d/81-application-stories.json, let buildiq.createApp accept it, and add src/components/applicationDetail/widgets/StoriesWidget.vue to the app detail dashboard (REQ-BQCH-007). Verify: PHPUnit on the register import accepting the property and on CreateAppHandler saving it; vitest tests/components/applicationDetail/StoriesWidget.spec.js.
  • T09: When OpenRegister publishes a text read for a file, accept PDF, Word and OpenDocument in D6 and extend the T06 tests (REQ-BQCH-005). Verify: PHPUnit case reading a .docx through the published read.
  • T10: Strings and docs: English and Dutch for "Ask AI", the dialog, "Add a document", the type and size messages and "User stories" (l10n/en.json, l10n/nl.json), and a page in docs/ on getting AI help in the rule and automation editors and on generating an app from a document.
  • T11: Run openspec validate ai-copilot-documents-and-code-help --strict.

Design

See design.md for technical design details.


Synced from openspec/changes/ai-copilot-documents-and-code-help by OpenSpec workflow
App: buildiq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions