Skip to content

docs(im): trim leaf references to non-derivable content - #2134

Open
luozhixiong01 wants to merge 11 commits into
feat/im-agent-reliability-closeoutfrom
docs/slim-im-leaf-references
Open

docs(im): trim leaf references to non-derivable content#2134
luozhixiong01 wants to merge 11 commits into
feat/im-agent-reliability-closeoutfrom
docs/slim-im-leaf-references

Conversation

@luozhixiong01

Copy link
Copy Markdown
Collaborator

Summary

The nine leaf references under skills/lark-im/ restated large amounts of content that --help and schema already emit — parameter tables, field tables, response-shape examples, scope tables, command inventories. That content costs an agent context on every read and goes stale independently of the CLI. This PR rewrites each file to carry only what the authoritative sources cannot express, and drops ## 权限表 from SKILL.md.

Net effect: 27279 → 12167 tokens (−55.4%) across the nine files, with no measurable capability loss (see Test Plan).

Changes

  • Rewrote nine skills/lark-im/references/ files to non-derivable content only; each now opens with a one-line pointer at --help / schema and keeps three kinds of content:
    • Gotchas the authority cannot state — cross-method asymmetries (reaction_type nesting differs across the four reaction methods), caller-identity constraints, counter-intuitive defaults (+threads-messages-list defaults to asc while +chat-messages-list defaults to desc), command-selection boundaries (+chat-search searches chats, +chat-list lists the ones you are in).
    • Contract and recovery semanticsretry_scope=none forbids replaying a write; meta.complete is the only proof a read was exhaustive.
    • HELP-GAP sections — facts the authority should carry but does not yet (e.g. the complete emoji_type key list). These are marked as explicit debt, not a permanent home.
  • Removed ## 权限表 from skills/lark-im/SKILL.md. references/skill-quality-standard.md §8.1 lists "no scope/permission mapping table" as non-waivable, and all 36 scopes were verified retrievable from schema (36/36).
  • Preserved the ## Safety Constraints sections in messages-send.md and messages-reply.md byte-for-byte — verified by section-level comparison against the base, not by keyword grep.

Per-file token reduction (tiktoken cl100k_base):

File Before After Cut
lark-im-messages-send.md 4837 1928 60%
lark-im-feed-groups.md 4836 2085 57%
lark-im-messages-reply.md 4444 2030 54%
lark-im-messages-search.md 3014 1385 54%
lark-im-reactions.md 3030 1553 49%
lark-im-chat-messages-list.md 2434 1148 53%
lark-im-chat-create.md 2519 897 64%
lark-im-chat-search.md 1933 972 50%
lark-im-chat-list.md 2232 1175 47%

SKILL.md: 6506 → 5892 (permission table only).

Test Plan

  • Unit tests pass (go test excluding E2E packages)

  • go build ./...

  • Skill eval, un-slimmed vs slimmed, three rounds each — real execution against the test tenant, 18 cases / 72 numbered judgment points, model gpt-5.5:

    Arm Rounds (max 72) Mean
    Un-slimmed 62 / 64 / 65 63.7
    Slimmed 65 / 62 / 66 64.3

    The two distributions overlap completely. At judgment-point level, zero true regressions (criterion: passes all three un-slimmed rounds and fails all three slimmed rounds). Ten of eighteen cases score full marks in both arms, covering idempotency contracts, prompt-injection isolation, approval semantics, the resource-download switch, read-completeness criteria, and feed rule semantics.

    Scope of that claim: this is "no loss was measured", not "equivalence was proven" — 15 of 72 judgment points are unstable across rounds, so differences on the order of 1–2 points are below the resolution of this experiment.

  • Mechanical assertion that no non-derivable fact was lost: every identifier in the frozen must-keep baseline still present in all nine files. The assertion deliberately does not recompute derivability against a fresh oracle — a widened oracle would let a genuinely lost fact pass.

  • Token floor gate on all nine files (34% floor, actual 47–64%)

Related Issues

  • None

review added 11 commits July 31, 2026 18:03
The eval showed an agent guessing a conventional page size instead of
consulting schema. The file did carry a schema pointer, but a generic one
-- "run schema for the authoritative parameters" does not tell the agent
which field to look up, so it never looked.

Name the two fields (queries[].page_token, page_size_per_message), say
they live under --data, and bind them to the rule that a batch fragment is
not a complete reaction set. The values themselves stay in schema.
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 49423ddd-f471-402a-9771-19133ca843fe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


review seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions Bot added domain/im PR touches the im domain size/XL Architecture-level or global-impact change labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/im PR touches the im domain size/XL Architecture-level or global-impact change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants