# v0.3.2-alpha.3 Clean Short Request Review

## Goal

Verify the current local package candidate after `feat(workflow): add conditional backend bootstrap` in a clean external-style Java/Spring backend project.

The specific question was whether a short OpenCode request:

```text
README.md 보고 구현해줘
```

causes the agent to enter the Persona Harness workflow rail by using `ph bootstrap backend` or `ph workflow implement`.

## Candidate Under Review

- Repo: `/Users/yongtae/Desktop/persona-harness`
- HEAD: `2cff9d2 feat(workflow): add conditional backend bootstrap`
- Package version in `package.json`: `0.3.2-alpha.2`
- Review target: local tarball from current HEAD, treated as the `0.3.2-alpha.3` candidate code
- OpenCode: `1.17.7`
- Model: `openai/gpt-5.4-mini-fast`

## Clean Project Setup

Run root:

```text
/Users/yongtae/Desktop/persona-clean-short-request-20260623-105926
```

Two scenarios were prepared:

1. `no-persona`
   - package installed
   - no `.persona/`
   - no OpenCode plugin config
2. `persona-missing-profile`
   - package installed
   - `.opencode/opencode.json` points to installed Persona Harness plugin
   - `.persona/harness.jsonc` and `.persona/rules` exist
   - `.persona/project-profile.jsonc`, `.persona/policies`, `.persona/workflow`, and `.persona/evidence` were removed before the run

README fixture:

- Equipment Rental API
- Java/Spring Boot Gradle backend
- equipment registration/listing
- member registration
- equipment rental/return
- unavailable/insufficient quantity failure
- borrower-only return
- layered backend architecture expectations

## CLI Baseline

Before OpenCode:

| Scenario | Command | Result |
| --- | --- | --- |
| `no-persona` | `npx ph workflow implement` | PASS/advisory, implementation not blocked |
| `persona-missing-profile` | `npx ph workflow implement` | FAIL with `npx ph bootstrap backend` fast path |

This matches the intended conditional gate:

- No `.persona/`: do not force Persona Harness.
- `.persona/` exists but profile/plan is missing: require bootstrap/intake before implementation.

## OpenCode Run

Command:

```bash
opencode run \
  --dir /Users/yongtae/Desktop/persona-clean-short-request-20260623-105926/persona-missing-profile \
  --model openai/gpt-5.4-mini-fast \
  --dangerously-skip-permissions \
  "README.md 보고 구현해줘"
```

Observed sequence:

1. OpenCode read `README.md`.
2. OpenCode ran `npx ph workflow implement`.
3. The command failed because profile/plan/report artifacts were missing.
4. OpenCode interpreted the failure correctly and ran `npx ph bootstrap backend`.
5. Bootstrap created:
   - `.persona/project-profile.jsonc`
   - `.persona/policies/overlay.jsonc`
   - `.persona/workflow/plan.md`
   - `.persona/workflow/implementation-report.md`
   - `.persona/workflow/review-report.md`
6. OpenCode implemented a Spring Boot Gradle app.
7. OpenCode ran Gradle test/build and HTTP smoke.
8. OpenCode filled implementation/review reports.
9. `npx ph workflow finish implement` eventually passed.

## Generated Structure

Main generated files followed the expected shape:

```text
src/main/java/com/example/equipmentrental
├── EquipmentRentalApplication.java
├── equipment
│   ├── application
│   ├── domain
│   ├── infrastructure
│   └── presentation
├── global
│   └── exception
├── member
│   ├── application
│   ├── domain
│   ├── infrastructure
│   └── presentation
└── rental
    ├── application
    ├── domain
    ├── infrastructure
    └── presentation
```

Notable generated code properties:

- Gradle only: `build.gradle`, `settings.gradle`, `gradlew`, `gradlew.bat`; no `pom.xml`.
- Repository ports exist in domain packages:
  - `EquipmentRepository`
  - `MemberRepository`
  - `LoanRepository`
- Repository adapters exist in infrastructure packages:
  - `JdbcEquipmentRepository`
  - `JdbcMemberRepository`
  - `JdbcLoanRepository`
- Application services depend on domain repository ports.
- Services do not directly own `Map`, `AtomicLong`, `nextId`, or `idCounter`.
- Domain models are classes with behavior, not records:
  - `Equipment.canLoan()`
  - `Equipment.loanOne()`
  - `Equipment.returnOne()`
  - `Loan.isOwnedBy(...)`
  - `Loan.markReturned(...)`
- Request/response DTOs are separated from domain classes.

## Verification

OpenCode run:

- `./gradlew test`: PASS
- `./gradlew build`: PASS
- HTTP smoke:
  - create equipment: PASS
  - create member: PASS
  - create loan: PASS
  - duplicate loan conflict: `409`
  - return loan: PASS

Independent recheck after OpenCode:

```bash
npx ph bearshell --shell './gradlew test build'
```

Result:

- PASS
- `BUILD SUCCESSFUL`

Independent HTTP smoke through `ph bearshell`:

```bash
npx ph bearshell --shell '<bootRun on port 18081 plus curl happy/conflict smoke>'
```

Result:

- create equipment: JSON response with `id=1`
- create member: JSON response with `id=1`
- create loan: JSON response with `returned=false`
- duplicate loan: `409`

Backend shape report:

```bash
npx ph review backend-shape
```

Result:

- `Gradle only`: PASS
- `Layer/package structure`: PASS
- `Domain repository port`: PASS
- `Infrastructure repository adapter`: PASS
- `Service storage/id sequence ownership`: PASS
- `Domain behavior`: PASS
- `DTO boundary`: PASS
- `bootJar`: PASS
- `Verification report`: PASS

Workflow check:

```bash
npx ph workflow check
```

Result:

- `Workflow status: PASS`
- plan accepted
- implementation report filled
- review report filled
- evidence present
- README read coverage observed
- bearshell command discipline observed by report

## Evidence

Raw evidence files were generated:

```text
.persona/evidence/phase0
```

Count:

```text
13
```

Observed target roles include:

- `README.md`
- `RentalController.java`
- `ReturnLoanRequest.java`
- `EquipmentRentalApiTest.java`
- `JdbcMemberRepository.java`

Representative evidence confirms Java role injection:

- `RentalController.java` received controller rules.
- `JdbcMemberRepository.java` received repository-related rules.
- shared `programming` skill was selected for Java targets.

## Decision

This is a positive `0.3.2-alpha.3` candidate signal for the narrow goal:

```text
Short request -> ph workflow implement -> ph bootstrap backend -> implementation rail
```

The bootstrap/profile gate behavior worked in a clean external-style project, and the generated Java/Spring backend shape was materially aligned with the current backend Clean Code target.

## Known Gaps

This run is not a full product-quality proof.

Gaps observed:

1. OpenCode directly read `.persona/rules` early in the run.
   - This violates the preferred guidance to use the injection summary and workflow artifacts instead of direct rule reads.
   - It did not break the run, but it is still workflow noise.
2. OpenCode initially used raw shell for Gradle and HTTP smoke.
   - `ph workflow finish implement` caught the raw shell issue.
   - The agent then re-ran part of the verification through `ph bearshell` and edited reports.
   - The gate can still be satisfied by report text, so future hardening should reduce report-only self-attestation risk.
3. The `no-persona` scenario was verified only at CLI level.
   - This is expected because without `.opencode/opencode.json`, the plugin is not active.
   - The behavior remains correct: no `.persona/` means Persona Harness does not force implementation gates.
4. Package version was not bumped during this review.
   - Current `package.json` remains `0.3.2-alpha.2`.
   - Publishing `0.3.2-alpha.3` still requires an explicit version bump and publish step.

## Next

Recommended next step:

1. Bump package version to `0.3.2-alpha.3`.
2. Update release notes/changelog with:
   - conditional `.persona` gate
   - `ph bootstrap backend`
   - clean short-request verification result
   - known gaps around direct rule reads and report self-attestation
3. Publish with `npm publish --tag alpha` when ready.

