Commit Graph
176 Commits
Author SHA1 Message Date
Haoran 2d69019342 feat: consolidate course into 21 lessons 2026-07-31 03:15:58 +08:00
Haoran 4bc33ec858 docs: make workflow and goal lessons harness-first 2026-07-30 20:05:33 +08:00
Haoran cb8fae1bdd feat: refresh course through workflow and goal loops 2026-07-30 19:14:04 +08:00
github-actions[bot] 2dd1852d9e Merge remote-tracking branch 'upstream/main' 2026-07-28 19:12:03 +00:00
Yang Haoran 7b564c3ee6 Merge pull request #490 from shareAI-lab/fix/s18-idle-poll-wtctx-update
fix(s18): update wt_ctx after idle_poll auto-claims a worktree task
2026-07-29 01:27:46 +08:00
root 43beba5e51 fix(s18): update wt_ctx after idle_poll auto-claims a worktree task
idle_poll wrote the worktree path into the prompt text but never
updated wt_ctx["path"], so the teammate's bash/read/write tools
still ran in the main repo instead of the bound worktree.

Change idle_poll to return (result, claimed_task_id) tuple, and
update wt_ctx in the caller when a worktree-bound task was claimed.
s20 already handles this correctly by passing worktree_context into
idle_poll directly.

Closes #475
2026-07-29 01:23:37 +08:00
github-actions[bot] 57ee0c6316 Merge remote-tracking branch 'upstream/main' 2026-07-28 17:20:45 +00:00
Yang Haoran d6c804f2d4 Merge pull request #489 from shareAI-lab/docs/s16-fix-protocol-flowchart
docs(s16): fix protocol flowchart — separate shutdown and plan approval flows
2026-07-29 00:20:32 +08:00
root a2374c5bd4 docs(s16): fix protocol flowchart — separate shutdown and plan approval flows
Split the single protocol row into two distinct flows:
- Protocol A (yellow): shutdown, initiated by Lead via request_shutdown
- Protocol B (blue): plan approval, initiated by Teammate via submit_plan

request_plan is now shown as a plain message (grey dashed box/arrow),
not a protocol action. review_plan is added to the diagram. All three
language SVGs updated with the same layout.

Closes #373
2026-07-29 00:14:40 +08:00
github-actions[bot] 3c412644ad Merge remote-tracking branch 'upstream/main' 2026-07-28 15:13:54 +00:00
Yang Haoran ac822662f5 Merge pull request #488 from shareAI-lab/fix/s10-use-dynamic-context-in-prompt
fix(s10): assemble system prompt from dynamic context instead of static strings
2026-07-28 22:34:56 +08:00
root b4e7269d76 fix(s10): assemble system prompt from dynamic context instead of static strings
PROMPT_SECTIONS["memory"] was defined but never referenced, and
update_context() collected enabled_tools and workspace that
assemble_system_prompt() ignored, using hardcoded strings instead.

Now assemble_system_prompt reads tools and workspace from the
context dict, and PROMPT_SECTIONS only holds the identity line.
All three README code snippets are synchronized.

Closes #471
2026-07-28 22:27:58 +08:00
Yang Haoran 2f4d02d7d8 Merge pull request #487 from shareAI-lab/docs/s08-clarify-reactive-compact-wording
docs(s08): clarify reactive_compact aggressive wording refers to trigger, not compression
2026-07-28 22:27:13 +08:00
root b6eb5c0f3b docs(s08): clarify reactive_compact aggressive wording refers to trigger, not compression
The original phrasing "more aggressive than compact_history" was
ambiguous: the code shows reactive_compact is actually more
conservative in compression (keeps ~5 recent messages vs replacing
everything with a summary).  The real difference is the trigger
mechanism — reactive_compact is an emergency response to a 413
error, not a proactive threshold-based trigger.

Clarify in all three README languages that the aggressiveness is
about the trigger, not the compression strategy.

Closes #467
2026-07-28 22:17:25 +08:00
Yang Haoran 1286850c5f Merge pull request #461 from ggttyy1/fix/rounds-since-todo
fix: reset rounds_since_todo on each session
2026-07-28 21:57:01 +08:00
Yang Haoran d04e064306 Merge pull request #463 from ggttyy1/fix/with-retry-lambda
Fix/resolve lambda default param capturing current_model
2026-07-28 21:56:33 +08:00
Yang Haoran a7eb274df2 Merge pull request #486 from shareAI-lab/fix/s17-readme-s16-comparison-table
docs(s17): fix incorrect s16 comparison in changes-from-s16 table
2026-07-28 21:37:42 +08:00
root fc114def7a docs(s17): fix incorrect s16 comparison in changes-from-s16 table
The table had several inaccurate entries for the s16 column. s16
already had a WORK→IDLE→SHUTDOWN state machine, handled
shutdown_request during IDLE, and used consume_lead_inbox for
protocol routing and history injection — but the table described
s16 as having none of these.

