|
| 1 | +# Implementation Gap Audit |
| 2 | + |
| 3 | +This audit ranks the most useful next implementation work after the initial |
| 4 | +repository push, CI verification, Gymnasium adapter expansion, trace summaries, |
| 5 | +and trace replay example. |
| 6 | + |
| 7 | +## Current Stable Surface |
| 8 | + |
| 9 | +- 22 runnable examples |
| 10 | +- 59 smoke and regression tests |
| 11 | +- CI green on Python 3.10, 3.11, and 3.12 |
| 12 | +- 21 generated README GIFs with nonblank checks |
| 13 | +- Gymnasium-style adapters for `GridWorld2D`, `DynamicObstacleGridWorld`, and |
| 14 | + `Tabletop2D` |
| 15 | +- `Trace.summary()` and `examples/runtime/26_trace_replay.py` |
| 16 | + |
| 17 | +## Ranked Next Work |
| 18 | + |
| 19 | +| Rank | Candidate | Impact | Effort | Risk | Recommendation | |
| 20 | +| --- | --- | --- | --- | --- | --- | |
| 21 | +| 1 | `docs/trace.md` | high | low | low | Do next | |
| 22 | +| 2 | `BlockedPathWorld` Gymnasium adapter | medium | low-medium | medium | Do after trace docs | |
| 23 | +| 3 | `examples/navigation/10_localization_uncertainty_recovery.py` | high | medium-high | medium | Best next major example | |
| 24 | +| 4 | `MovingObstacleWorld` continuous-control adapter | medium | medium | medium | Good RL bridge follow-up | |
| 25 | +| 5 | `examples/manipulation/08_belief_grasp_selection.py` | high | medium | medium | Good after navigation example | |
| 26 | + |
| 27 | +## 1. Trace Documentation |
| 28 | + |
| 29 | +Why it matters: |
| 30 | + |
| 31 | +- Trace summaries and replay now exist, but their contract is only explained in |
| 32 | + scattered README snippets. |
| 33 | +- A short dedicated document would make headless inspection discoverable. |
| 34 | +- It finishes the remaining Priority 5 documentation task. |
| 35 | + |
| 36 | +Suggested scope: |
| 37 | + |
| 38 | +- Add `docs/trace.md`. |
| 39 | +- Explain `observations`, `actions`, `rewards`, and `infos`. |
| 40 | +- Explain `info["failure"]` and `Failure`. |
| 41 | +- Show `trace.failures()` and `trace.summary()` examples. |
| 42 | +- Mention that replay tooling is intentionally small and not a logging |
| 43 | + framework. |
| 44 | + |
| 45 | +Acceptance checks: |
| 46 | + |
| 47 | +- `python scripts/run_all_smoke_tests.py --check-gifs` |
| 48 | +- Markdown asset checks remain green. |
| 49 | + |
| 50 | +## 2. `BlockedPathWorld` Gymnasium Adapter |
| 51 | + |
| 52 | +Why it matters: |
| 53 | + |
| 54 | +- It is already listed as the next Gymnasium candidate. |
| 55 | +- `BlockedPathWorld` has a clean `reset()` / `step()` world boundary. |
| 56 | +- The action mapping can reuse `GRID_ACTIONS`. |
| 57 | +- The observation is compact: time, robot, goal, known map, dynamic blocker, |
| 58 | + last blocked cell. |
| 59 | + |
| 60 | +Implementation note: |
| 61 | + |
| 62 | +- `BlockedPathWorld` currently lives inside |
| 63 | + `examples/navigation/09_blocked_path_recovery.py`, not `pir/worlds/`. |
| 64 | +- Importing an example module from `pir/adapters` would blur the package |
| 65 | + boundary. |
| 66 | +- Before adding the adapter, move only `BlockedPathWorld` into `pir/worlds/` or |
| 67 | + create a small wrapper module that does not pull in example-agent code. |
| 68 | + |
| 69 | +Suggested tests: |
| 70 | + |
| 71 | +- reset shape |
| 72 | +- discrete action decoding |
| 73 | +- success termination |
| 74 | +- timeout truncation |
| 75 | +- recoverable `blocked_path` failure remains nonterminal |
| 76 | +- `info["raw_obs"]` preserves the original observation |
| 77 | + |
| 78 | +## 3. `10_localization_uncertainty_recovery.py` |
| 79 | + |
| 80 | +Why it matters: |
| 81 | + |
| 82 | +- It is the top next-tier example in `docs/plan.md`. |
| 83 | +- The existing navigation set already has belief-based navigation and active |
| 84 | + SLAM, but not a focused recovery loop for ambiguous localization. |
| 85 | +- It would teach "I am not sure where I am, so I should take an information |
| 86 | + action before acting toward the goal." |
| 87 | + |
| 88 | +Suggested loop: |
| 89 | + |
| 90 | +```text |
| 91 | +ambiguous pose belief -> detect high uncertainty -> move to landmark view -> |
| 92 | +belief collapses -> resume goal navigation |
| 93 | +``` |
| 94 | + |
| 95 | +Keep it small: |
| 96 | + |
| 97 | +- reuse the style of `06_belief_based_navigation.py` |
| 98 | +- use a fixed grid and a few landmarks |
| 99 | +- force an initial ambiguous belief |
| 100 | +- make recovery visible through entropy and a `localization_recovery_count` |
| 101 | + |
| 102 | +Required updates: |
| 103 | + |
| 104 | +- `examples/README.md` |
| 105 | +- `examples/navigation/README.md` |
| 106 | +- `tests/test_examples_smoke.py` |
| 107 | +- `docs/status.md` |
| 108 | +- optional GIF only if it becomes a major visible example |
| 109 | + |
| 110 | +## 4. Continuous-Control Gymnasium Adapter |
| 111 | + |
| 112 | +Why it matters: |
| 113 | + |
| 114 | +- `MovingObstacleWorld` in `08_interactive_mpc.py` is the clearest continuous |
| 115 | + action-space candidate. |
| 116 | +- It would demonstrate that optional RL compatibility is not limited to grid |
| 117 | + worlds. |
| 118 | + |
| 119 | +Risk: |
| 120 | + |
| 121 | +- `MovingObstacleWorld.step()` returns a tuple, not `StepResult`. |
| 122 | +- The observation and action spaces need Gymnasium `Box` spaces. |
| 123 | +- Like `BlockedPathWorld`, the world currently lives inside an example module. |
| 124 | + |
| 125 | +Recommendation: |
| 126 | + |
| 127 | +- Do this after the blocked-path adapter, using the same package-boundary |
| 128 | + decision. |
| 129 | + |
| 130 | +## 5. Manipulation Belief Grasp Selection |
| 131 | + |
| 132 | +Why it matters: |
| 133 | + |
| 134 | +- The manipulation examples cover retry, visual servoing, IK, search, pushing, |
| 135 | + and suction sorting. |
| 136 | +- A focused belief-to-grasp-choice example would fill a clear concept gap: |
| 137 | + multiple possible object poses leading to different grasp choices and failure |
| 138 | + updates. |
| 139 | + |
| 140 | +Suggested loop: |
| 141 | + |
| 142 | +```text |
| 143 | +pose belief -> choose grasp with best expected success -> fail -> update belief |
| 144 | +-> choose different grasp |
| 145 | +``` |
| 146 | + |
| 147 | +Recommendation: |
| 148 | + |
| 149 | +- Good next example after navigation localization recovery, unless the project |
| 150 | + wants manipulation growth first. |
| 151 | + |
| 152 | +## Recommended Sequence |
| 153 | + |
| 154 | +1. Add `docs/trace.md`. |
| 155 | +2. Extract or package `BlockedPathWorld` cleanly, then add its Gymnasium |
| 156 | + adapter. |
| 157 | +3. Add `examples/navigation/10_localization_uncertainty_recovery.py`. |
| 158 | +4. Decide whether the next expansion should be continuous-control RL adapter or |
| 159 | + manipulation belief-grasp example. |
| 160 | + |
| 161 | +This order keeps the current surface stable, finishes a mostly complete trace |
| 162 | +story, then returns to the plan's highest-value new example work. |
0 commit comments