Skip to content

chore: lark-cli docs support reference_map#1690

Merged
SunPeiYang996 merged 3 commits into
mainfrom
codex/html5-block-reference-map-core
Jul 2, 2026
Merged

chore: lark-cli docs support reference_map#1690
SunPeiYang996 merged 3 commits into
mainfrom
codex/html5-block-reference-map-core

Conversation

@SunPeiYang996

@SunPeiYang996 SunPeiYang996 commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add internal docs v2 reference_map request and response plumbing
  • preserve sidecar reference payloads through create, update, and fetch flows
  • keep public-facing descriptions generic while the feature remains gated by service behavior

Scope

This PR intentionally contains only the first reference_map plumbing commit from the working branch.

Validation

  • remote unit tests for docs shortcuts
  • remote lint for docs shortcuts
  • remote targeted docs v2 dry-run e2e coverage

Summary by CodeRabbit

  • New Features
    • Added --reference-map support for docs v2 create/update (inline JSON, @relative-file.json, or - for stdin) and introduced end-to-end html5-block handling, including fetch-time processing and optional large-HTML materialization.
  • Bug Fixes
    • Improved v2 create/update validation and request-building behavior (dry-run now surfaces request-body build errors).
    • Ensure html5-block is ignored inside markdown fenced code blocks during fetch.
  • Documentation
    • Updated CLI help and reference docs for --reference-map requirements.
  • Tests
    • Expanded v2 test coverage for html5-block, flag behavior, and fetch/update/create rewriting.

@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 30, 2026
@coderabbitai

This comment has been minimized.

@codecov

This comment has been minimized.

@SunPeiYang996
SunPeiYang996 force-pushed the codex/html5-block-reference-map-core branch from bc40989 to 9d0402b Compare June 30, 2026 12:29
@SunPeiYang996
SunPeiYang996 marked this pull request as ready for review June 30, 2026 12:29
@github-actions

This comment has been minimized.

coderabbitai[bot]

This comment was marked as outdated.

@SunPeiYang996
SunPeiYang996 force-pushed the codex/html5-block-reference-map-core branch from 9d0402b to 73fd00e Compare June 30, 2026 12:41
coderabbitai[bot]

This comment was marked as outdated.

Comment thread shortcuts/doc/docs_fetch_v2.go Outdated
Comment thread skills/lark-doc/references/lark-doc-create.md Outdated
Comment thread shortcuts/doc/docs_update_v2.go

@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 `@shortcuts/doc/docs_fetch_v2_test.go`:
- Around line 582-608: The test
TestDocsFetchIMMarkdownIgnoresHTML5BlockInsideCodeFence only verifies success
and valid JSON, but it never asserts that the fenced html5-block was left
untouched. Update the test to inspect the decoded envelope from mountAndRunDocs
and confirm the response content still contains the original fenced
<html5-block> markup (or equivalent unchanged content), and that no error field
or reference-resolution side effect appears. Use the existing registerDocsAIStub
fixture and the parsed envelope variable to make the assertion explicit.

In `@shortcuts/doc/docs_update_test.go`:
- Around line 67-88: The dry-run test is asserting only a message substring from
the serialized error string, which cannot verify typed error metadata. Update
TestDocsUpdateDryRunReportsReferenceMapBuildError to call
buildUpdateBodyWithHTML5ReferenceMap(runtime) directly instead of relying on
dryRunUpdateV2, then assert the returned error with errs.ProblemOf for
category/subtype/param and confirm the underlying cause is preserved. Keep the
existing html5-block/missing reference setup, but remove the strings.Contains
check and any JSON envelope assertions that hide typed metadata.
🪄 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: 2ce7fc74-54c1-40a8-9e09-0658a3f49dd9

📥 Commits

Reviewing files that changed from the base of the PR and between 73fd00e and e008321.

📒 Files selected for processing (9)
  • shortcuts/doc/docs_create_v2.go
  • shortcuts/doc/docs_fetch_v2.go
  • shortcuts/doc/docs_fetch_v2_test.go
  • shortcuts/doc/docs_update_test.go
  • shortcuts/doc/docs_update_v2.go
  • shortcuts/doc/html5_block_resources.go
  • shortcuts/doc/html5_block_resources_test.go
  • skills/lark-doc/references/lark-doc-create.md
  • skills/lark-doc/references/lark-doc-update.md
✅ Files skipped from review due to trivial changes (2)
  • skills/lark-doc/references/lark-doc-update.md
  • skills/lark-doc/references/lark-doc-create.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • shortcuts/doc/docs_fetch_v2.go
  • shortcuts/doc/docs_create_v2.go
  • shortcuts/doc/docs_update_v2.go
  • shortcuts/doc/html5_block_resources_test.go
  • shortcuts/doc/html5_block_resources.go

Comment thread shortcuts/doc/docs_fetch_v2_test.go
Comment thread shortcuts/doc/docs_update_test.go Outdated
@SunPeiYang996
SunPeiYang996 force-pushed the codex/html5-block-reference-map-core branch from da14cf2 to fdc3273 Compare July 2, 2026 04:24
@SunPeiYang996
SunPeiYang996 merged commit 075b34f into main Jul 2, 2026
44 of 48 checks passed
@SunPeiYang996
SunPeiYang996 deleted the codex/html5-block-reference-map-core branch July 2, 2026 05:07
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.

2 participants