Skip to content

feat(note): clarify note ownership with dedicated detail and transcript flows#1435

Merged
Ren1104 merged 3 commits into
mainfrom
feat/note-domain-split
Jun 12, 2026
Merged

feat(note): clarify note ownership with dedicated detail and transcript flows#1435
Ren1104 merged 3 commits into
mainfrom
feat/note-domain-split

Conversation

@Ren1104

@Ren1104 Ren1104 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reintroduce the Note domain split after #1417 consolidated the logic back into vc. This restores note +detail and note +transcript as the canonical known-note_id entry points while keeping vc +notes responsible for locating notes from meeting context.

Changes

  • Add shortcuts/note with note +detail and note +transcript, including unified transcript pagination, cursor-cycle protection, typed errors, and dry-run E2E coverage.
  • Update vc +notes to delegate note-detail parsing to the note domain and surface note_id / note_display_type for downstream routing.
  • Restore auth/login metadata, typed-error lint coverage, and lark skill routing docs for lark-note, lark-vc, lark-minutes, and the vc-transcribe-tab doc boundary.

Test Plan

  • Unit tests pass: go test ./shortcuts/note ./shortcuts/vc ./cmd/auth ./tests/cli_e2e/note
  • Manual local verification confirms the lark-cli <domain> <command> flow works as expected: git diff --cached --check before commit and dry-run E2E coverage for note +detail / note +transcript

Related Issues

Summary by CodeRabbit

  • New Features

    • Added note +detail and note +transcript commands for fetching note details and unified transcripts; shortcuts are now registered and available.
    • vc +notes output now includes note_id and note_display_type to improve routing and results.
  • Documentation

    • Comprehensive note skill docs and reference guides added; VC/minutes/workflow docs updated to clarify note/transcript routing.
  • Tests

    • Added dry-run and unit test coverage for note commands and transcript flow.

@Ren1104 Ren1104 requested a review from liangshuo-1 as a code owner June 12, 2026 07:31
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new note shortcut domain (detail and transcript commands), implements note-detail parsing and transcript pagination, delegates vc +notes to the note package, registers the shortcuts, updates lint rules, adds documentation, and provides unit, integration-style, and dry-run tests.

Changes

Note Domain Feature

