Skip to content

docs: add topic move collector workflow#1473

Open
YH-1600 wants to merge 3 commits into
mainfrom
feat/workflow-topic-move-collector
Open

docs: add topic move collector workflow#1473
YH-1600 wants to merge 3 commits into
mainfrom
feat/workflow-topic-move-collector

Conversation

@YH-1600

@YH-1600 YH-1600 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Change-Id: Ifc6c8d0b90faabff1136d92db1bc7e5556e77d85

Summary

Add a new workspace-topic-move-collector workflow for finding Workspace resources by topic or content clues, reviewing relevance, and moving confirmed resources into a Drive folder or Wiki node.

Changes

  • Added five workflow reference docs under skills/lark-drive/references/.
  • Added lark-drive and lark-wiki skill entry points so agents can discover the workflow.
  • Defined the full state machine from input parsing, target confirmation, recall, relevance review, planning, execution,
    verification, and restore.
  • Added user confirmation gates before search and before write operations.
  • Added recall progress UI, relevance adjustment rules, and user guidance for review and execution steps.

Test Plan

  • Unit tests pass
  • Manual local verification confirms the lark-cli <domain> <command> flow works as expected

Related Issues

  • None

Summary by CodeRabbit

  • Documentation
    • Added end-to-end “主题资料收集” workflow documentation, covering input/target setup, topic-based search recall (including enhanced query generation),审核与计划生成(分组与移动策略),以及执行、验证与基于快照/日志的恢复指引(含进度展示与确认/可选恢复)。
    • Updated conflict handling: when a request includes both search and organize/collect/archive/move, the workflow takes priority; internal recall uses drive +search.
    • Updated “快速决策” guidance to require following the full topic collection flow (no局部遍历).

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a complete workspace-topic-move-collector workflow specification as five new Markdown reference documents under skills/lark-drive/references/. The workflow defines a state machine spanning setup, search recall, resource review/planning, and write execution/restore phases. Routing rules are added to skills/lark-drive/SKILL.md and skills/lark-wiki/SKILL.md to direct topic-based archiving tasks to this workflow.

Changes

Topic-Move-Collector Workflow

Layer / File(s) Summary
Workflow entry point, state machine, and routing
skills/lark-drive/references/lark-drive-workflow-topic-move-collector.md, skills/lark-drive/SKILL.md, skills/lark-wiki/SKILL.md
Adds the main index document defining global constraints, the complete execution state machine from PARSE_INPUT to DONE, progressive loading relationships for all reference documents, command-family mapping by state, and responsibility boundaries. Updates both SKILL.md files to route user intent toward topic-based archiving/collection (整理/收集/归档) to this workflow workflow instead of simple search, with workflow taking priority when both search and organization are requested.
Setup states: input parsing, target resolution, confirmation
skills/lark-drive/references/lark-drive-workflow-topic-move-collector-setup.md
Defines PARSE_INPUT, RESOLVE_TARGET, and CONFIRM_CONTEXT states with required extraction of topic, target, identity, and constraints. Parses Drive folder tokens, Wiki node/space tokens, and target_type (drive_folder, wiki_node, wiki_space, new_drive_folder, new_wiki_node, unknown). Documents cross-container move support with explicit unsupported marking for Wiki node → Drive folder. Confirms context and next-step expectations before proceeding to search. Includes TargetLocation JSON schema with resolve_status (resolved, ambiguous, unsupported, permission_denied).
Search recall: SEARCH_RECALL and RECALL_ENHANCE
skills/lark-drive/references/lark-drive-workflow-topic-move-collector-recall.md
Defines two-phase search: SEARCH_RECALL constructs base query from confirmed topic with explicit constraints only (no hidden folder/space limits, no synonym/title-only/OR expansion), paginates with page-size 20 default until end or blocker, outputs progress UI at ~60 seconds. RECALL_ENHANCE generates interpretable enhanced queries from base evidence, merges stable-dedup candidates, tracks source_queries/match_channels/snippets per candidate, and stops when queries yield no new candidates or tool budget exhausted. Includes CandidateItem structure with dedupe_status (stable/fallback/uncertain) and blocker handling (auth/scope missing, policy blocked, pagination exhausted, budget insufficient) with mandatory reporting and no continuation until reported.
Resource review and move plan generation
skills/lark-drive/references/lark-drive-workflow-topic-move-collector-review-plan.md
Defines four-state resource processing: RESOURCE_RESOLVE canonicalizes candidates to resources with canonical tokens, URLs, parent locations, and Wiki node identity. CONTENT_VERIFY reads content per type (doc/docx/sheet/bitable/slides/file/wiki/folder) with constrained evidence strength and no auto-permission-request. RELEVANCE_CLASSIFY assigns each resource to exactly one group (high/medium/low/permission_denied/unverifiable/unsupported_move_target). PLAN_MOVE generates move plans with high/medium relevance defaults and marked rollback support. User adjustments to relevance groups invalidate old plans and trigger regeneration. Includes ResourceItem and MovePlanItem JSON data contracts with all required fields and constraints.
Execution, verification, and restore
skills/lark-drive/references/lark-drive-workflow-topic-move-collector-execute.md
Defines four-state write execution: CONFIRM_EXECUTION displays all write operations (targets/moves grouped, high/medium defaults, skip reasons) and requires confirmation before any writes. EXECUTE creates targets if required, moves confirmed items, maintains rollback snapshots and execution journal, fails fast on target creation, skips prohibited categories. VERIFY checks target existence and resource visibility at target location, offers restore only on critical failures. RESTORE generates rollback plans from snapshots/journal with explicit confirmation, restores only workflow-moved items with both rollback flags true, preserves restore-unsupported items, requires confirmation for target deletion. Includes RollbackSnapshotItem and execution_journal JSON data contracts with async task tracking and error reasons.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • larksuite/cli#1284: Both PRs modify skills/lark-drive/SKILL.md's "快速决策" routing guidance—main PR adds workflow-priority splitting for topic-move-collector to distinguish archiving/collection intent from search-only, while retrieved PR adjusts general drive skill routing constraints.
  • larksuite/cli#1275: Both PRs update skills/lark-wiki/SKILL.md routing to tighten "快速决策" boundaries and require delegation of knowledge-collection flows to lark-drive-defined workflows.

Suggested reviewers

  • zhouyue-bytedance

Poem

🐇 Five scrolls unfold with careful lines,
Setup, recall, review—all designs!
Parse, resolve, search deep and wide,
Classify, plan, then move with pride.
Execute safe, verify true,
Restore with care—the rabbit's queue! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'docs: add topic move collector workflow' accurately describes the main change: adding documentation for a new topic move collector workflow.
Description check ✅ Passed The description is mostly complete with Summary, Changes, Test Plan, and Related Issues sections. However, Test Plan items remain unchecked, indicating verification has not been completed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/workflow-topic-move-collector

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added domain/ccm PR touches the ccm domain size/L Large or sensitive change across domains or core paths labels Jun 15, 2026
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.42%. Comparing base (ed7fdd1) to head (9d7db89).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1473   +/-   ##
=======================================
  Coverage   73.42%   73.42%           
=======================================
  Files         753      753           
  Lines       70111    70111           
=======================================
  Hits        51476    51476           
  Misses      14826    14826           
  Partials     3809     3809           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@9d7db890e7f67695e3a3a2e47b525369211ad9c6

🧩 Skill update

npx skills add larksuite/cli#feat/workflow-topic-move-collector -y -g

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@skills/lark-drive/references/lark-drive-workflow-topic-move-collector-execute.md`:
- Line 64: The logic at line 64 references a `create_required=true` condition to
determine whether to create targets before moving, but the `MovePlanItem` schema
definition at lines 149–164 does not include a `create_required` field. Resolve
this inconsistency by either: (1) adding a `create_required` boolean field to
the `MovePlanItem` schema, or (2) rewriting the condition at line 64 to check
`action_type == "create_target"` instead of using the missing `create_required`
field. Ensure the chosen approach is consistently applied in both locations so
the schema and the documented logic match.
- Line 67: The timing description for `rollback_snapshot` recording is
incorrect. Change the statement from "每次移动前记录 `rollback_snapshot`" (record
snapshot before each move) to specify that the snapshot should be built once
before the first write operation, not before each individual move. This aligns
with the established write-operation snapshot contract where the snapshot
captures original locations for the entire confirmed scope upfront, enabling
recovery if any write fails partway through, consistent with how it is
documented in reference workflows like
lark-drive-workflow-knowledge-organize-execution.md.
- Around line 177-192: The ExecutionJournal schema in the execution log section
is missing critical fields required by the recovery workflow. Expand the JSON
schema to include plan_id (to match journal entries to original plan items),
returned_token and returned_parent_token (to identify current resource locations
for recovery operations), task_id (to track async operation completion),
created_by_workflow (to distinguish resources created by this workflow run for
cleanup decisions), and rollback_eligible (to filter reversible operations).
Additionally, restructure the schema by adding journal_id as a stable
identifier, replacing source and target with input_token and returned_token
pairs, adding target_parent_token and returned_parent_token, introducing an
operation field for granular tracking, and changing status to include the
pending state. This alignment ensures the recovery workflow can generate
accurate recovery plans and handle cleanup decisions based on the execution
journal alone.

In `@skills/lark-drive/references/lark-drive-workflow-topic-move-collector.md`:
- Line 120: The CONFIRM_EXECUTION state in the state machine table is missing a
transition back to PLAN_MOVE. According to the UI specification, users can
choose to "adjust plan" (调整计划) from the write operation confirmation UI, which
should return them to the PLAN_MOVE state. Update the "next states" column in
the CONFIRM_EXECUTION row to include PLAN_MOVE in addition to the currently
listed EXECUTE or DONE transitions, reflecting all possible paths a user can
take from that state.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: addb433b-0a41-42e0-b0d1-06eba255a5dd

📥 Commits

Reviewing files that changed from the base of the PR and between 6217bd2 and b0f4c1e.

📒 Files selected for processing (7)
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-execute.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-recall.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-review-plan.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-setup.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector.md
  • skills/lark-wiki/SKILL.md

Comment thread skills/lark-drive/references/lark-drive-workflow-topic-move-collector-execute.md Outdated
Comment thread skills/lark-drive/references/lark-drive-workflow-topic-move-collector-execute.md Outdated
Comment thread skills/lark-drive/references/lark-drive-workflow-topic-move-collector.md Outdated
@YH-1600 YH-1600 force-pushed the feat/workflow-topic-move-collector branch 3 times, most recently from 899c666 to 403ac2d Compare June 15, 2026 12:38

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@skills/lark-drive/references/lark-drive-workflow-topic-move-collector-setup.md`:
- Around line 109-122: Update the `resolve_status` enum in the TargetLocation
schema to properly cover all documented RESOLVE_TARGET outcomes. Add `unknown`
to the enum values since it represents a valid exit state when ambiguity
requires user selection. For the `permission_denied` value, either add
documentation explaining the triggering conditions that produce this outcome, or
remove it if it is not a valid RESOLVE_TARGET result. Additionally, review the
`resolve_status` field definition in review-plan.md to ensure schema consistency
across workflow phases, as it currently shows a different enum there with values
`resolved|partial|failed` which conflicts with the setup.md definition.

In `@skills/lark-drive/references/lark-drive-workflow-topic-move-collector.md`:
- Around line 126-133: The progressive loading table references workflow states
that have not yet been implemented in their corresponding documentation files.
Implement the 5 missing state sections: add the CONFIRM_CONTEXT section to
lark-drive-workflow-topic-move-collector-setup.md (which currently documents
PARSE_INPUT and RESOLVE_TARGET); add the RELEVANCE_CLASSIFY and PLAN_MOVE
sections to lark-drive-workflow-topic-move-collector-review-plan.md (which
currently documents RESOURCE_RESOLVE and CONTENT_VERIFY); and add the VERIFY and
RESTORE sections to lark-drive-workflow-topic-move-collector-execute.md (which
currently documents CONFIRM_EXECUTION and EXECUTE). Note that
lark-drive-workflow-topic-move-collector-recall.md correctly implements both
SEARCH_RECALL and RECALL_ENHANCE states it references. Complete these
implementations before merging this change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5a1153b5-f922-4fdd-817b-f479b599f10d

📥 Commits

Reviewing files that changed from the base of the PR and between 899c666 and 403ac2d.

📒 Files selected for processing (7)
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-execute.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-recall.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-review-plan.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-setup.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector.md
  • skills/lark-wiki/SKILL.md
✅ Files skipped from review due to trivial changes (3)
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-review-plan.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-execute.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-recall.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • skills/lark-wiki/SKILL.md

