fix: Generator が requirement.md を書き換えられる

Open Beginner friendly
#135 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
shell
Domain
security

Research direction

Start in scripts/guard.sh at check_write and compare the generator rule with the planner RUN_DIR path check. Review agents/generator.md and the tool invocation in scripts/steps.sh for the intended boundary. Done means generator and its tools cannot write ${RUN_DIR}/requirement.md while existing planner restrictions remain unchanged.

Written by the indexing model from the issue text.

Description

現象

requirement.md は Planner だけが書き換えられる決まりだが、Generator にはこのファイルへの書き込みが開いている。

実際のランで、Planner が動いていない時点(計画を既存の plan-<n>.md から再利用して再開した直後)に requirement.md が書き換わり、制約が2つ増えた。増えた内容自体は妥当だったが、要件を満たす側が要件そのものを書き換えられる状態にある。

原因

scripts/guard.shcheck_write は、役割が generator のとき何も判定せずに許可している。

check_write() {
  case "${TRINITY_ROLE}" in
    generator) ;;
    ...

evaluator は Write / Edit を全面拒否され、plannerRUN_DIR の中だけに絞られる。generator にだけ範囲の制限が無い。

Generator は worktree のコードを書くために広い権限が要るが、RUN_DIR の中は別である。scripts/steps.shtool から呼ばれる /code-review --fix/simplifygenerator として起動されるため、ツールも同じ権限を持つ。

あるべき姿

generator${RUN_DIR}/requirement.md へ書き込めない。agents/generator.md は完了レポート以外を RUN_DIR へ書かないと定めており、機構をこれに合わせる。

判定は check_write に置く。Planner の RUN_DIR 判定と同じく、パスを突き合わせて拒否する形が素直である。

Dominant language
Shell
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yjn279/trinity

All issues in yjn279/trinity

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.