This updates the table so the s16 column reflects what s16
actually does, verified against s16_team_protocols/code.py.
All three README languages are synchronized.

Closes #480
2026-07-28 21:29:53 +08:00
github-actions[bot] a78f861093 Merge remote-tracking branch 'upstream/main' 2026-07-28 12:49:18 +00:00
root 581241cdc7 fix(s03,s04,s20): remove dead safe_path, sync READMEs
- Delete safe_path entirely (following PR #483 approach) — no dead code
- Update all 3 READMEs per module to reflect read_file in Gate 2
- s04: also update permission_hook snippet in READMEs
- s20: remove safe_path (already replaced with inline resolution)

Closes #482
2026-07-28 20:24:01 +08:00
root 97b8541b36 fix(s04,s20): resolve Gate2 safe_path conflict same as s03
s04_hooks: permission_hook checks path + asks user, but safe_path
still raised hard ValueError — user approval was ineffective, same
root cause as s03 (#482).

s20_comprehensive: permission_hook used safe_path directly inside
try/except, silently denying all writes outside workspace without
ever asking the user.  Now uses is_relative_to check + user prompt.

Both files also add read_file to the permission coverage.

s05-s08 intentionally NOT changed: their permission_hook does not
check paths at all — safe_path is their only path-safety defense.
2026-07-28 20:23:58 +08:00
ViperandClaude Opus 4.8 4d8d420e41 fix(s03): let Gate 2 own the workspace boundary instead of safe_path
safe_path hard-raised on out-of-workspace paths while Gate 2 asked about the same condition, so approving an out-of-workspace write never took effect. Make the permission pipeline the sole boundary authority: drop safe_path, resolve paths directly in the file tools, and extend the Gate 2 rule to read_file. Sync all three READMEs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 20:23:56 +08:00
ggttyy1 fbd40c4539 fix: resolve lambda default param capturing current_model 2026-07-11 21:39:23 +08:00
ggttyy1 ffe1fef0b5 fix: make rounds_since_todo a local variable 2026-07-11 19:47:55 +08:00
ggttyy1 4faf3e4c52 fix: reset rounds_since_todo on each session 2026-07-11 18:36:19 +08:00
github-actions[bot] c0d7022cc5 Merge remote-tracking branch 'upstream/main' 2026-06-26 20:29:03 +00:00
Yang Haoran a9cafe953a Merge pull request #433 from Bill-Billion/codex/update-env-models
[codex] Update provider model examples
2026-06-27 03:36:34 +08:00
Haoran 9d9453cff0 Update provider model examples 2026-06-27 03:32:20 +08:00
github-actions[bot] ca2fc1adf5 Merge remote-tracking branch 'upstream/main' 2026-06-26 18:25:24 +00:00
Yang Haoran 4545a380e6 Merge pull request #362 from Panda-eyes123/fix
fix: show error messages when API exceptions occur in s12-s20
2026-06-27 01:55:39 +08:00
Yang Haoran 85f6e511bb Merge pull request #361 from YonganZhang/docs/canonical-kode-repo-links
docs: use canonical Kode repository links
2026-06-27 01:29:36 +08:00
Yang Haoran 5c3328101f Merge pull request #286 from 123456wda/fix/s09-s10-s11-missing-dev-null-check
fix: add missing "> /dev/" dangerous command check in s09/s10/s11
2026-06-27 01:28:25 +08:00
Yang Haoran 939446d412 Merge pull request #245 from bansalkanav/main
fix sequence notation by adding missing `>` after active step markers
2026-06-27 01:27:06 +08:00
Yang Haoran 5cde7c548f Merge pull request #432 from Bill-Billion/add_contributing
Add CONTRIBUTING with contribution scope and review policy
2026-06-27 01:25:31 +08:00
Haoran c32ce1af94 Add CONTRIBUTING with scope and review policy
State the contribution rules for this teaching repository: tie each PR to an
issue, keep teaching code minimal, keep the three language READMEs in sync,
target current chapter files, and disclose AI assistance. Note that bulk PRs
generated by an agent across many repositories may be closed without detailed
review.
2026-06-27 01:17:52 +08:00
Yang Haoran dd092054ed Merge pull request #431 from Bill-Billion/fix_374_idle_poll
s17: remove redundant idle_poll agent_name parameter and sync READMEs
2026-06-27 01:03:50 +08:00
Haoran f366a86239 Sync s17 READMEs with the idle_poll signature change
The code change dropped the redundant agent_name parameter, but the
trilingual README snippets still showed the old four-arg signature, the
double-passed call site, and agent_name inside the function body
(read_inbox and claim_task). Update all three language code blocks to
the three-arg form and bump the translation-sync markers so the docs
match the code.
2026-06-27 00:54:34 +08:00
chaochaoweb3 cbb3bd8c44 Remove duplicate idle poll name parameter 2026-06-27 00:54:34 +08:00
github-actions[bot] ef6d1a2873 Merge remote-tracking branch 'upstream/main' 2026-06-25 19:03:25 +00:00
Yang Haoran ab2cf01b2b Merge pull request #429 from Bill-Billion/feat/s15-poller-background-results
Cover completed background tasks in the Lead's inbox poller, and mark when teammates finish (#46)
2026-06-26 02:42:39 +08:00
Haoran 647a8dced2 Cover completed background tasks in the Lead's inbox poller, and mark when teammates finish (#46)
The inbox poller added in #291 wakes the Lead on teammate inbox messages, but a
completed background task still strands its result: nothing wakes the Lead for it,
and collect_background_results() runs only inside the tool-use branch, so a
plain-text turn never picks it up. There is also no signal once every teammate has
finished.

Extend the same poller instead of adding a second path. has_pending_background()
reports, without consuming, whether any background task has completed. The poller
now wakes on unread inbox messages or a completed background task, and the wake
handler drains both the inbox and collect_background_results() before running the
turn, so background results become new turns without user input, the same way
teammate results already do. When the last teammate finishes and its output has
been drained, a single "[all teammates done]" marker is printed.
2026-06-26 02:28:09 +08:00
github-actions[bot] 572243a8b4 Merge remote-tracking branch 'upstream/main' 2026-06-25 16:18:20 +00:00
Yang Haoran 17e2e12495 Merge pull request #428 from Bill-Billion/feat/issue-291-s15-inbox-poller
feat(s15): event-driven inbox poller so the Lead doesn't strand teammate results (#291)
2026-06-25 23:35:01 +08:00
Haoran 464a615b38 Lead loses teammate results when a turn ends without a tool call (#291)
After the Lead spawns teammate agents, if the current round terminates with
plain text (stop_reason != tool_use), agent_loop returns and the REPL falls
back to a blocking input(). Teammates run as daemon threads and finish later,
so the results they send to the Lead's inbox stay unconsumed until the user
submits their next input.

The cause is that result delivery is bound to the turn loop, whose lifetime
ends when the model stops calling tools, while a teammate completes on its own
clock. Blocking a teammate is harmless because it runs as a background thread;
the problem is specific to the Lead, which owns the user prompt.

The fix follows real Claude Code (useInboxPoller, described in the appendix):
decouple input() from turn execution. MessageBus.peek(agent) reports whether
the inbox has unread messages without consuming them. In __main__, input()
moves to a dedicated daemon thread and an inbox poller thread peeks the Lead's
inbox every second; both push to one shared event queue. The main thread runs
one turn per event, woken by either user input or an incoming teammate message,
so teammate results become new turns without waiting for the user. Repeated
inbox wakeups are idempotent: an empty read is skipped when a prior read_inbox
already drained the messages. Only the Lead's main loop changes; the teammates'
idle loops are untouched.
2026-06-25 23:26:42 +08:00
Yang Haoran 5ca7c151ff Merge pull request #2 from Bill-Billion/chore/sync-fork-workflow
ci: 定时把 fork main 同步到上游 shareAI-lab/main
2026-06-25 18:15:54 +08:00
HaoranandClaude Opus 4.8 6f0aef5cef ci: 定时把 fork main 同步到上游 shareAI-lab/main
每小时(或手动)将 upstream/main 合并进本 fork 的 main,使其包含上游全部更新。
因 workflow 文件常驻 main、已与上游分叉,故用 merge 而非 fast-forward 的 gh repo sync。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 18:14:22 +08:00
gui-yue 2a73474fb0 Merge pull request #375 from Gui-Yue/fix-s03-permission-example
docs: fix s03 permission gate example
2026-06-22 16:14:34 +08:00
gui-yue 4a329c9583 docs: fix s03 permission gate example 2026-06-22 16:10:06 +08:00
gui-yue ef3e88eead Merge pull request #364 from costajohnt/refactor/reactive-compact-summarize-old-history
refactor: summarize only trimmed history in reactive_compact
2026-06-22 15:54:24 +08:00
costajohntandClaude Opus 4.8 90a044883f docs: align snip_compact README guards with code
Match the snip_compact teaching snippet (en/zh/ja) to code.py: add the
`head_end > 0` head guard and the `tail_start > 0 and tail_start <
len(messages)` tail bounds check before indexing messages, mirroring the
reactive_compact alignment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UJumwVeBXSGYh8nSzoVTF
2026-06-21 16:52:41 -07:00