feat: add iam and pct mock tools
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 6m30s
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 6m30s
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
# dap-was-sys Executable Mock Tools Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** Expose the two existing system mock definitions as executable MCP tools and REST endpoints.
|
||||
|
||||
**Architecture:** Request DTOs enter `@McpTool` UseCase interfaces and REST controller methods. Spring services return deterministic response DTOs, with no external dependencies. The controller delegates to the UseCases so both interfaces share behavior.
|
||||
|
||||
**Tech Stack:** Spring Boot, Spring AI Community MCP annotations, Lombok, JUnit 5, MockMvc.
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- Tools are read-only, non-destructive, idempotent, and synthetic-only.
|
||||
- Endpoints are `GET /api/sys/status` and `GET /api/sys/notices`.
|
||||
- Keep existing YAML and JSON mock resources aligned with response DTO fields.
|
||||
|
||||
---
|
||||
|
||||
### Task 1: Executable system-status tool
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `dap-was-sys/src/main/java/io/shinhanlife/dap/mcc/sys/status/dto/SystemStatusRequest.java`
|
||||
- Create: `dap-was-sys/src/main/java/io/shinhanlife/dap/mcc/sys/status/dto/SystemStatusResponse.java`
|
||||
- Create: `dap-was-sys/src/main/java/io/shinhanlife/dap/mcc/sys/status/usecase/SystemStatusUseCase.java`
|
||||
- Create: `dap-was-sys/src/main/java/io/shinhanlife/dap/mcc/sys/status/usecase/impl/SystemStatusUseCaseImpl.java`
|
||||
- Test: `dap-was-sys/src/test/java/io/shinhanlife/dap/mcc/sys/status/usecase/impl/SystemStatusUseCaseImplTest.java`
|
||||
|
||||
- [ ] Write a test expecting default `development`, `AX Hub System`, `HEALTHY`, and a nonblank ISO timestamp; run it and observe compilation failure because the types do not exist.
|
||||
- [ ] Implement request/response DTOs, MCP-annotated `getSystemStatus(SystemStatusRequest)`, and the service returning those literal mock values; rerun the focused test and expect pass.
|
||||
|
||||
### Task 2: Executable notice-list tool
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `dap-was-sys/src/main/java/io/shinhanlife/dap/mcc/sys/notice/dto/SystemNoticeRequest.java`
|
||||
- Create: `dap-was-sys/src/main/java/io/shinhanlife/dap/mcc/sys/notice/dto/SystemNoticeResponse.java`
|
||||
- Create: `dap-was-sys/src/main/java/io/shinhanlife/dap/mcc/sys/notice/usecase/SystemNoticeUseCase.java`
|
||||
- Create: `dap-was-sys/src/main/java/io/shinhanlife/dap/mcc/sys/notice/usecase/impl/SystemNoticeUseCaseImpl.java`
|
||||
- Test: `dap-was-sys/src/test/java/io/shinhanlife/dap/mcc/sys/notice/usecase/impl/SystemNoticeUseCaseImplTest.java`
|
||||
|
||||
- [ ] Write a test expecting at least two notices with title, priority, and published date; run it and observe compilation failure because the types do not exist.
|
||||
- [ ] Implement the DTOs, MCP-annotated `getSystemNotices(SystemNoticeRequest)`, and service returning deterministic notices; rerun the focused test and expect pass.
|
||||
|
||||
### Task 3: REST adapter
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `dap-was-sys/src/main/java/io/shinhanlife/dap/mcc/sys/presentation/SystemMockToolController.java`
|
||||
- Test: `dap-was-sys/src/test/java/io/shinhanlife/dap/mcc/sys/presentation/SystemMockToolControllerTest.java`
|
||||
|
||||
- [ ] Write MockMvc tests for both GET endpoints using optional query parameters and asserting response fields; run and observe compilation failure because the controller does not exist.
|
||||
- [ ] Implement a controller that constructs request DTOs, delegates to the UseCases, and returns response DTOs; run `./gradlew.bat :dap-was-sys:test` and expect pass.
|
||||
|
||||
## Plan Self-Review
|
||||
|
||||
- The plan covers executable MCP registration, response DTOs, REST access, and tests for both tool contracts.
|
||||
- Each runtime response remains synthetic and read-only.
|
||||
56
docs/superpowers/plans/2026-08-13-dap-was-sys-mock-tools.md
Normal file
56
docs/superpowers/plans/2026-08-13-dap-was-sys-mock-tools.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# dap-was-sys Mock Tools Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** Add two read-only system mock tools to `dap-was-sys`, with MCP YAML definitions and deterministic mock JSON responses.
|
||||
|
||||
**Architecture:** YAML definitions under `tool-definitions/sys` describe the tools. Their paired `mock-responses` files provide synthetic data. A resource-based JUnit test verifies the tool names, immutable safety flags, and valid response shape.
|
||||
|
||||
**Tech Stack:** Spring Boot 3, JUnit 5, Jackson, YAML.
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- Create tool resources only in `dap-was-sys`.
|
||||
- Both tools must be `read_only: true`, `destructive: false`, and `idempotent: true`.
|
||||
- Do not include personal, customer, credential, or secret data.
|
||||
- Follow the field layout in `dap-was-cus/src/main/resources/tool-definitions/smp/smp_team_list.yml`.
|
||||
|
||||
---
|
||||
|
||||
### Task 1: System status mock tool
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `dap-was-sys/src/main/resources/tool-definitions/sys/sys_system_status.yml`
|
||||
- Create: `dap-was-sys/src/main/resources/mock-responses/sys_system_status.json`
|
||||
- Create: `dap-was-sys/src/test/java/io/shinhanlife/dap/mcc/sys/SystemMockToolResourcesTest.java`
|
||||
|
||||
**Interfaces:** Accepts optional `environment: string`; returns mock `systemName`, `environment`, `status`, and `checkedAt` values.
|
||||
|
||||
- [ ] Write a JUnit test that loads the two classpath resources; asserts tool name `sys_system_status`, `read_only: true`, `destructive: false`, optional `environment`, `resultCode` `SUCCESS`, and all four response fields.
|
||||
- [ ] Run `./gradlew.bat :dap-was-sys:test --tests io.shinhanlife.dap.mcc.sys.SystemMockToolResourcesTest.systemStatusDefinitionIsReadOnlyAndHasValidMockResponse`; expect failure because both resources are absent.
|
||||
- [ ] Create the definition with `category_key: sys`, no required environment keys, `additionalProperties: false`, and read-only safety fields. Create a `SUCCESS` mock JSON response whose stringified `data` contains only synthetic status data.
|
||||
- [ ] Re-run the focused test; expect pass.
|
||||
- [ ] Commit the task: `git add dap-was-sys/src/main/resources/tool-definitions/sys/sys_system_status.yml dap-was-sys/src/main/resources/mock-responses/sys_system_status.json dap-was-sys/src/test/java/io/shinhanlife/dap/mcc/sys/SystemMockToolResourcesTest.java && git commit -m "feat: add system status mock tool"`.
|
||||
|
||||
### Task 2: System notices mock tool
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `dap-was-sys/src/main/resources/tool-definitions/sys/sys_notice_list.yml`
|
||||
- Create: `dap-was-sys/src/main/resources/mock-responses/sys_notice_list.json`
|
||||
- Modify: `dap-was-sys/src/test/java/io/shinhanlife/dap/mcc/sys/SystemMockToolResourcesTest.java`
|
||||
|
||||
**Interfaces:** Accepts optional `category: string`; returns a mock array containing notices with `title`, `priority`, and `publishedDate`.
|
||||
|
||||
- [ ] Add a JUnit test that loads both resources; asserts tool name `sys_notice_list`, `read_only: true`, `destructive: false`, optional `category`, `resultCode` `SUCCESS`, and at least one mock notice with all three fields.
|
||||
- [ ] Run `./gradlew.bat :dap-was-sys:test --tests io.shinhanlife.dap.mcc.sys.SystemMockToolResourcesTest.noticeListDefinitionIsReadOnlyAndHasValidMockResponse`; expect failure because both resources are absent.
|
||||
- [ ] Create the definition with `category_key: sys`, no required environment keys, `additionalProperties: false`, and read-only safety fields. Create a `SUCCESS` mock JSON response containing only synthetic system notices.
|
||||
- [ ] Run `./gradlew.bat :dap-was-sys:test`; expect pass.
|
||||
- [ ] Commit the task: `git add dap-was-sys/src/main/resources/tool-definitions/sys/sys_notice_list.yml dap-was-sys/src/main/resources/mock-responses/sys_notice_list.json dap-was-sys/src/test/java/io/shinhanlife/dap/mcc/sys/SystemMockToolResourcesTest.java && git commit -m "feat: add system notice mock tool"`.
|
||||
|
||||
## Plan Self-Review
|
||||
|
||||
- Spec coverage: Tasks 1 and 2 each add a tool definition and a paired mock response; both enforce read-only behavior. Tests validate resource availability and structure.
|
||||
- Placeholder scan: No incomplete tasks or unspecified file paths remain.
|
||||
- Type consistency: Both responses use `resultCode` plus stringified JSON `data`, matching the existing mock-response convention.
|
||||
Reference in New Issue
Block a user