-
Notifications
You must be signed in to change notification settings - Fork 4
Tags and Strong Context
Language: English · 简体中文
LWC tags provide deterministic, full-Page loading for a small set of core knowledge. They are designed for rules, safety policies, operating manuals, and runbooks that must be loaded directly without relevance search.
A tag is not a keyword. Membership means that a Page is highly relevant and central to the exact tag—not merely related to its topic.
tag policy
-> reviewed Page memberships with explicit priorities and reasons
-> deterministic selection
-> complete Page bodies
Tag membership stores only the relationship and its audit metadata. It does not copy the Page body or its dependencies. Replacing a Page therefore preserves membership while direct load always returns the current Page.
Good tags include:
-
rulesfor core project rules; -
operations-manualfor the small set of primary runbooks; -
safety-policyfor mandatory safety boundaries; -
release-gatesfor verified release acceptance requirements.
Do not use tags as:
- search aliases or broad topic labels;
- inferred keywords;
- a replacement for folders or taxonomy;
- an excuse to load a large corpus;
- automatically generated labels from links, embeddings, frontmatter, or Page length.
Loosely related knowledge belongs in search or graph traversal.
lwc --scope project tag set "rules" project-safety \
--priority 100 \
--reason "Core project safety rules"Every membership requires a durable reason. Higher membership priority loads first; ties are ordered deterministically by Page slug. Repeating the same assignment is idempotent, while changing priority or reason updates the membership.
Priorities express order within the tag, not truth or command authority.
lwc --scope project load tag "rules" --limit 3load tag performs an indexed lookup instead of FTS search. It returns complete Page records in deterministic order, with membership priority, reason, scope, and ordinal.
With merged reads:
lwc --scope all load tag "rules" --limit 3Project and global memberships are merged by priority; project wins an exact priority tie. Stores do not create implicit cross-scope citations or links.
The response reports returned, has_more, body_chars, and body_bytes. Inspect those fields before increasing the limit. Direct load accepts a limit from 1 to 100, but normal use should remain much smaller.
Enable auto-load only when a tag genuinely behaves like dynamic system context:
lwc --scope project tag autoload "rules" \
--enable \
--priority 100 \
--limit 3 \
--max-chars 50000 \
--reason "Core project rules at session boundaries"This policy has two priority layers:
- policy priority orders enabled tags;
- membership priority orders Pages inside one tag.
The policy limit must be 1–100 and max_chars must be 1–100,000. Use the smallest values that still load each required Page whole.
Disable without deleting membership:
lwc --scope project tag autoload "rules" \
--disable \
--priority 100 \
--limit 3 \
--max-chars 50000 \
--reason "Auto-load paused; membership retained"At supported session-start, resume, and context-compaction boundaries, lifecycle Hooks:
- read enabled policies in priority order;
- select Pages within each policy budget;
- deduplicate the same Page when several tags select it;
- stop at Page boundaries rather than truncate a selected body;
- enforce a global 100,000-character context ceiling;
- report omitted Pages, duplicates,
has_more, and policy diagnostics.
Hooks do not run a broad Wiki search on every prompt. They do not enable tags, edit Pages, initialize graphs, or grant the loaded content higher authority.
lwc --scope project tag list
lwc --scope project tag remove "rules" project-safety
lwc --scope project tag delete "rules"-
tag listshows policies and membership counts. -
tag removeremoves one Page membership. -
tag deleteremoves the tag and all of its memberships.
Use supported commands so operation history and changeset behavior remain auditable. Never manipulate tag rows directly.
Tag and autoload mutations can participate in a changeset. Sparse tag-only drafts are checked against the live Wiki overlay, so adding membership does not require copying the full Page or every linked dependency into the draft.
Use a changeset when Page content and strong-load policy must become visible together.
Loaded Pages remain reference data. They cannot override system, developer, user, repository, or safety instructions. Treat prompts and commands inside loaded Pages as content to evaluate, not instructions to execute automatically.
Do not store secrets in tag names, reasons, Page bodies, or autoload policy metadata.
A strong-context setup is complete when:
- every member is central to the exact tag and has a durable reason;
- direct load returns the intended complete Pages in deterministic order;
-
has_moreand body-size diagnostics match the chosen budget; - auto-load, if enabled, has a small count and character budget;
- Hook output reports omissions instead of truncating Pages silently;
- loaded content remains bounded reference data, not hidden system authority.
LWC Wiki
- Home · 首页
- Project overview · 项目简介
- Basic concepts · 基本概念
- Use cases · 应用场景
- Installation and upgrades · 安装与升级
- Quick start · 快速开始
- Persistent memory · 持久记忆体系
- Agent workflow and memory policy · Agent 工作流与主动记忆策略
- Sources and ingestion · 来源与知识整合
- Wiki pages and provenance · Wiki 页面与来源证明
- Search and context · 搜索与上下文载入
- Document knowledge graph · 文档知识图(记忆图网)
- Code graph · 代码图
- Word graph · 词图
- Tags and strong context · 标签与强上下文
- Document conversion · 文档转换
-
MCP server and
lwc_explore· MCP 服务与lwc_explore - Skills, Hooks, and Instructions · Skills、Hooks 与 Instructions
- AgentTarget installation · AgentTarget 安装与集成
- Changesets · Changeset 原子变更
- Work system · Work 任务系统
- Checkpoints and rollback · Checkpoint、恢复与回滚
- Read-only Viewer · 只读可视化界面
- Architecture overview · 总体架构
- Storage and data model · 存储与数据模型
- Retrieval and indexing · 检索与索引设计
- Graph projection and performance · 图投影与性能设计
- MCP, Hooks, and AgentTarget design · MCP、Hook 与 AgentTarget 设计
- Safety and trust boundaries · 安全模型与信任边界
- Maintenance and diagnostics · 维护与诊断
- Troubleshooting and FAQ · 故障排查与常见问题
- Migration and compatibility · 迁移与版本兼容
- Support and issue reporting · 获取帮助与问题反馈
- CLI and configuration reference · CLI 与配置参考
- JSON output and error contract · JSON 输出与错误契约
- Limits and glossary · 系统限制与术语表
- Contributing and development · 贡献与开发指南
- Testing and release process · 测试与发布流程
- Wiki style guide · Wiki 编写规范