Prerequisites
Problem Description
Atlas delegate task missing rules guides, that lead to very bad code that doesnt follow any practice, miss every architect of the codebase, even with prompt like that:
/start-work plan-3-monster-ai-spawning
Rules you and your sub-agent(delegate_task) must follow:
- Max background agents(delegate_task) are 5, dont bloat your limited context window with a lot of words/text(Less talk more work/delegete work).
- ... (other rules)
- @.sisyphus/ENFORCEMENT_RULES.md - Ruls for subagents and you
- @docs/architecture/architecture_guide.md - Guides for subagents and you
- @.sisyphus/COMMAND_PARAMETER_DESIGN_RULES.md - Rules for subagents
- @.sisyphus/delegation-rules.md - Rules for you
it just ignore, it do generic delegation like that(Instructions with no rules):
delegate_task [description=Implement Monster Respawn System and Reducer, category=unspecified-high, prompt=<system-reminder>
[SYSTEM DIRECTIVE: OH-MY-OPENCODE - SINGLE TASK ONLY]
REFUSE multi-task requests. DEMAND single-task clarity.
</system-reminder>
<Work_Context>
NOTEPAD PATH: .sisyphus/notepads/{plan-name}/
PLAN PATH: .sisyphus/plans/{plan-name}.md (READ ONLY)
</Work_Context>
## 1. TASK
Implement the Monster Respawn System, including schema updates, repository extensions, and the scheduled reducer.
## 2. EXPECTED OUTCOME
- [ ] ...
## 3. REQUIRED TOOLS
- `edit`: Modify files.
- `write`: Create new files.
- `bash`: Verify compilation.
## 4. MUST DO
- Handle `Option<u64>` for `spawn_zone_id` (some monsters might not have a zone, e.g. event spawns).
- Use `AiState.last_move` as the "died_at" timestamp for Dormancy mode.
- Ensure efficient filtering in `get_monsters_needing_respawn` (iterate vitals or monsters? Vitals is better if indexed, but here maybe just scan).
- **CRITICAL**: Update `spawn_monster` command to pass the `zone_id`.
## 5. CONTEXT
- We need to respawn monsters that have been dead (Dormancy) for longer than their zone's respawn delay.
- `Monster` needs `spawn_zone_id` to know WHICH delay to use.
, run_in_background=false]
thats just create a sub-agent with zero clue about what rules/design it MUST follow, and for last 2 days literately it keep violate and break the very same rules! because there is no rules to follow in first place!
Proposed Solution
First here is the review of implemented plan(which is too small to make all this violations):
Review Output
Monster AI & Spawning Architecture Review - Summary
Executive Summary
STATUS: FAIL ❌
The Monster AI & Spawning implementation (plan-3-monster-ai-spawning) contains 7 critical categories of violations with a compliance score of 3/35.
Critical Violations Found
1. Import Style Violations (CRITICAL) ❌
- ai_tick_reducer.rs:13 - Deep imports systems::map::get_chunk_coords
- monster_ai.rs:12 - Deep imports from systems::{...}
- Fix Required: Use top-level module imports only
2. .unwrap() Usage (CRITICAL) ❌
- Production code: monster_spawn.rs:235 has .unwrap()
- Tests: Multiple test files use .unwrap() instead of .expect()
- Fix Required: Replace with proper error handling
3. Inline Tests (CRITICAL) ❌
- monster_ai.rs contains forbidden #[cfg(test)] mod tests
- monster_spawn.rs contains forbidden #[cfg(test)] mod tests
- Fix Required: Move all tests to tests/ folder
4. Untyped Errors (CRITICAL) ❌
- monster_repo.rs:41 returns Result<(), String>
- Fix Required: Create typed error enums using thiserror
5. Direct DB Access (CRITICAL) ❌
- ai_tick_reducer.rs:88-92 directly uses ctx.db.*.insert(...)
- spawn_reducer.rs:76-79 directly uses ctx.db.*.insert(...)
- Fix Required: Create/use repository ports for all DB access
6. Unsafe Code (CRITICAL) ❌
- spawn_reducer.rs:38-46 uses unsafe pointer aliasing for DbUniverse
- Fix Required: Refactor to use safe borrowing patterns
7. Dependency Violation (CRITICAL) ❌
- server_common/Cargo.toml depends on spacetimedb (forbidden)
- Fix Required: Remove spacetimedb, use only spacetimedb_lib
Compliance Score: 3/35
- Layering / DB access: 0/5
- Safety (no unsafe): 0/5
- Error typing: 1/5
- Import hygiene: 2/5
- Reliability (no unwrap): 0/5
- Test structure: 0/5
- Dependency boundaries: 0/5
Priority Remediation Order
1. Fix DB access violations - Create repository ports for schedule tables
2. Eliminate unsafe code - Refactor spawn_reducer borrowing
3. Fix dependency violation - Remove spacetimedb from server_common
4. Replace production unwrap - Add proper error handling
5. Fix import style - Use top-level module imports
6. Move inline tests - Relocate to tests/ folders
7. Clean up test unwraps - Use .expect() with messages
Recommendation
The plan implementation has NOT been correctly followed according to architecture guides.
Multiple critical violations exist that compromise:
- Architecture boundaries (direct DB access)
- Safety (unsafe aliasing)
- Maintainability (inline tests, unwraps)
- Dependency rules (illegal spacetimedb dependency)
here is how my .sisyphus folder looks like:
boulder.json delegation-rules.md MASTER_ROADMAP.md plans
COMMAND_PARAMETER_DESIGN_RULES.md ENFORCEMENT_RULES.md notepads TEST_REFACTORING_GUIDE.md
So maybe enforce rules/guides files or folder by Atlas or something like that would be better than spawn a clueless agents to do tasks. Maybe something like <system-reminder> or <Work_Context>.
For the long run
i think its time to make a config file per project, json file that contains useful values like rules files and other configurations that could be used by the plugin every where. it could be even a configuration file lives under .opencode in the project which maybe became a stander and used by this plugin and other plugins too!
Feature Type
Other
Contribution
Prerequisites
Problem Description
Atlas delegate task missing rules guides, that lead to very bad code that doesnt follow any practice, miss every architect of the codebase, even with prompt like that:
it just ignore, it do generic delegation like that(Instructions with no rules):
thats just create a sub-agent with zero clue about what rules/design it MUST follow, and for last 2 days literately it keep violate and break the very same rules! because there is no rules to follow in first place!
Proposed Solution
First here is the review of implemented plan(which is too small to make all this violations):
Review Output
here is how my
.sisyphusfolder looks like:So maybe enforce rules/guides files or folder by
Atlasor something like that would be better than spawn a clueless agents to do tasks. Maybe something like<system-reminder>or<Work_Context>.For the long run
i think its time to make a config file per project,
jsonfile that contains useful values likerules filesand other configurations that could be used by the plugin every where. it could be even a configuration file lives under.opencodein the project which maybe became a stander and used by this plugin and other plugins too!Feature Type
Other
Contribution