docs(state): close n8n wip and seed drive docs sheets plan

This commit is contained in:
zap
2026-03-12 21:39:34 +00:00
parent 00cdbbb654
commit e6b9844097
4 changed files with 142 additions and 8 deletions

View File

@@ -4,12 +4,13 @@
Immediate baton-pass for the next fresh implementation session.
## Current objective
Operator/polish pass is complete. Next fresh session should decide whether Drive / Docs / Sheets need action-bus verbs at all, while preserving the approval/history contract that now exists for Gmail + Calendar.
The Gmail + Calendar n8n action-bus WIP is complete and live. Next fresh session should review `WIP.drive-docs-sheets.md` and decide whether Drive / Docs / Sheets need action-bus verbs at all, while preserving the approval/history contract that now exists for Gmail + Calendar.
## Use these state files first
1. `WIP.md`full standing plan and checkpoints
2. `memory/2026-03-12.md` — detailed execution history and evidence
3. `memory/tasks.json` — task status tracking
1. `WIP.md`completed Google Workspace + n8n implementation record
2. `WIP.drive-docs-sheets.md` — proposed next-phase decision WIP
3. `memory/2026-03-12.md` — detailed execution history and evidence
4. `memory/tasks.json` — task status tracking
## What is already true
- `openclaw-action` is live in n8n and active.
@@ -59,9 +60,10 @@ Operator/polish pass is complete. Next fresh session should decide whether Drive
- Added docs/test payloads/validator coverage for the expanded calendar contract.
## Highest-priority next actions
1. Decide whether Drive / Docs / Sheets need action-bus verbs or should stay direct-tool only.
2. If new Google actions are added, keep approval defaults explicit by family (`notification`, `gmail`, `calendar`, `manual`).
1. Review `WIP.drive-docs-sheets.md` and make a go / no-go call per surface: Drive, Docs, Sheets.
2. If any new Google actions are added, keep approval defaults explicit by family (`notification`, `gmail`, `calendar`, `manual`, and any new family names).
3. Preserve compact operator reporting (`pending_compact`, `history_compact`, `summary_line`, `result_refs`) for any new approval-backed actions.
4. Keep the live deployment habit: after implementation, sync the live workflow and run a safe smoke test instead of trusting static validation alone.
## Success criteria for the next session
- Clear go/no-go decision on expanding beyond Gmail + Calendar.

80
WIP.drive-docs-sheets.md Normal file
View File

@@ -0,0 +1,80 @@
# WIP.drive-docs-sheets.md
## Status
Status: `proposed`
Owner: `zap`
Opened: `2026-03-12`
## Purpose
Evaluate whether the n8n Google Workspace action bus should expand beyond Gmail + Calendar into Drive / Docs / Sheets, or whether those surfaces should stay direct-tool-only for now.
## Decision goal
Produce a clear go / no-go per surface:
- Google Drive
- Google Docs
- Google Sheets
## Why this is a separate WIP
Gmail + Calendar are now implemented, deployed, and smoke-tested. Drive / Docs / Sheets are a different decision because they can easily sprawl into broad CRUD coverage without the same immediate operator value.
## Constraints carried forward
- Keep `openclaw-action` as the narrow authenticated ingress.
- Keep approval/history/state in n8n.
- Use the host-side `gog` bridge for execution when appropriate.
- Preserve the compact operator contract:
- `pending_compact`
- `history_compact`
- `operator.summary_line`
- `operator.execution_state`
- `operator.result_refs`
- Keep approval defaults explicit by family.
- Default to the smallest useful verb set.
## Questions to answer
### Drive
Possible useful verbs:
- `search_drive_files`
- `list_drive_files`
- `get_drive_file_metadata`
- `move_drive_file`
- `trash_drive_file`
Questions:
- Is Drive mainly a discovery/search surface here, or do we need mutating file-management actions?
- Would direct `gog drive ...` usage be simpler than queueing through n8n for most cases?
### Docs
Possible useful verbs:
- `create_doc`
- `append_doc_text`
- `replace_doc_text`
- `get_doc_text`
Questions:
- Do we actually need approval-gated doc writes, or is docs work better done directly in a focused tool flow?
- Is append/replace enough, or would structured range operations be needed too soon?
### Sheets
Possible useful verbs:
- `read_sheet_range`
- `append_sheet_rows`
- `update_sheet_cells`
- `create_sheet_tab`
Questions:
- Is Sheets the highest-leverage next action surface because it fits queueable structured writes?
- If yes, what is the minimum safe starter set?
## Initial recommendation
- **Drive:** probably `no` for broad action-bus expansion right now; maybe `yes` for a tiny read/search surface later.
- **Docs:** probably `no` for now unless a very specific document-drafting workflow appears.
- **Sheets:** strongest `maybe yes` candidate because append/update flows map well to approval + audit history.
## Success criteria
- One-page recommendation covering Drive / Docs / Sheets.
- Clear go / no-go per surface.
- If any surface is greenlit, define only the minimum starter verbs.
- If any surface is greenlit, specify approval defaults (`low` read-only vs `high` mutating) before implementation begins.
## If implemented later
Use a fresh implementation session and promote the chosen scope into `WIP.md` before coding.

