- Add edge runtime config and opsconsole package - Refactor edge console to use new runtime config - Add service source metadata support - Update CLI adapter with target terminology - Add edge operation contract and event bus replay - Update node label and command ops surface - Add E2E smoke tests and full validation - Update proto runtime definitions - Update documentation and agent-ops rules
130 lines
4.5 KiB
Text
130 lines
4.5 KiB
Text
<!-- task=08_cli_target_terminology plan=0 tag=CTT -->
|
|
|
|
# 08 CLI Target Terminology Plan - CTT
|
|
|
|
## 이 파일을 읽는 구현 에이전트에게
|
|
|
|
**필수: 구현 마지막에는 반드시 `CODE_REVIEW-*-G??.md`의 모든 섹션을 실제 구현 내용과 명령 출력으로 채운다.**
|
|
이 task는 CLI adapter 내부의 `agent` 용어를 `target/profile`로 정리한다.
|
|
|
|
## 배경
|
|
|
|
프로젝트 내부 실행 용어는 `adapter + target`이다. 그런데 node CLI adapter 내부에는 `agent` 명칭과 error message가 남아 있어 edge ops console의 “CLI”와 node `cli adapter` 의미도 섞여 보인다.
|
|
|
|
## 분석 결과
|
|
|
|
### 읽은 파일
|
|
|
|
- `agent-ops/skills/common/plan/SKILL.md`
|
|
- `agent-ops/rules/project/domain/node/rules.md`
|
|
- `apps/node/internal/adapters/cli/cli.go`
|
|
- `apps/node/internal/adapters/cli/codex_exec.go`
|
|
- `apps/node/internal/adapters/cli/persistent.go`
|
|
- `apps/node/internal/adapters/cli/opencode_sse.go`
|
|
- `apps/node/internal/adapters/cli/lifecycle_blackbox_test.go`
|
|
- `apps/node/internal/adapters/cli/status/status.go`
|
|
- `apps/node/internal/adapters/cli/status/status_test.go`
|
|
- `apps/node/internal/runtime/types.go`
|
|
|
|
### 테스트 커버리지 공백
|
|
|
|
- Behavior tests는 많지만 error text가 `unknown agent`를 기대하는 곳이 있다.
|
|
- Internal session key naming 자체는 직접 테스트하지 않는다.
|
|
|
|
### 심볼 참조
|
|
|
|
- `sessionKey.agent`: `cli.go:38`, refs in `cli.go`, `codex_exec.go`, `persistent.go`, `opencode_sse.go`.
|
|
- `cliAgentName`: `cli.go:255`, refs `cli.go:170`, `codex_exec.go:48`, `persistent.go:179`, `opencode_sse.go:182`.
|
|
- `StatusChecker(ctx, agent, profile)`: `cli.go:69`, refs `lifecycle_blackbox_test.go:397`.
|
|
- `status.CheckUsage(ctx, agent, profile)`: `status.go:43`.
|
|
|
|
### 범위 결정 근거
|
|
|
|
- Provider payload strings like `agent_message` are external format and excluded.
|
|
- README marketing wording is handled by `09_ops_console_docs`.
|
|
- No behavior change intended.
|
|
|
|
### 빌드 등급
|
|
|
|
- Build `cloud-G07`: many CLI adapter files and blackbox assertions.
|
|
- Review `cloud-G07`: ensure no provider-specific protocol string was renamed.
|
|
|
|
### [CTT-1] CLI adapter internals rename
|
|
|
|
#### 문제
|
|
|
|
`sessionKey.agent` and `cliAgentName` conflict with internal target terminology.
|
|
|
|
#### 해결 방법
|
|
|
|
- Rename `sessionKey.agent` to `target` or `profile`.
|
|
- Rename `cliAgentName` to `cliTargetName` or `profileName`.
|
|
- Update logs/errors to say `target` or `profile`.
|
|
|
|
#### 수정 파일 및 체크리스트
|
|
|
|
- [ ] `apps/node/internal/adapters/cli/cli.go`
|
|
- [ ] `apps/node/internal/adapters/cli/codex_exec.go`
|
|
- [ ] `apps/node/internal/adapters/cli/persistent.go`
|
|
- [ ] `apps/node/internal/adapters/cli/opencode_sse.go`
|
|
|
|
#### 테스트 작성
|
|
|
|
- Existing tests sufficient except string expectations.
|
|
|
|
#### 중간 검증
|
|
|
|
```bash
|
|
go test -count=1 ./apps/node/internal/adapters/cli
|
|
```
|
|
|
|
### [CTT-2] status checker terminology compatibility
|
|
|
|
#### 문제
|
|
|
|
Status package exposes `agent` parameter names and unsupported error text.
|
|
|
|
#### 해결 방법
|
|
|
|
- Rename parameter names to `target`/`profileName`.
|
|
- If exported function signatures remain same type, no compatibility wrapper needed.
|
|
- Update error text and tests.
|
|
|
|
#### 수정 파일 및 체크리스트
|
|
|
|
- [ ] `apps/node/internal/adapters/cli/status/status.go`
|
|
- [ ] `apps/node/internal/adapters/cli/status/status_test.go`
|
|
- [ ] `apps/node/internal/adapters/cli/lifecycle_blackbox_test.go`
|
|
|
|
#### 테스트 작성
|
|
|
|
- Update existing status tests.
|
|
- Keep checker selection behavior by command basename.
|
|
|
|
#### 중간 검증
|
|
|
|
```bash
|
|
go test -count=1 ./apps/node/internal/adapters/cli/status ./apps/node/internal/adapters/cli
|
|
```
|
|
|
|
## 수정 파일 요약
|
|
|
|
| 파일 | 항목 |
|
|
|---|---|
|
|
| `apps/node/internal/adapters/cli/cli.go` | CTT-1 |
|
|
| `apps/node/internal/adapters/cli/codex_exec.go` | CTT-1 |
|
|
| `apps/node/internal/adapters/cli/persistent.go` | CTT-1 |
|
|
| `apps/node/internal/adapters/cli/opencode_sse.go` | CTT-1 |
|
|
| `apps/node/internal/adapters/cli/status/status.go` | CTT-2 |
|
|
| `apps/node/internal/adapters/cli/status/status_test.go` | CTT-2 |
|
|
| `apps/node/internal/adapters/cli/lifecycle_blackbox_test.go` | CTT-2 |
|
|
|
|
## 최종 검증
|
|
|
|
```bash
|
|
rg --sort path -n "unknown agent|for agent|zap.String\\(\"agent\"|sessionKey\\{agent|cliAgentName" apps/node/internal/adapters/cli
|
|
go test -count=1 ./apps/node/internal/adapters/cli ./apps/node/internal/adapters/cli/status
|
|
go test -count=1 ./...
|
|
```
|
|
|
|
모든 코드 변경 완료 후 반드시 `CODE_REVIEW-*-G??.md`의 전체 섹션을 채운다. 이 파일 작성이 구현의 마지막 단계다.
|