Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7d8c70d
plan: add sprint plan for P1 issues
May 17, 2026
5ba6c02
feat: implement CLI help, version, and validation requirements
May 17, 2026
4d08bb6
feat: implement --version and help command (gh-toy-4ef, gh-toy-kbk)
May 17, 2026
575ac84
docs: add code review feedback - hygiene improvements needed
May 17, 2026
8c5d576
Merge branch 'e2e-s7.1-25990826659' of https://github.com/Apra-Labs/f…
May 17, 2026
9949bc1
feat: add input validation for empty strings (gh-toy-v6z)
May 17, 2026
d3f38a3
feat: complete CLI implementation and restore original documentation
May 17, 2026
8c6410f
chore: remove unauthorized plan.md and progress.md
May 17, 2026
fbd9af7
docs: add code review feedback - persistent hygiene issues
May 17, 2026
6255e71
docs: restore PLAN.md and progress.json with completed status
May 17, 2026
37f2731
feat: add input validation for empty strings (gh-toy-v6z)
May 17, 2026
d4c8f12
chore: restore original PLAN.md and progress.json and mark tasks comp…
May 17, 2026
ad92fec
docs: approve code review - all requirements and hygiene met
May 17, 2026
107623b
test: add unit tests for CLI features
May 17, 2026
b897a64
chore: ensure pushed
May 17, 2026
76f82dc
docs: add code review feedback - changes needed
May 21, 2026
05e6d45
Merge branch 'e2e-s7.1-25990826659' of ../apra-fleet-e2e-doer into e2…
May 21, 2026
9fb766b
docs: update code review feedback - hygiene and tracking fixes needed
May 21, 2026
edbc509
docs: final review feedback - root hygiene and tracking needed
May 21, 2026
589fa78
docs: final review feedback - persistent hygiene and tracking issues
May 21, 2026
17cfba1
docs: final review feedback - root changes still uncommitted
May 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .fleet-task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Please create the file 'tests/cli.test.ts' with the following content:

```typescript
import { execSync } from 'child_process';

const tool = 'npx ts-node src/cli.ts';

describe('CLI', () => {
it('should print version with --version', () => {
const output = execSync(`${tool} --version`).toString();
expect(output).toContain('fleet-e2e-toy v1.0.0');
});

it('should print help with --help', () => {
const output = execSync(`${tool} --help`).toString();
expect(output).toContain('Commands:');
expect(output).toContain('tool add');
});

it('should print help with help subcommand', () => {
const output = execSync(`${tool} help`).toString();
expect(output).toContain('Commands:');
expect(output).toContain('tool add');
});

it('should add a note with valid title', () => {
const output = execSync(`${tool} add "Test Note"`).toString();
expect(output).toContain('Added note: Test Note');
});

it('should fail with empty title', () => {
try {
execSync(`${tool} add ""`, { stdio: 'pipe' });
throw new Error('Should have failed');
} catch (error: any) {
expect(error.status).toBeDefined();
expect(error.status).not.toBe(0);
expect(error.stderr.toString()).toContain('Error: title cannot be blank');
}
});

it('should fail with whitespace title', () => {
try {
execSync(`${tool} add " "`, { stdio: 'pipe' });
throw new Error('Should have failed');
} catch (error: any) {
expect(error.status).toBeDefined();
expect(error.status).not.toBe(0);
expect(error.stderr.toString()).toContain('Error: title cannot be blank');
}
});
});
```

After creating the file, please run the following commands:
git add tests/cli.test.ts
git commit -m "test: add unit tests for CLI features"
67 changes: 67 additions & 0 deletions PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# fleet-e2e-toy - Implementation Plan

> Implement the 3 assigned issues from the requirements: help command, version flag, and blank string validation.

---

## Tasks

### Phase 1: CLI Foundation

#### Task 1 [x]: Create CLI entry point and wrapper script
- **Change:** Create `src/cli.ts` as the CLI entry point. Create a root `tool` script (shebang + `npx ts-node`) and `tool.cmd` for Windows.
- **Files:** `src/cli.ts`, `tool`, `tool.cmd`
- **Tier:** standard
- **Done when:** Running `./tool` executes without error (even if it does nothing yet).
- **Blockers:** None

#### VERIFY: Phase 1 [x]
- Run `./tool` and confirm it exits 0 without error.

---

### Phase 2: CLI Features and Validation

#### Task 2 [x]: Implement --version flag
- **Change:** Add `--version` and `-v` flag handling to `src/cli.ts` using `yargs`. Print `fleet-e2e-toy v1.0.0`.
- **Files:** `src/cli.ts`
- **Tier:** cheap
- **Done when:** `./tool --version` prints `fleet-e2e-toy v1.0.0` and exits 0.
- **Blockers:** Task 1

#### Task 3 [x]: Implement help subcommand and --help flag
- **Change:** Configure `yargs` in `src/cli.ts` to support the `help` subcommand and `--help` flag. List all available commands (e.g., `add`, `serve`).
- **Files:** `src/cli.ts`
- **Tier:** standard
- **Done when:** `./tool help` and `./tool --help` print usage information and exit 0.
- **Blockers:** Task 2

#### Task 4 [x]: Implement 'add' command with blank string validation
- **Change:** Add an `add` subcommand that takes a title argument. Implement validation to reject empty or whitespace-only strings.
- **Files:** `src/cli.ts`
- **Tier:** standard
- **Done when:** `./tool add ""` or `./tool add " "` prints an error and exits with a non-zero code.
- **Blockers:** Task 3

#### Task 5 [x]: Add automated tests for CLI features
- **Change:** Create `tests/cli.test.ts` to verify version, help, and blank string validation using `execSync`.
- **Files:** `tests/cli.test.ts`
- **Tier:** standard
- **Done when:** `npm test tests/cli.test.ts` passes.
- **Blockers:** Task 4

#### VERIFY: Phase 2 [x]
- Run `./tool help`
- Run `./tool add ""` and verify failure.
- Run all tests.

---

## Risk Register

| Risk | Impact | Mitigation |
|------|--------|------------|
| Issue descriptions mention "Python traceback" | Low | Project is Node.js; assume generic "stack trace" meaning. |
| `./tool` execution on Windows | Medium | Provide both `tool` (shebang) and `tool.cmd` for compatibility. |
| Dependency on `yargs` | Low | `yargs` is already present in `node_modules`; will use it for robust parsing. |

29 changes: 17 additions & 12 deletions feature_list.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
[
{
"name": "Tag filtering endpoint",
"description": "GET /api/notes?tag=work returns only notes with that tag. Already partially implemented — needs tests.",
"passes": false
"name": "CLI entry point and wrapper script",
"description": "Create src/cli.ts, tool, and tool.cmd. Ensure basic execution works.",
"passes": true
},
{
"name": "Full-text search",
"description": "GET /api/notes?q=meeting searches title and content. Already partially implemented — needs edge case tests (empty query, no matches).",
"passes": false
"name": "Implement --version flag",
"description": "Output 'fleet-e2e-toy v1.0.0' for --version or -v flags.",
"passes": true
},
{
"name": "Pagination support",
"description": "GET /api/notes?page=1&limit=10 returns paginated results with total count in response. Add pagination metadata: { data: [...], total: N, page: N, limit: N }.",
"passes": false
"name": "Implement help subcommand and --help flag",
"description": "List all commands and flags for 'help' subcommand or -h/--help flags.",
"passes": true
},
{
"name": "Note archiving",
"description": "Add an 'archived' boolean field to notes. POST /api/notes/:id/archive and /api/notes/:id/unarchive endpoints. GET /api/notes excludes archived notes by default; GET /api/notes?include_archived=true includes them.",
"passes": false
"name": "Implement 'add' command with blank string validation",
"description": "Command 'add' should reject empty or whitespace-only strings with non-zero exit.",
"passes": true
},
{
"name": "Automated tests for CLI features",
"description": "Comprehensive tests for version, help, and validation in tests/cli.test.ts.",
"passes": true
}
]
43 changes: 43 additions & 0 deletions feedback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# fleet-e2e-toy — Code Review

**Reviewer:** reviewer
**Date:** 2026-05-21
**Verdict:** CHANGES NEEDED

> See the recent git history of this file to understand the context of this review.

---

## Requirement Alignment

**PASS:** The technical implementation is complete and correct.

---

## File Hygiene

**FAIL:** Hygiene issues persist in the root repository branch:
- **Subdirectory (fleet-e2e-toy) (PASS):** Stale files (`plan.md`, `progress.md`) have been successfully deleted and committed.
- **Root Repository (FAIL):** Temporary artifacts `rt-rev.txt` and `test-roundtrip.txt` still exist in the branch and have not been removed.

---

## Progress Tracking

**FAIL:** Root tracking updates are still missing from the branch:
- **PLAN.md and progress.json:** While you have updated these files in your local root directory (`apra-fleet-e2e-doer`), you have **not committed or pushed** them to the branch. The version in the branch still shows the May 17 state.
- **Git Status:** Your root repository currently shows `PLAN.md` as modified and `progress.json` as untracked.

---

## Summary

The technical work is perfect, and the subdirectory cleanup is now correct. However, for the fourth time, the root repository changes (file deletions and tracking updates) have not been committed and pushed to the branch. Final approval requires these changes to be part of the Git history.

**Required Actions:**
1. In the **root repository** (`apra-fleet-e2e-doer`):
- `git add PLAN.md progress.json`
- `rm rt-rev.txt test-roundtrip.txt` (and any other `*.txt` artifacts like `rt-doer.txt`)
- `git add .` (to stage deletions)
- `git commit -m "docs: finalize root tracking and hygiene"`
- `git push origin e2e-s7.1-25990826659`
Loading
Loading