Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,15 @@ node ~/sdlc-kit/todo/todo.mjs take <id> --json # 작업자가 맡은 항목

TUI와 웹 페이지는 영어나 한국어로 표시합니다. `--lang ko`(TUI 또는 `web`)를 주거나 `SDLC_TODO_LANG=ko`를 지정하세요. 플래그가 우선하고, 모르는 값이면 영어, 기본값도 영어입니다.
TUI에서는 `L`, 웹 페이지에서는 언어 메뉴로 바꾸며 다시 시작하거나 새로 고칠 때까지 유지됩니다.
상태는 다음에 누가 움직일지 보여 줍니다. 내 차례(범위 승인·계획 승인·답변), 에이전트 진행 중, 답변 전달됨 — 에이전트 수신 전, 시작 전, 막힘 — 조치 필요, 완료이며, 에이전트가 멈추는 행에는 그 사실을 적습니다.
상태는 다음에 누가 움직일지 보여 줍니다. 내 차례(범위 승인·계획 승인·답변), 지금 작업 중(에이전트가 3분 안에 `working`으로 표시한 항목, 몇 분째·무슨 일인지 함께 보임), 에이전트 차례(아직 아무도 잡지 않음), 답변 전달됨 — 에이전트 수신 전, 시작 전, 막힘 — 조치 필요, 완료이며, 에이전트가 멈추는 행에는 그 사실을 적습니다.
항목에는 마크다운 브리프를 붙일 수 있습니다(`brief <id> <절대 경로>` 또는 `add --brief PATH`, ` - brief: <경로>`로 저장). 앱과 페이지는 이를 sdlc 작업 문서처럼(At a glance, Questions for you, 전체 문서는 접음) 보여 주며 승인 버튼은 없습니다. 브리프는 앱이 읽는 하나뿐인 형식인 `todo/brief.md`(Your call, What changes, AI pick, Phase, Background, Why)로 쓰고, 채울 수 없는 줄은 뺍니다.
항목에는 변경이 들어간 저장소도 적을 수 있습니다(`repos <id> aidt-lms-api,aidt-viewer-api`, ` - repos: aidt-lms-api, aidt-viewer-api`로 저장, 이름 없이 실행하면 지움). 앱 카드, 페이지 목록·상세, TUI 목록·상세에 항상 보입니다.
결정에는 한 번에 고르는 답을 붙일 수 있습니다(`choices <id> "진행 | 먼저 고침 | 보류" [--pick N]`, ` - choices: 진행 | 먼저 고침 | 보류`와 ` - pick: N`으로 저장, 최대 6개, 답 없이 실행하면 지움). 열린 항목이면 앱 카드, 페이지 상세(답변 칸 위), TUI(숫자 키)에 답마다 버튼이 생기고, 누르면 그 답 글자 그대로 보통 답변으로 보냅니다. `--pick`으로 고른 답은 맨 앞에 "권장"으로 표시합니다. 같은 티켓 링크를 가진, 내가 볼 열린 항목은 앱과 페이지에서 그 티켓 아래에 모아 보입니다.

에이전트는 권장 답을 미리 채워 둘 수도 있습니다(`suggest <id> "답"`, ` - suggest: 답`으로 저장, 내 답변이나 빈 값이 지움). 앱 카드, 페이지 답변 칸, TUI 답변 줄(`r`)이 그 글자로 시작하므로 그대로 보내면 한 번에 끝납니다. 고친 답은 덮어쓰지 않고, 새 권장 답은 고치지 않은 칸만 바꿉니다. 앱 카드의 '에이전트가 묻고 있어요' 칸에는 요약의 Your call과 AI pick만 보이고(요약에 질문이 없을 때만 대기 문구), What changes는 그 아래 흐린 한 줄로 보입니다.