@YH-1600 YH-1600 force-pushed the feat/workflow-topic-move-collector branch from 403ac2d to dbfa19d Compare June 15, 2026 13:27

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
skills/lark-drive/references/lark-drive-workflow-topic-move-collector-setup.md (1)

109-134: ⚠️ Potential issue | 🟠 Major

permission_denied in resolve_status enum is undocumented in the RESOLVE_TARGET state definition.

Line 120 includes permission_denied in the resolve_status enum for TargetLocation, but the RESOLVE_TARGET state definition (lines 51–77) does not document any condition that produces this status. The must-dos cover token parsing and marking unsupported move directions, but do not specify when permission is checked or when permission_denied would be returned.

Either document the condition that triggers permission_denied, or remove it from the enum if it is not a valid outcome. Note that in review-plan.md, permission concerns appear to be handled through a separate permission_state field, suggesting permission_denied may belong there rather than in resolve_status.

Additionally, TargetLocation.resolve_status (setup.md) and ResourceItem.resolve_status (review-plan.md) use the same field name with different enum values (resolved|ambiguous|unsupported|permission_denied vs. resolved|partial|failed). While these serve different purposes in different lifecycle phases, reusing the same field name with conflicting enums is error-prone. Consider renaming one field for clarity (e.g., target_resolve_status vs. item_resolve_status).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@skills/lark-drive/references/lark-drive-workflow-topic-move-collector-setup.md`
around lines 109 - 134, The `resolve_status` enum in the TargetLocation
definition includes `permission_denied` as a possible value, but the
RESOLVE_TARGET state definition does not document any condition that would
produce this status or when permission checking occurs. Either add documentation
to the RESOLVE_TARGET state explaining the condition that triggers
`permission_denied` (describing when and how permissions are checked), or remove
`permission_denied` from the TargetLocation resolve_status enum if it is not a
valid outcome for this lifecycle phase. Additionally, the same field name
`resolve_status` is reused in both TargetLocation and ResourceItem with
different enum values (resolved|ambiguous|unsupported|permission_denied versus
resolved|partial|failed), which creates confusion and error-prone code. To
address this, rename one of these fields for clarity—consider using
`target_resolve_status` for TargetLocation and `item_resolve_status` for
ResourceItem—to make their distinct purposes and value sets explicit.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@skills/lark-drive/references/lark-drive-workflow-topic-move-collector-setup.md`:
- Around line 109-134: The `resolve_status` enum in the TargetLocation
definition includes `permission_denied` as a possible value, but the
RESOLVE_TARGET state definition does not document any condition that would
produce this status or when permission checking occurs. Either add documentation
to the RESOLVE_TARGET state explaining the condition that triggers
`permission_denied` (describing when and how permissions are checked), or remove
`permission_denied` from the TargetLocation resolve_status enum if it is not a
valid outcome for this lifecycle phase. Additionally, the same field name
`resolve_status` is reused in both TargetLocation and ResourceItem with
different enum values (resolved|ambiguous|unsupported|permission_denied versus
resolved|partial|failed), which creates confusion and error-prone code. To
address this, rename one of these fields for clarity—consider using
`target_resolve_status` for TargetLocation and `item_resolve_status` for
ResourceItem—to make their distinct purposes and value sets explicit.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d2b6ea91-2a57-4c80-b246-2e54eb1dd807

📥 Commits

Reviewing files that changed from the base of the PR and between 403ac2d and dbfa19d.

📒 Files selected for processing (7)
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-execute.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-recall.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-review-plan.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-setup.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector.md
  • skills/lark-wiki/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • skills/lark-wiki/SKILL.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-review-plan.md
  • skills/lark-drive/references/lark-drive-workflow-topic-move-collector-recall.md

@YH-1600 YH-1600 force-pushed the feat/workflow-topic-move-collector branch 4 times, most recently from ae8ec8a to 32524a8 Compare June 16, 2026 08:46
YH-1600 added 2 commits June 16, 2026 19:48
Change-Id: Ifc6c8d0b90faabff1136d92db1bc7e5556e77d85
Change-Id: I13992bfa82acaeafb4e5fce460ae47ec8c6ad3af
@YH-1600 YH-1600 force-pushed the feat/workflow-topic-move-collector branch from 32524a8 to 5dde10f Compare June 16, 2026 11:56
Change-Id: Id0b8988d3f0385af36bd721549299928a17fbe76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/ccm PR touches the ccm domain size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant