refactor: workspace restructure and archive legacy projects#2
refactor: workspace restructure and archive legacy projects#2redredchen01 wants to merge 9 commits intomasterfrom
Conversation
- Package renamed: obsidian-agent → clausidian - Binary renamed: obsidian-agent → clausidian - Version bumped to 2.0.0 - GitHub repo: redredchen01/Clausidian - Updated all references: * CLI source (package.json, bin, src, commands, tests) * Scaffold & skill templates * README (with migration guide) * Project index & workspace docs Tests: 122/124 pass CLI: clausidian v2.0.0 ✓ Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Update WORKSPACE_STRUCTURE.md with clausidian tool name - Update automation plan and restructure plan with clausidian CLI references - Ensure documentation reflects official tool rename
- Remove archived docs (AGENT-WORKFLOW, BENCHMARKS, ENTERPRISE-ADOPTION, etc.) - Complete obsidian-agent → clausidian v2.0.0 migration (delete old directory) - Remove skill-deploy.sh (superseded by new deployment workflow) - Update backend entrypoints and session-wrap references - Reorganize scripts: add visualization tools, clean up unused scripts - Update zsh configurations and Python experimental projects - Add structured plans for workspace governance and architecture This completes the workspace restructuring phase started in previous sessions.
Replace hardcoded command dispatch with router function that handles install/uninstall/status subcommands. Update documentation to note that com.clausidian.* agents are deprecated in favor of com.dex.obsidian-* system which uses shell scripts in YD 2026/scripts/ (daily/weekly/monthly). Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Update all obsidian-*.sh scripts to call 'clausidian' command instead of deprecated 'obsidian-agent'. These scripts are invoked by com.dex.obsidian-* LaunchAgents (installed daily at 08:00, weekly at 20:00 Sunday, monthly at 20:00 1st day). Changes: - obsidian-daily.sh: journal + backfill + sync + health + auto-commit - obsidian-weekly.sh: review + health + validate + orphans + broken-links - obsidian-monthly.sh: monthly review + health + duplicates + sync All 3 scripts tested and verified working. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Restructure root package.json as workspace metadata (private: true) - Improve task lock with stale lock cleanup (60s threshold) - Reduce retry count to 10s, add graceful release_lock trap - Add .editorconfig for consistent formatting
Add bridge command group with subcommands support for syncing external systems to vault: - bridge gcal: Sync Google Calendar events to daily journal - bridge gmail: Placeholder for Gmail digest capture - bridge github: Placeholder for GitHub activity sync Changes: - Create src/commands/bridge.mjs with bridgeGcal() implementation - Register bridge subcommands in src/registry.mjs - Update bin/cli.mjs to route subcommands to their run functions - Flatten subcommands into MCP tools automatically for agent access Google Calendar integration (bridge gcal): - Queries gwx calendar CLI for events on specified date - Generates meeting blocks with time, attendees, description - Appends to existing journal entry without overwriting - Gracefully handles missing gwx or auth errors Testing: - All 123/124 tests pass (1 pre-existing failure unrelated) - Manual testing: bridge gcal command works, awaiting OAuth setup - batch command now also works with updated subcommand routing Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Update obsidian-daily.sh to include bridge gcal step for syncing Google Calendar events to journal. This adds event details (time, attendees, description) to daily journal entries automatically. Execution order: 1. Create journal entry (idempotent) 2. Backfill missing journals from git history 3. Sync Google Calendar events to journal 4. Rebuild vault indices (TF-IDF link suggestions) 5. Generate health report 6. Auto-commit changes Requires: gwx CLI with Google OAuth setup (skip gracefully if not auth'd) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add bridge.mjs command for gcal/gmail/github integration - Update registry.mjs to expose bridge subcommands - Update cli.mjs with bridge command documentation - Update workspace governance plan with bridge architecture - Update obsidian-daily.sh automation with bridge integration
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 087bf146be
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| // Middleware: Ensure user is authenticated | ||
| router.use(authenticateToken); | ||
| router.use(checkRole(['admin', 'editor', 'viewer'])); |
There was a problem hiding this comment.
Apply role check after workspaceId is bound
Placing checkRole(['admin', 'editor', 'viewer']) on router.use(...) runs the authorization middleware before :workspaceId is populated from route matching, so checkRole falls back to checking only global roles and can reject users who have valid workspace-scoped roles. This makes analytics endpoints return 403 for legitimate members unless they also have a global role; attach checkRole to the '/analytics/.../:workspaceId' handlers (or another path that includes :workspaceId) so it authorizes against the correct workspace.
Useful? React with 👍 / 👎.
| const ForecastEngine = require('../utils/forecast') | ||
|
|
||
| const router = express.Router() | ||
|
|
||
| router.use(authenticateToken) | ||
| router.use(checkRole(['admin', 'editor', 'viewer'])) |
There was a problem hiding this comment.
Scope forecasting role checks to workspace routes
This router-level checkRole(...) executes before route params are bound, so req.params.workspaceId is not available when authorization runs and users with only workspace-level roles can be denied from /forecast/:workspaceId and /anomalies/:workspaceId. Mount the role middleware on routes that include :workspaceId (or a middleware path with that param) so role lookup is evaluated in the requested workspace instead of global scope.
Useful? React with 👍 / 👎.
| if (!fs.existsSync(AGENT_TASKS_PATH)) { | ||
| return res.status(500).json({ error: 'agent-tasks.sh not found. Run setup first.' }); |
There was a problem hiding this comment.
Update task script path used by task mutations
After this workspace restructure, task mutations now hit this guard because the default AGENT_TASKS_PATH still targets the old scripts/agent-tasks.sh location while the script was moved under scripts/agent/agent-tasks.sh. In a default install, POST/PATCH /tasks will return 500 (agent-tasks.sh not found) until operators set an override manually; update the default path to the relocated script so task creation/updates work out of the box.
Useful? React with 👍 / 👎.
Summary
完成工作区重构,归档legacy项目,为新的workspace governance铺路。
Changes
1. 文档整理
docs/archive/session-wrap/2. 项目迁移
3. Scripts重组
4. 后端测试
5. 配置更新
Design Decisions
Testing
运行以下验证:
🤖 Generated with Claude Haiku 4.5 via Claude Code