30
WIP.md
View File

@@ -7,9 +7,10 @@ Google Workspace + n8n integration
Use OpenClaw as the brain, n8n as the orchestration layer, and Google Workspace as a real execution surface for Gmail/Calendar workflows.
## Current status
Status: `in-progress`
Status: `completed`
Owner: `zap`
Started: `2026-03-12`
Completed: `2026-03-12`
### Architecture decision
- Keep `openclaw-action` as the narrow authenticated ingress into n8n.
@@ -39,6 +40,7 @@ Started: `2026-03-12`
### n8n action bus
- [x] Live `openclaw-action` workflow exists and is active.
- [x] Live workflow re-synced from the current workspace asset after implementation completed.
- [x] Core actions verified live:
- `append_log`
- `get_logs`
@@ -268,8 +270,32 @@ Targeted verification evidence:
- `test-verify-email-draft-cycle.json` → request id `verify-email-draft-cycle-001`
- `test-verify-calendar-event-cycle.json` → request id `verify-calendar-event-cycle-001`
## Live deploy + smoke verification (2026-03-12 21:36Z)
- Live workflow id: `Jwi54VWMdlLqYnRo`
- Synced the active n8n workflow in place from the current `skills/n8n-webhook/assets/openclaw-action.workflow.json` asset while preserving:
- webhook credential binding
- webhook registration id
- active state
- First live sync revealed the old minimal router was still running; re-synced from the current full code-node asset and re-activated successfully.
- Safe smoke calls succeeded against the production webhook:
- `append_log``ok: true`
- `get_logs``ok: true`
- `list_email_drafts``status: queued_for_approval`
- `list_upcoming_events``status: queued_for_approval`
- `approval_queue_list``ok: true`, with `pending_compact` + `history_compact` present
- `fetch_and_normalize_url` against local n8n `/healthz``ok: true`, HTTP `200`
- unknown action → expected HTTP `400` / `unknown_action`
- Smoke-created approval items were rejected and cleaned up:
- `approval-mmnzm1ev-yjk46sd1`
- `approval-mmnzm1gi-l7yszi92`
- `approval-mmnzmw80-kb8szya2`
- `approval-mmnzmw9w-c25hlml4`
- Remaining pending queue items after cleanup were pre-existing and left untouched:
- `approval-mmnvgv1o-h06r397e`
- `approval-mmnulm6r-mfaj7ea8`
## Next-session handoff
For the next fresh implementation session, start from `HANDOFF.md` + `WIP.md` rather than from old chat context.
This WIP is complete. For the next fresh implementation session, review `HANDOFF.md` plus the proposed next-phase file `WIP.drive-docs-sheets.md`.
Immediate target:
- decide whether Drive / Docs / Sheets actually need action-bus verbs or can remain direct-tool workflows for now

View File

@@ -199,6 +199,32 @@
- `gog calendar delete primary example-calendar-event-id --account will@example.com --json --no-input --force --send-updates none --dry-run`
- `python3 -m py_compile skills/n8n-webhook/scripts/resolve-approval-with-gog.py` passed.
## Live deploy + smoke verification
- Re-synced the active n8n workflow `Jwi54VWMdlLqYnRo` from the current `openclaw-action.workflow.json` asset while preserving the bound webhook credential + webhook id.
- First sync exposed that the live workflow had still been on the older minimal router; re-synced again from the current full asset and re-activated successfully.
- Safe production-webhook smoke calls succeeded:
- `append_log` → ok
- `get_logs` → ok
- `list_email_drafts` → queued_for_approval
- `list_upcoming_events` → queued_for_approval
- `approval_queue_list` → ok with `pending_compact` + `history_compact`
- `fetch_and_normalize_url` against local `/healthz` → ok / HTTP 200
- unknown action → expected HTTP 400 / `unknown_action`
- Smoke-created pending approvals were rejected/cleaned:
- `approval-mmnzm1ev-yjk46sd1`
- `approval-mmnzm1gi-l7yszi92`
- `approval-mmnzmw80-kb8szya2`
- `approval-mmnzmw9w-c25hlml4`
- Remaining pending items after cleanup were older pre-existing queue items and were intentionally left alone.
## Subagent monitoring thresholds
- Added an explicit operating rule for fresh implementation runs:
- first routine check at ~5 minutes if still running
- inspect child history at ~10 minutes
- narrow pass feels suspiciously long at ~12 minutes and should be actively intervened by ~15 minutes absent crisp progress
- medium bounded pass feels suspiciously long at ~20 minutes and should be actively intervened by ~25 minutes absent crisp progress
- Also recorded the fallback rule: if the run is looping, not updating `WIP.md`, or returns an unusable result, finish the pass directly in the main session after one inspection.
## Operator/polish pass 3 (fresh subagent implementation, locally verified)
- Added explicit approval families + defaults across the n8n action bus:
- notification → required/high