지금 항목을 작업 중인 에이전트는 `todo.mjs working <id> ["단계"]`(예: `build`, `dev QA`)로 표시하고 적어도 60초마다 다시 부르며, 끝나면 `working <id> --off`로 지웁니다. 표시는 `todo.md`가 아닌 할 일 파일 옆 `todo-working.json`(소유자만 읽기)에 남고, 마지막 갱신 뒤 3분이 지나면 저절로 사라지므로 죽은 작업자의 표시는 남지 않습니다. 모든 화면에 "지금 작업 중 · 12분째 · build"와 깜박이는 초록 점으로 보이고, 아무 에이전트도 표시하지 않은 열린 항목은 "에이전트 차례"로 보입니다. `list --json`과 웹 API에는 `working: {what, since, beat}` 또는 `null`로 실립니다.

사람이 직접 실행해야 하는 명령(OTP를 묻는 VPN 연결 등)은 에이전트가 `run <id> "명령"`으로 남깁니다(` - run: 명령`, 내 답변·`resume`·`done`·빈 값이 지움). 앱 카드에는 명령과 **터미널에서 열기** 버튼이 보입니다. macOS의 zsh에서는 명령이 입력만 된 채로 Terminal이 열리므로, 확인하고 Enter를 누르면 됩니다. 다른 환경에서는 버튼이 명령을 복사합니다. 페이지와 TUI 상세에도 명령이 보입니다.
단 답은 에이전트가 `next`나 `take`로 읽기 전까지 "답변 전달됨 — 에이전트 수신 전"으로 보이고, sdlc 대기였다면 읽은 뒤 sdlc.sh가 다음 단계로 넘어갈 때까지 다시 내 차례로 돌아옵니다. sdlc 밖에서 사람을 기다리는 작업자(승인, 티켓 답변 등)는 `wait`로 남기고 `resume`으로 지웁니다. 다른 사람(QA·기획)이 먼저 답해야 하면 `others <id> "누구"`로 "다른 사람 회신 대기"를 표시합니다. 이 항목은 확인 필요에서 빠지고 `next`가 건너뛰며(`take`는 exit 15), 내 답글·`wait`·`resume`이 지웁니다.
모든 화면은 서버 하나를 같이 씁니다. 처음 띄운 쪽이 포트와 토큰을 to-do 파일 옆 `todo-web.json`(소유자만 읽기)에 남기고, 뒤에 띄운 화면·앱·`todo.mjs serve`는 그 서버가 응답하는 동안 다시 씁니다.
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,15 @@ node ~/sdlc-kit/todo/todo.mjs take <id> --json # one item a worker owns, with

The TUI and web page show English or Korean: pass `--lang ko` (TUI or `web`) or set `SDLC_TODO_LANG=ko`; the flag wins, an unknown variable means English, and English is the default.
Press `L` in the TUI or use the page's language menu to switch until restart or reload.
Statuses say who acts next: your turn (approve intent, approve plan or answer), agent working, answered — not picked up yet, not started, blocked — fix needed, or done; the row where agents stop says so.
Statuses say who acts next: your turn (approve intent, approve plan or answer), working now (an agent marked it with `working` within the last 3 minutes; it shows how long and on what), agent's turn (nobody is on it yet), answered — not picked up yet, not started, blocked — fix needed, or done; the row where agents stop says so.
An item may carry a markdown brief (`brief <id> <absolute path>` or `add --brief PATH`, stored as ` - brief: <path>`); the app and page show it like an sdlc work document (At a glance, Questions for you, full text folded) without approval. Write it from `todo/brief.md`, the one format the app reads (Your call, What changes, AI pick, Phase, Background, Why); leave out a line you cannot fill.
An item may also name the repositories its change touches (`repos <id> aidt-lms-api,aidt-viewer-api`, stored as ` - repos: aidt-lms-api, aidt-viewer-api`; no name clears it). The app card, the page row and detail, and the TUI row and detail always show them.
A decision can offer one-click answers (`choices <id> "proceed | fix first | hold" [--pick N]`, stored as ` - choices: proceed | fix first | hold` and ` - pick: N`; up to 6 labels, no labels clears them). On an open item the app card, the page detail (above the reply box) and the TUI (number keys) show one button per label; a click sends that exact label as an ordinary reply, and the picked one comes first, marked Recommended. Open items that need you and share a ticket link sit together under that ticket in the app and page.

An agent can also prefill the answer it recommends (`suggest <id> "answer"`, stored as ` - suggest: answer`; a human reply or no text clears it). The app card, the page reply box and the TUI reply line (`r`) start with that text, so sending it as-is takes one press; an edit is never overwritten, and a new suggestion replaces only an unedited one. On the app card the "agent is asking" box shows only the brief's Your call and AI pick (the waiting line only when the brief asks nothing), with What changes as one muted line below it.

An agent working on an item right now marks it with `todo.mjs working <id> ["step"]` (e.g. `build`, `dev QA`), repeats it at least every 60 s, and clears it with `working <id> --off`. The mark lives in `todo-working.json` beside the to-do file (owner-only), never in `todo.md`, and expires 3 minutes after its last refresh, so the mark of a worker that died disappears by itself. Every view shows it as "Working now · 12 min · build" with a pulsing green dot; an open item no agent has marked reads "Agent's turn". `list --json` and the web API carry it as `working: {what, since, beat}` or `null`.

When the human has to run something (a VPN login that asks for an OTP, say), the agent records it with `run <id> "command"` (` - run: command`; a reply, `resume`, `done` or no text clears it). The app card shows the command and an **Open in Terminal** button: on macOS with zsh, Terminal opens with the command typed at the prompt but not run, so you read it and press Enter; elsewhere the button copies it. The page and TUI details show the command.
A reply shows "answered — no agent has picked it up yet" until an agent reads it with `next` or `take`; after an sdlc wait the item then waits for you again until sdlc.sh moves on. A worker that waits on you outside sdlc (an approval, a ticket answer) records it with `wait` and drops it with `resume`. When someone else must answer first (QA, a planner), `others <id> "who"` marks it "waiting on someone else": it leaves Needs you, `next` passes it by (`take` exits 15), and a reply, `wait` or `resume` clears it.
All surfaces share one server: the first launch writes its port and token to `todo-web.json` beside the to-do file (owner-only), and later launches, the app and `todo.mjs serve` reuse it while it answers.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.25.1
2.26.0
21 changes: 21 additions & 0 deletions log/changelog-v2.26.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# v2.26.0: The to-do shows which items an agent is working on right now

## Problem

Every open item whose next step was an agent's read "Agent working" (`status.agent`), whether or not any agent held it. On 2026-11-12, 26 items read "Agent working" while no agent ran, so the human could not tell real work from a queue.

## Changes

- **`todo.mjs working <id> ["what"]`** marks an item as worked on now, or refreshes the mark: `beat` becomes now, `since` stays while the mark is live (else now), and `what` is a one-line label such as `build` or `dev QA` (80 characters at most; omitted keeps the previous one). `working <id> --off` clears it. An unknown id exits 1, a done item exits 1 unless `--off`. It runs no sdlc sync and never writes `todo.md`, so a heartbeat can call it every 60 s.
- **`todo-working.json`** beside `todo.md` (follows `SDLC_TODO`) holds `{ id: { what, since, beat } }` in ISO times, written atomically with mode 0600; expired marks are pruned on each write. A mark is live while its `beat` is younger than 180 s (`core.WORKING_TTL_MS`; `SDLC_TODO_WORKING_TTL` in seconds overrides it for tests). An expired mark is ignored everywhere, so the mark of a worker that died disappears by itself. Two writers at the same moment can lose one update; the next beat restores it.
- **New status `working`** (`statusOf` → `{ actor: 'agent', kind: 'working' }`): "Working now" / "지금 작업 중", shown with elapsed minutes and the label, e.g. "지금 작업 중 · 12분째 · build". Blocked, waiting for you and waiting on someone else still win over a live mark: a turn that is yours or someone else's is never hidden by a heartbeat. The header counts are unchanged (it is still an agent's turn).
- **"Agent working" is now "Agent's turn"** / "에이전트 차례": an open item an agent should take next but nobody has marked.
- **Item JSON** (`list --json`, `next`/`take --json`, `/api/items`, `/events`) carries `working: { what, since, beat }` or `null` (null when the item is done or the mark expired).
- **Every surface tells it apart:** the app gives it its own green tint, a halo around the row dot and a pulsing dot in its pill, repainting once a second only while an item is working; the web page shows a green pill with a CSS-pulsing dot and a green row bar; the TUI marks it `◉` in bold green with a "Working now · 12 min · build" line under the row (legend updated).
- **The app says it above the tabs:** a line under the title reads "N건 지금 작업 중 — <first item> — 지금 작업 중 · 6분째 · build" (click opens 진행 중), or a muted "지금 작업 중인 에이전트 없음". Working rows lead their tab and carry the label pill on the row itself, not only on hover. The empty Needs-you text no longer claims agents keep working.
- **Expiry without a write:** the server and the TUI watch `todo-working.json` and also arm a timer for the oldest live mark's expiry (`core.watchWorking`), so a mark nobody refreshes leaves every view within the TTL (plus 50 ms), with no file change.
- **Agents:** `todo/AGENT.md` asks to run `working <id> "<step>"` at least every 60 s while working an item and `working <id> --off` when they stop; README and CLI help describe the command.