Layer / File(s) Summary
Authentication and shortcut registration
cmd/auth/login_messages.go, cmd/auth/login_test.go, internal/registry/service_descriptions.json, shortcuts/register.go
Adds note to the shortcut-only domains, registers note service descriptions, and wires note.Shortcuts() into global registration.
Note package core: types & FetchDetail
shortcuts/note/note.go
Implements Detail, FetchDetail, token extraction, display-type normalization, Detail.ToMap(), and tolerant JSON parsing helpers (parseLooseInt, parseLooseCursorID).
note +detail shortcut command
shortcuts/note/note_detail.go
Implements note +detail with --note-id validation, DryRun API description, FetchDetail execution, and permission-error normalization via mapNoteError.
note +transcript command
shortcuts/note/note_transcript.go
Implements note +transcript with format/locale flags, default output path, overwrite checks, ensure-unified validation, cursor-based pagination with cycle detection and throttling, context-to-network error mapping, and transcript file writing.
note +transcript tests and helpers
shortcuts/note/note_transcript_test.go
Adds tests covering unified-note precondition, successful transcript download, format/locale behavior, overwrite rejection, empty transcript rejection, cursor-cycle detection, context-error mapping, and supporting test helpers/stubs.
Note unit tests
shortcuts/note/note_test.go
Unit tests for parsing helpers, token extraction, Detail.ToMap, mapNoteError normalization, empty-detail sentinel behavior, and Shortcuts() shape.
Shortcuts entry & registration
shortcuts/note/shortcuts.go, shortcuts/register.go
Exports Shortcuts() and appends note.Shortcuts() into the global allShortcuts.
VC +notes refactor
shortcuts/vc/vc_notes.go, shortcuts/vc/vc_notes_test.go
Refactors fetchNoteDetail to call note.FetchDetail, treats note_id as actionable payload, adds note_id/note_display_type to outputs, removes local artifact parsing, and updates tests/stubs.
Lint updates and tests
lint/errscontract/*
Expands migrated-path lists for legacy-helper lint rules, reorders envelope path list for consistency, and adds a test ensuring migrated-envelope paths are covered by migrated-common-helper paths.
Documentation and skills
skills/*, skills/lark-note/*, skills/lark-vc/*, skills/lark-doc/*, skills/lark-minutes/*
Adds lark-note skill spec and reference docs for detail/transcript; updates other skill docs and routing guidance to route by note_display_type and define domain boundaries.
E2E dry-run tests and coverage doc
tests/cli_e2e/note/*
Adds dry-run E2E tests verifying API request shapes for note +detail and note +transcript and a coverage document recording dry-run coverage and live coverage status.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • larksuite/cli#333: Overlaps vc +notes calendar-event flow and token/payload interpretation changes.
  • larksuite/cli#1234: Modifies fetchNoteDetail error handling and API call patterns overlapping shortcuts/vc/vc_notes.go.
  • larksuite/cli#1345: Adds similar note-domain split and related wiring.

Suggested labels

feature, documentation

Suggested reviewers

  • zhaoleibd
  • liangshuo-1

Poem

🐰 A tiny note hops into place,
Commands to fetch its time and trace,
Transcripts paged, details shown,
Docs and tests to make it known,
Hooray — a helpful CLI embrace.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.98% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description covers all required template sections: Summary (motivation and scope in 2 sentences), Changes (3 bullet points detailing specific additions), Test Plan (2 verified checkboxes), and Related Issues (links #1345 and #1417).
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.
Title check ✅ Passed The title accurately describes the primary change: adding note detail and transcript shortcuts to the note domain.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/note-domain-split

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 domain/vc PR touches the vc domain size/L Large or sensitive change across domains or core paths labels Jun 12, 2026
@Ren1104 Ren1104 mentioned this pull request Jun 12, 2026
2 tasks
@Ren1104 Ren1104 requested a review from zhaoleibd June 12, 2026 07:33
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@7087526571b57b522a76a8d755b7452bf450f773

🧩 Skill update

npx skills add larksuite/cli#feat/note-domain-split -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: 1

Caution

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

⚠️ Outside diff range comments (2)
lint/errscontract/rules_test.go (1)

953-965: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a direct shortcuts/note/ rejection case to the helper-rule behavior test.

You added shortcuts/note/ to migrated production paths, but TestCheckNoLegacyCommonHelperCall_RejectsLegacyHelpersOnMigratedPath still doesn’t exercise a shortcuts/note/... file path. The new set-inclusion test is useful for drift, but it doesn’t validate runtime rule behavior for note paths.

As per coding guidelines: “Every behavior change needs a test alongside the change.”

Also applies to: 992-1002

🤖 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 `@lint/errscontract/rules_test.go` around lines 953 - 965, The test
TestCheckNoLegacyCommonHelperCall_RejectsLegacyHelpersOnMigratedPath is missing
a runtime rejection case for the new shortcuts/note migration; update the test
by adding a representative note path (e.g. "shortcuts/note/note_create.go" or
"shortcuts/note/note_update.go") to the paths slice used for rejection
assertions in that test (and the corresponding sibling test around lines
992-1002 if it mirrors cases), so the helper-rule behavior test actually
exercises and expects rejection for shortcuts/note files.

Source: Coding guidelines

skills/lark-vc/references/vc-domain-boundaries.md (1)

52-57: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Scope the “prefer Note over Minutes” rule.

The new priority sentence reads like Note should win whenever content overlaps, but the preceding bullet says transcript/summarization requests must start from the original dialogue record and must not use note_doc_token as the final output. Please narrow this rule to metadata/duplicate views so it can’t override the transcript-first path.

🤖 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-vc/references/vc-domain-boundaries.md` around lines 52 - 57,
Summary: The "优先查询智能纪要(Note)" rule is too broad and may override the
transcript-first requirement for summarization; constrain it. Fix: revise the
priority sentence so it explicitly applies only to metadata/duplicate-view
queries (e.g., to-dos, chapters, quick previews) and NOT to
transcript/summarization/rewriting requests; add an explicit exception line
stating that for any "提炼/总结/重新总结/整理/回顾" flows the system must start from the
original transcript/minutes and must not use note_doc_token or Note as the sole
source of content, while still allowing Note to be preferred for metadata,
deduped views, or UX-friendly displays (to-dos, chapters); reference strings:
"智能纪要(Note)", "妙记(Minutes)", "note_doc_token", and the transcript/summarization
bullet to locate the text to change.
🤖 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-workflow-meeting-summary/SKILL.md`:
- Around line 77-81: 补全对 note_display_type=unknown 的路由说明:当 note_display_type 为
unknown 且 verbatim_doc_token 非空 时,按 normal 路径处理——使用 docs +fetch --api-version v2
--doc <verbatim_doc_token> 获取逐字稿,不应当假定为 unified;当 unknown 且无 verbatim_doc_token
时,先调用 lark-cli note +detail --note-id <note_id> 复核返回的展示类型并按其路由(或按 note
+transcript --note-id <note_id> 拉取逐字稿内容);若复核后仍无法确定逐字稿入口,则在文档中明确说明无法获取逐字稿并如实告知用户。

---

Outside diff comments:
In `@lint/errscontract/rules_test.go`:
- Around line 953-965: The test
TestCheckNoLegacyCommonHelperCall_RejectsLegacyHelpersOnMigratedPath is missing
a runtime rejection case for the new shortcuts/note migration; update the test
by adding a representative note path (e.g. "shortcuts/note/note_create.go" or
"shortcuts/note/note_update.go") to the paths slice used for rejection
assertions in that test (and the corresponding sibling test around lines
992-1002 if it mirrors cases), so the helper-rule behavior test actually
exercises and expects rejection for shortcuts/note files.

In `@skills/lark-vc/references/vc-domain-boundaries.md`:
- Around line 52-57: Summary: The "优先查询智能纪要(Note)" rule is too broad and may
override the transcript-first requirement for summarization; constrain it. Fix:
revise the priority sentence so it explicitly applies only to
metadata/duplicate-view queries (e.g., to-dos, chapters, quick previews) and NOT
to transcript/summarization/rewriting requests; add an explicit exception line
stating that for any "提炼/总结/重新总结/整理/回顾" flows the system must start from the
original transcript/minutes and must not use note_doc_token or Note as the sole
source of content, while still allowing Note to be preferred for metadata,
deduped views, or UX-friendly displays (to-dos, chapters); reference strings:
"智能纪要(Note)", "妙记(Minutes)", "note_doc_token", and the transcript/summarization
bullet to locate the text to 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: aea4f848-ed4a-4e89-92d8-e36e44330447

📥 Commits

Reviewing files that changed from the base of the PR and between 8e60f01 and 417bf4c.

📒 Files selected for processing (26)
  • cmd/auth/login_messages.go
  • cmd/auth/login_test.go
  • internal/registry/service_descriptions.json
  • lint/errscontract/rule_no_legacy_common_helper_call.go
  • lint/errscontract/rule_no_legacy_envelope_literal.go
  • lint/errscontract/rules_test.go
  • shortcuts/note/note.go
  • shortcuts/note/note_detail.go
  • shortcuts/note/note_test.go
  • shortcuts/note/note_transcript.go
  • shortcuts/note/note_transcript_test.go
  • shortcuts/note/shortcuts.go
  • shortcuts/register.go
  • shortcuts/vc/vc_notes.go
  • shortcuts/vc/vc_notes_test.go
  • skills/lark-doc/SKILL.md
  • skills/lark-minutes/SKILL.md
  • skills/lark-note/SKILL.md
  • skills/lark-note/references/lark-note-detail.md
  • skills/lark-note/references/lark-note-transcript.md
  • skills/lark-vc/SKILL.md
  • skills/lark-vc/references/lark-vc-notes.md
  • skills/lark-vc/references/vc-domain-boundaries.md
  • skills/lark-workflow-meeting-summary/SKILL.md
  • tests/cli_e2e/note/coverage.md
  • tests/cli_e2e/note/note_dryrun_test.go

Comment thread skills/lark-workflow-meeting-summary/SKILL.md
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.12925% with 79 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.87%. Comparing base (510545f) to head (7087526).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/note/note_transcript.go 64.39% 35 Missing and 12 partials ⚠️
shortcuts/note/note.go 86.13% 12 Missing and 2 partials ⚠️
shortcuts/note/note_detail.go 66.66% 10 Missing and 4 partials ⚠️
shortcuts/vc/vc_notes.go 69.23% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1435      +/-   ##
==========================================
+ Coverage   72.83%   72.87%   +0.04%     
==========================================
  Files         732      737       +5     
  Lines       69140    69446     +306     
==========================================
+ Hits        50356    50609     +253     
- Misses      15003    15037      +34     
- Partials     3781     3800      +19     

☔ 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.

@Ren1104 Ren1104 force-pushed the feat/note-domain-split branch from 9368848 to 7087526 Compare June 12, 2026 08:16
@Ren1104 Ren1104 changed the title feat: split note domain feat(note): add note detail and transcript shortcuts Jun 12, 2026
@Ren1104 Ren1104 changed the title feat(note): add note detail and transcript shortcuts feat(note): clarify note ownership with dedicated detail and transcript flows Jun 12, 2026
@Ren1104 Ren1104 merged commit 7c64e63 into main Jun 12, 2026
43 of 47 checks passed
@Ren1104 Ren1104 deleted the feat/note-domain-split branch June 12, 2026 08:30
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 domain/vc PR touches the vc 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.

2 participants