agent-orchestrator/packages/web
Prateek 276a87eab1 refactor: make project field required, remove all inference logic
Makes the metadata format deterministic with project as a required field.
Removes ~40 lines of inference/fallback logic for zero dead code.

**1. Made project field required:**
- types.ts: SessionMetadata.project is now required (not optional)
- Moved to first position for clarity

**2. Removed inference function:**
- Deleted inferProjectId() (~20 lines)
- Deleted escapeRegex() (no longer needed)
- Removed longest-prefix matching logic
- Removed regex pattern matching

**3. Simplified metadataToSession():**
- Before: projectId: meta["project"] || inferProjectId(sessionId, config)
- After:  projectId: meta["project"]
- Removed config parameter (no longer needed)

**4. Optimized list() filtering:**
- Filter by raw["project"] BEFORE building session (more efficient)
- No need to filter after metadataToSession() anymore

**5. Removed fallback in merge route:**
- Deleted single-project fallback logic (~5 lines)
- Now fails fast with clear error if project is invalid

**6. Fixed tests:**
- Added project field to all test writeMetadata() calls
- Tests now match required field constraint

All 22 existing sessions manually updated with project=ao:
- ao-1 through ao-21
- ao-sessions
- ao-orchestrator (already had it)

Lines removed: ~40
- inferProjectId(): ~20 lines
- escapeRegex(): ~3 lines
- Fallback logic: ~5 lines
- Complex filter logic: ~3 lines
- Documentation: ~10 lines

Benefits:
 Zero inference/heuristic logic
 Single source of truth (metadata file)
 Fail fast with clear errors
 Simpler code, easier to understand
 More efficient (filter before building)
 No tech debt

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-16 23:32:27 +05:30
..
e2e feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
screenshots feat: implement web dashboard with attention-zone UI and API routes (#1) 2026-02-14 14:26:59 +05:30
server feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
src refactor: make project field required, remove all inference logic 2026-02-16 23:32:27 +05:30
.env.local.example feat: implement DirectTerminal with XDA clipboard support (#55) 2026-02-16 04:34:15 +05:30
.gitignore feat: implement DirectTerminal with XDA clipboard support (#55) 2026-02-16 04:34:15 +05:30
next-env.d.ts feat: implement web dashboard with attention-zone UI and API routes (#1) 2026-02-14 14:26:59 +05:30
next.config.js feat: publish to npm under @composio scope (#32) 2026-02-15 04:28:57 +05:30
package.json feat: implement DirectTerminal with XDA clipboard support (#55) 2026-02-16 04:34:15 +05:30
postcss.config.mjs feat: implement web dashboard with attention-zone UI and API routes (#1) 2026-02-14 14:26:59 +05:30
tsconfig.json fix: resolve dashboard GitHub API rate limiting and PR enrichment (#37) 2026-02-15 04:14:54 +05:30
vitest.config.ts feat: implement web dashboard with attention-zone UI and API routes (#1) 2026-02-14 14:26:59 +05:30