## After updating

Rebuild the app: run `todo/app/install-macos.sh` again (macOS), or `cargo build --release` in `todo/app`. Restart a running to-do server (`serve`) so it watches the new file.
2 changes: 1 addition & 1 deletion tests/todo-page.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ test('language: the page follows the server language, switches at runtime and ke
assert.match(texts('aaaaaa'), /Approve plan/);
assert.match(line('aaaaaa'), /Agents stop here until you decide/);
assert.match(line('aaaaaa'), /Approve…/);
assert.match(texts('bbbbbb'), /Agent working/);
assert.match(texts('bbbbbb'), /Agent's turn/);
assert.match(texts('bbbbbb'), /Queued behind your decision/);
assert.equal(p.nodes.get('detail-fields').children[0].textContent, 'Status', 'open Details re-renders');
assert.equal(p.nodes.get('live-text').textContent, 'Connecting');
Expand Down
23 changes: 23 additions & 0 deletions tests/todo-web.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,29 @@ function eventStream(ctx, t) {
};
}

test('working: SSE shows a marker at once and drops it when its heartbeat expires, with no further write', async t => {
const ttl = process.env.SDLC_TODO_WORKING_TTL;
process.env.SDLC_TODO_WORKING_TTL = '1';
t.after(() => { if (ttl === undefined) delete process.env.SDLC_TODO_WORKING_TTL; else process.env.SDLC_TODO_WORKING_TTL = ttl; });
const ctx = await web(t);
const { id } = await core.add(ctx.file, 'Build it');
const waitFor = eventStream(ctx, t);
await waitFor(value => value.items?.some(item => item.id === id));
const marked = waitFor(value => value.items?.some(item => item.id === id && item.working?.what === 'build'));
await core.working(ctx.file, id, 'build');
assert.deepEqual((await marked).items.find(item => item.id === id).turn, { actor: 'agent', kind: 'working' });
const before = readFileSync(core.workingPath(ctx.file), 'utf8');
// Frames are matched in order: the first one after the mark that no longer carries it.
let seen = false;
const expired = await waitFor(value => {
const item = value.items?.find(other => other.id === id);
if (item?.working) seen = true;
return seen && item?.working === null;
}, 3000);
assert.deepEqual(expired.items.find(item => item.id === id).turn, { actor: 'agent', kind: 'new' });
assert.equal(readFileSync(core.workingPath(ctx.file), 'utf8'), before, 'expiry needs no write');
});

test('S3: SSE observes an external core write within one second without reloading', async t => {
const ctx = await web(t);
await core.add(ctx.file, 'Initial');
Expand Down
Loading
Loading