Skip to content

Integrate main_for_Merge: docs alignment, coding disciplines, Antigravity hardening, setup fixes#169

Open
kazumori102 wants to merge 9 commits into
yohey-w:mainfrom
kazumori102:main_for_Merge
Open

Integrate main_for_Merge: docs alignment, coding disciplines, Antigravity hardening, setup fixes#169
kazumori102 wants to merge 9 commits into
yohey-w:mainfrom
kazumori102:main_for_Merge

Conversation

@kazumori102

Copy link
Copy Markdown

Summary

Brings main_for_Merge (9 commits, fast-forward over main) up to main.
No history divergence — clean fast-forward.

Docs

  • Correct project management wording (DIV-001 / DIV-004 / DIV-005) to match
    the actual implementation.

Infra / behavior

  • Coding disciplines C001 / C002 added; dashboard fix.
  • Antigravity CLI hardening (regenerated instructions/generated/*,
    lib/cli_adapter.sh).
  • Detect Codex MCP init failures after departure launch.

Setup robustness

  • Grant exec bits via sudo in first_setup.sh STEP 9.
  • Keep inbox symlink target alive across setup re-runs.
  • Use a relative path for the Stop hook in .claude/settings.json.

Notes

  • queue/ and local-only proposal drafts are git-ignored and not included.

🤖 Generated with Claude Code

kazumori102 and others added 9 commits May 29, 2026 14:38
The Stop hook command was hardcoded to
/home/tono/multi-agent-shogun/scripts/stop_hook_inbox.sh. `tono` is a
home directory from a different machine; on this checkout
(/mnt/c/tools/multi-agent-shogun) that path does not exist, so every
agent printed "Stop hook error: ... No such file or directory" on each
turn end and the stop-time inbox delivery never fired.

Switch to the environment-independent form
`bash scripts/stop_hook_inbox.sh`, matching the already-working
SessionStart hook. Hooks run with the project root as cwd, so the
relative path resolves on any checkout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
queue/inbox is a symlink to ~/.local/share/multi-agent-shogun/inbox on
Linux/WSL2 (the mailbox is kept off the slow /mnt/c drvfs mount). The
target directory was created only inside the `if [ ! -L ./queue/inbox ]`
branch of shutsujin_departure.sh — i.e. only when the symlink itself did
not yet exist. On a re-run where the symlink was already present but its
target dir had been removed (cleared cache / fresh ~/.local/share), the
mkdir never ran, leaving a dangling symlink. inbox reads and
inbox_write.sh's own `mkdir -p` then failed, and agents silently lost
their entire comms layer at startup.

- shutsujin_departure.sh: run `mkdir -p "$INBOX_LINUX_DIR"`
  unconditionally (idempotent) before the symlink check, so the target
  always exists regardless of the symlink's state.
- scripts/inbox_write.sh: add dangling-symlink recovery — if queue/inbox
  is a symlink whose target is missing, recreate it via
  `mkdir -p "$(readlink ...)"` before writing.

The mailbox is now self-healing instead of breaking on the next launch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
On `shutsujin`, one codex agent (ashigaru2) came up with "MCP startup
interrupted. The following servers were not initialized: codex_apps".
The three other codex agents launched at the same instant were fine,
which points to a transient MCP init timeout when several codex CLIs
boot simultaneously. The failure was silent: the agent kept running
without its codex_apps tools and nothing surfaced it.

- scripts/mcp_health_check.sh (new): scan every codex pane in the
  multiagent session for MCP init error patterns ("MCP startup
  interrupted", "servers were not initialized", "MCP server ... failed",
  "connection ... timed out"); exit non-zero and name the affected
  agents when any match.
- shutsujin_departure.sh: add STEP 6.9 — after all agents launch, wait
  10s for boot to settle, run the health check, append to
  logs/mcp_health.log, and on failure print the remediation hint
  (`bash scripts/switch_cli.sh <agent>` to restart the affected agent).
- .gitignore: whitelist scripts/mcp_health_check.sh.

Detection only — it does not yet prevent the timeout. A single-agent
restart reliably brings codex_apps back up cleanly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Re-running setup occasionally failed at the "実行権限設定" step: when the
entry scripts were already owned by root from an earlier run, a plain
`chmod +x` by the invoking user was rejected (permission denied).

Collect the existing target scripts into a list and apply `sudo chmod +x`
once over the whole batch, then log each one. This clears the
intermittent permission shortage on setup re-runs.

Co-Authored-By: Codex <codex@openai.com>
dev's startup-hardening commits (relative stop hook, self-healing inbox
symlink, codex MCP init detection, setup exec-bit fix) were absorbed into
mainline via yohey-w#161 and the re-implementation of yohey-w#162 (1368e1c, sudo dropped).
Recording dev as merged with -s ours: history reflects the integration while
the tree keeps the creator's curated design unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…y-w#154)

dev2's only extra commit (14a5d05) was an independent Antigravity integration,
superseded by the creator's yohey-w#154 (agy as 7th CLI, gemini/agy normalization,
/clear reset, bundled tests). Recording dev2 as merged with -s ours: no tree
change, creator's design remains authoritative.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ashboard fix

  Coding disciplines (instructions/common/forbidden_actions.md + downstream):
  - C001: forbid hardcoding absolute paths when modifying existing structure; follow the
    surrounding convention ($SCRIPT_DIR / relative paths / existing variables).
  - C002: instruction sources (instructions/**, CLAUDE.md) are authored in English;
    exempt proper nouns, identifiers, command names, file paths, and runtime persona.
  - Enforcement: add the absolute-path rule to Karo's task quality_rules template and a
    new absolute-path check to Gunshi's QC.
  - Regenerate all instruction outputs (instructions/generated/*, .opencode/agents/*).

  Antigravity integration:
  - Fix agy launch crash: quote the --model argument in build_cli_command so model names
    containing spaces/parentheses (e.g. "Gemini 3.5 Flash (Medium)") no longer break the shell.
  - Rewrite instructions/cli_specific/antigravity_tools.md in English (Launch Contract /
    Auth And Secrets); never store credentials in the repo.
  - README.md / README_ja.md: Antigravity install/auth notes; auth is handled by the host
    agy CLI (do not assert ANTIGRAVITY_API_KEY).
  - Retain `gemini` as a legacy alias for `antigravity`.

  Dashboard:
  - Restore the correct dashboard data format.

  Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- config/projects.yaml: clarify it is instruction-driven, not script-parsed
- Two-layer structure: soften to "recommended convention" from "architecture"
- context/{name}.md: replace "automatically references" with accurate description of instruction-driven loading mechanism

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kazumori102

Copy link
Copy Markdown
Author

Project Management Structure: Proposal for Upstream Review

Context / Background

  • This system is a tmux-based multi-agent development platform that orchestrates multiple AI coding CLIs (Claude Code, Codex, Copilot, Kimi, OpenCode, Cursor, and Antigravity) with a documented project management structure.
  • In cmd_010, Gunshi reviewed the gap between the documented structure and the actual implementation.
  • The overall finding was that parts of the project management design are documented as if they are implemented features, while the current system mainly works through agent instructions and conventions.

Already-Resolved Items

  • DIV-001, DIV-004, and DIV-005 were already fixed in commit 201ce2e using Option A: scaling down the documentation to match the current implementation.
  • If upstream chooses full Option B for the project management structure, those changes would need to be revisited so the documentation and implementation move together.

DIV-002: projects/{id}.yaml

What the Docs Say

  • README.md L558 describes projects/{id}.yaml plus context/{id}.md as the unit equivalent to a Visual Studio solution.
  • README.md L1744-L1750 describes projects/<id>.yaml as the place for full project details, including client information, contracts, Notion pages, and tasks.
  • The same section states that projects/ is excluded from git because it contains confidential information.
  • CLAUDE.md L16 and L210 describe this file as project details that are git-ignored and may contain secrets.

Actual State

  • The projects/ directory does not exist, not even as an empty directory.
  • The only instruction reference found was shogun.md L291, which is an ambiguous input-search reference.
  • No scripts or library code read from projects/{id}.yaml.
  • There is zero runtime enforcement for this structure.

Impact

  • Medium.
  • The documentation implies a core project-management feature, but the current implementation is an absent, optional convention.

Option A: Scale Down the Docs

  • Describe projects/ as an optional convention for private deployments.
  • Acknowledge that the system works without projects/{id}.yaml.
  • Clarify that context/ currently carries project knowledge in practice.
  • This would align the documentation with the current lightweight, instruction-driven implementation.

Option B: Implement the Documented Behavior

  • Keep the current aspirational documentation.
  • Add a script or agent mechanism that reads projects/{id}.yaml at runtime.
  • Make the documented behavior real through loader logic, validation, or task-resolution support.
  • This would turn projects/{id}.yaml from a convention into an implemented project-detail layer.

My Recommendation

  • I recommends Option B.
  • The README describes projects/{id}.yaml as an intended project-management layer, including confidential project details and operational metadata.
  • If that is the intended design, implementing the loader is preferable to walking back the architecture, because it preserves the documented two-layer model and makes the system behavior match the maintainer-facing design.

Question for Upstream

  • Was projects/{id}.yaml intended as a core implemented feature, or as an optional convention for users to adopt if they wish?

DIV-003: context/{project}.md Naming and Loading

What the Docs Say

  • README.md L590 says that when the Shogun issues a command related to a project, it automatically references context/{name}.md.
  • README.md and CLAUDE.md describe context files as following a {project}.md naming pattern that matches project IDs in config/projects.yaml.
  • session_start_hook.sh L75 instructs agents to read context/{project}.md.

Actual State

  • context/ contains README.md, which documents the directory.
  • context/ also contains servy-glossary.md, a glossary for the Servy translation project from cmd_005.
  • Neither file follows a {project}.md convention matching a project ID.
  • The mechanism is instruction-driven: agents are told to read the context file.
  • There is no programmatic auto-reference mechanism.
  • If context is cleared, the reference only restores if agents re-read their instructions.

Impact

  • Medium.
  • The phrase "automatically references" implies a programmatic mechanism that does not exist.
  • The naming convention is documented, but it is not enforced and the existing files do not follow it.

Option A: Acknowledge Flexible Naming

  • Document context/ as a free-form knowledge store.
  • Treat {project}.md as a suggested pattern rather than an enforced convention.
  • Keep existing files such as README.md and servy-glossary.md as they are.
  • Clarify that agents read context through instructions, not through automatic runtime loading.

Option B: Standardize and Enforce the Convention

  • Implement the {project}.md convention with tooling or validation.
  • Align existing files with the project ID system, for example by renaming servy-glossary.md to context/servy.md and adding servy to config/projects.yaml.
  • Replace "automatically references" with an accurate description of the instruction-driven mechanism unless true automatic loading is implemented.
  • This would make project context naming predictable and auditable.

My Recommendation

  • I recommends Option B.
  • The documentation currently presents context/{project}.md as part of the project-management structure, not merely an ad-hoc knowledge folder.
  • Standardizing the convention would make project context easier to discover, easier to validate, and consistent with the project IDs in config/projects.yaml.

Question for Upstream

  • Was context/{project}.md intended as a strict convention with tooling enforcement, or as a flexible guideline?

Closing

We welcome upstream guidance on the intended design for both items. We will implement based on your direction.

@kazumori102 kazumori102 marked this pull request as ready for review June 18, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant