Repository navigation
Conversation
…er names A skill is a folder: a root SKILL.md whose YAML frontmatter names and describes it, plus text files beside it. skill.check takes the folder as (path, text) pairs and answers one report: every package rule the folder breaks (refusals), what it holds that a reader should see (findings), the content hash, and each operation and MCP tool name its code spans give, with whether the serving build holds it, the role it needs and how MCP serves it. The op reads no row and writes none; a bad package is ok=false, never an error. ok says the rules pass, not that the text is safe to follow. The rules are one pure module, server/identity/domain/skill_format.py, so a later save and read can hold a package to the same rule set. The frontmatter is checked on the parser's events and on the composed nodes before a value is built: an anchor, an alias, a merge key, an explicit tag, a second document, a repeated key and nesting deeper than eight levels are refused. The Python SDK gains loom.skills.read_folder, which opens regular files only and follows no link, and the command `loom skill check <dir>`: exit 0 when the rules pass, 1 on a refusal, 2 when the folder cannot be read or the server does not serve the op. tests/unit/test_agent_instructions.py takes operation names through the same function as the server, and scripts/codegen/served_skills.py reads the two size limits from the rules module. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ations.check main added knowledge.citations.check. Three generated files conflicted (docs/reference/operations.md, sdk/go/wire/models.gen.go, sdk/rust/src/wire_models.rs) and three merged out of the generators' order (docs/reference/status.md, the Ruby and TypeScript op tables). All six are regenerated from the merged registry, and every generator check passes. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
main changed an op description beside the lines skill.check added, so sdk/go/wire/models.gen.go conflicted. It is regenerated, and every generator check passes on the merged tree. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6522dd7. Configure here.
| try: | ||
| fd = os.open(full, os.O_RDONLY | os.O_NONBLOCK | getattr(os, "O_NOFOLLOW", 0)) | ||
| except OSError as e: | ||
| raise FolderError(f"{rel}: cannot be opened without following a link") from e |
There was a problem hiding this comment.
Open failures reported as symlinks
Low Severity
Any OSError from opening a skill file is replaced with "cannot be opened without following a link". Permission errors, missing files, and I/O errors are all reported as symlink failures, and loom skill check prints only that text.
Reviewed by Cursor Bugbot for commit 6522dd7. Configure here.
…olds Text past a size limit is refused and not read. The content rules do not run on a file over the file limit. For a package over its byte or file limit they run on no file, and no hash and no operation is answered. The path and size rules read no text and the frontmatter has its own limit, so those rules still answer. The rules answer a request of 80 files of 400,000 characters in 4 ms. - `mcp` is `tool` wherever a toolset lists the op, so `memory.search` and `knowledge.search` are `tool` with `toolsets: ["assistant"]`, and their tool names are known. - `content_control` is applied to every string the frontmatter yields, as `hidden_text` is: a quoted YAML value can spell a control character with an escape. - `name` is answered only when it passes the name rule, so the request ledger keeps a name and never a line of a file. - Every message about a file whose path is invalid names the entry's place in the request, not the path. - `loom skill check` prints each character that is not printable as its escape, so a file name cannot send a control sequence to the terminal. - `read_folder` opens a file where `os` has no `O_NONBLOCK`, and with `O_BINARY` where that exists. - The page states the secret rule as the detector reads it. - The integration test mints its token with the `mint_test_token` fixture. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…urator `main` adds the `curator` op group and the `loom curator` command where this branch adds `skill` and `loom skill`. The op module list, the two command lists and the command's help keep both, `curator` first. The generated files that conflicted are regenerated from the merged registry, not edited by hand: the Rust and Go SDKs, the TypeScript and Ruby op tables, the command snapshots, and the reference pages for the commands, the operations and their status. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Part of: #1143
Part of: #1769
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
skill.check(experimental) takes a skill folder, aSKILL.mdand the text files beside it, and reports every package rule the folder breaks, its content hash, and which operations and MCP tools its text names that the serving build does not hold.loom skill check <dir>reads a folder and prints the report.Why
A team keeps its agent skills as folders: a
SKILL.mdwhose YAML frontmatter names and describes the skill, plus text files. Nothing says whether such a folder is a package Loom accepts, or which operations it names that the serving build does not hold; the agent finds out at the call. A skills library needs one rule set that the check, a later save and a later read share, and that rule set can be written and tested before any table exists.Design note: the
skillop groupWhat. A new op group,
skill, with one op,skill.check. The input isnamespaceandfiles: [{path, text}]. The answer is always a report: a bad package isok=falsewithrefusals, never an error, and every refusal of the folder is answered in one call, except that text past a size limit is refused and not read. The op reads no stored row and writes none.server/identity/domain/skill_format.py.check_package(files)answers the refusals, the findings,name,description, the content hash, the byte count and the file count.operation_mentions(text, op_groups)takes the operation and tool names out of a text's code spans; it reads no registry, so a repository test and the server take the same names from one text.server/identity/app/skills.py, adds what only the serving build knows: for each name, whether the registry holds it, the role it needs, and how MCP serves it (tool,loom_opornone). It istoolwherever a toolset lists the op:memory.searchandknowledge.search, which only the assistant toolset lists, aretoolwithtoolsets: ["assistant"], and their tool names are known.{code, path, line, message}; the message names the file, the line and the rule, never a value. A file whose path ispath_invalidis named in every message by its place in the request, and its path is answered only inpath.oksays the package rules pass. It does not say the text is safe to follow, and the op description, the generated page, the command's help and its last line all say so.Refusal codes:
no_skill_md,nested_skill,path_invalid,path_duplicate,path_hidden,path_host_dir,file_type,content_control,hidden_text,frontmatter_missing,frontmatter_too_large,frontmatter_shape,frontmatter_unloadable,frontmatter_key,frontmatter_value,name_invalid,shell_form,secret,file_too_large,skill_too_large,too_many_files. Finding codes, which never changeok:html_comment,encoded_run,external_link,path_reference,format_character,bom_before_frontmatter,key_not_in_format.docs/architecture/skills.mdstates each rule and why it has its number.Why this shape.
allowed-tools,hooks,shell,model,effort,context,agent) are refused by name: a library entry must not carry a host's permissions. Files under a top-levelagents/orhooks/are refused for the same reason.<sha256 of the file's UTF-8 bytes> <path>\n, sorted by the path's UTF-8 bytes. It does not depend on the order of the request, and a client can compute it with a hash function alone. No hash is answered when a path rule refused, because the files are then not one set, or when the package is over its byte or file limit, because its text is not read.content_controlandhidden_textare applied to each file's text and to every string the frontmatter yields, because a quoted YAML value can spell a character with an escape that the file's text does not hold.ok. A match is a name in a code span, not a call the text makes: an example value, a name written with a wildcard and a section that lists removed names all match. Refusing on an unknown name would refuse correct text.Alternatives.
Migration story. There is none: no table, no setting and no migration. A build without the op answers an unknown op, and the command reads
ops.capabilitiesfirst and says "this server does not serve skill.check".Decisions a reviewer may want to change
metadatamust be a map of string to string as YAML types the values. Thirteen development skills under.claude/skills/writemetadata: {internal: true}, a boolean, so the rules refuse them withfrontmatter_value.tests/unit/test_skill_format_repository_folders.pypins what the rules answer for each of the 35 skill folders in this repository: 20 accepted and 15 refused (13 for that value, two of them also for a file type or a host folder, andloom-statusin both plugins for a file type). Either the rule accepts a scalar there or those folders quote the value; this change does neither and leaves the folders as they are.descriptionis refused withfrontmatter_value.nameis answered only when it passes the name rule, and empty otherwise. A refused name is text, and the request ledger keeps the answerednameas a name..mdfiles only,SKILL.mdfirst and the rest by path, so the first mention does not depend on the request's order.skill.checkhas a p99 budget of 150 ms. The rules take 17 ms for a folder of 15,684 bytes and 430 ms for a package at the size limits (five files, 403,010 bytes), measured on a loaded machine; the handler runs them off the event loop. Most of the time at the limits is the shared secret detector.loom skill check --jsonprints the server's answer with the two local findings appended tofindings:left_outfor each path the reader did not send andfolder_name_differs. The command also takes--org,--serverand--profile, as the other SDK commands do.loom.skills.read_folderreturns a list of{path, text}that also carriesleft_out. It opens a file with the Unix open flags the platform defines, and withO_BINARYwhere that exists. It was not run on Windows.Scope and risk
Touches:
server/identity/domain/skill_format.py,server/identity/api/models_skills.py,server/identity/api/ops_skills.py,server/identity/app/skills.py(added), and the registries:server/operations/registry.py,server/operations/dashboard.py,server/operations/reach_manifest.py,OP_BUDGETS_P99_MSinserver/settings/catalog.py.sdk/python/loom/skills.pyandsdk/python/loom/cli_skill.py(added),sdk/python/loom/cli.py, andSDK_COMMANDSinserver/cli/login.py.scripts/codegen/served_skills.pyimportsFILE_BYTES_MAXandSKILL_BYTES_MAXfrom the rules module, so the two numbers have one source. Its output does not change.tests/unit/test_agent_instructions.pyreads code spans and operation names through the shared functions; its assertions are kept.docs/reference/, the CLI and SDK snapshots, and the new pagedocs/architecture/skills.md.Left alone: no stored skill, no save, list or read op, no dashboard control (the check-a-folder control ships with the Skills page;
NOT_IN_DASHBOARDsays why), no refusal on an unknown operation and no check of argument names, the listing line of a context pack, and the feature page, which arrives with the catalog and will link the architecture page.What could break:
VIEWERby the transport. The handler reads no stored row, so nothing of another tenant can be answered. A token bounded below the namespace is refused at admission.out_name,out_content_sha256; the file texts are not kept (test_the_ledger_keeps_the_name_and_hash_and_no_file_text). Anamethe name rule refuses is answered empty, so the ledger keeps no line of a file through it (test_the_ledger_keeps_the_name_and_hash_and_no_file).filesat most 256 entries,pathat most 512 characters,textat most 400,000). The package limits are refusals with a code, and text past one is not read, so the content rules, the hash and the operations report read at most one package (400,000 bytes) whatever the request holds. The frontmatter bounds stop the parser before it builds anything.secretuses the shared detector, which reads a value of eight or more characters with no space or quote after one of its key words as a secret, so some documented placeholders are refused (export API_KEY=YOUR_API_KEY,api_key=<your-api-key>). The page states the rule as the detector reads it.Compatibility, rollout and rollback
skill.check(experimental,VIEWER, idempotent, not audited). InputSkillCheckInput:org,namespace,files: [{path, text}]. OutputSkillCheckOutput:ok,refusalsandfindings(each{code, path, line, message}),name,description,content_sha256,bytes,file_count,operations(each{name, kind, known, required_role, mcp, toolsets, path, line}).nameis empty when the name rule refuses it, andcontent_sha256andoperationsare empty for a package over its byte or file limit. Over MCP it is reached throughloom_opand is on no roster, so no listing budget changes. No field of an existing op changes and no default changes.loom skill check <dir> [--namespace] [--org] [--json] [--server] [--profile]. Exit 0 when the rules pass, 1 on a refusal, 2 when the folder cannot be read or the server does not serve the op.loom skill checkneeds a token with the viewer role on one namespace.skill.check; the command reports that the server does not serve it and exits 2. No stored or wire shape of an existing op changes.Tests
Unit, each named for the defect that fails it:
test_skill_format_rules.py(31): one case per refusal and finding code with its negative:!inside a word, a fence with a language tag, an implicit directional mark is a finding, a key word joined to a prefix is nosecret, a dotted file name is no parent segment. Text past a size limit is not read, a control character that a YAML escape yields is refused, and every message about a file with an invalid path names its place in the request.test_skill_format_frontmatter.py(42): an alias chain under 400 bytes, 1,000 and 4,000 nested brackets, a bad date, a 5,000-digit integer, a merge key, a!!binarytag,1:besidetrue:and a repeated key are each a refusal, and an accepted repository skill keeps loading.test_skill_format_hash.py(4): the hash is the fixture's (tests/fixtures/skill_manifest.json, written from the documented construction with a hash function alone), does not depend on input order, changes with one byte or one moved file, and is empty after a path refusal.test_skill_format_repository_folders.py(2): the rules over the tracked files of every skill folder in this repository against a table of folder to refusal codes; it fails when a folder is unlisted, an expected refusal is missing or another appears.test_skill_check_operations.py(12): with a registry built in the test, an unknown op or tool is reported, a known one carries its role and MCP form, a hidden op ismcp="none", a plane search that only the assistant toolset lists istool, a package over a size limit names no operation, a refused name is not answered, and neither a refusal norokdepends on the report. No file is run and no model is called.test_unowned_tool_names.py(1): the handler's two literal tool names equal the transport's constants.test_sdk_skill_folder.py(18): the reader follows no link, sends no dot path, refuses bytes that are not UTF-8, opens a file whereoshas noO_NONBLOCK, and gives the fixture's hash through the real handler; the command's exit codes and its text, and a file name with an escape character printed as text.test_agent_instructions.py: one test added, which fails when the server and the prose checker read different code spans from one text.Integration,
tests/integration/test_skill_check.py(6), against a server run from source on a ClickHouse started for this task: a folder is answered with its hash and the operations it names; a package that breaks rules is one report with every refusal; only a request past the transport bounds is rejected, and a package over its byte limit is answered without its text being read; a viewer of another namespace is refused; the ledger keeps the name and the hash and no file text; the command checks a folder against the server.The branch holds three merges of
main, each made because a generated file conflicted. The conflicted generated files were regenerated, not edited by hand. What ran, withpytest -n 2:At this head, after the third merge, which brought the
curatorop group and theloom curatorcommand. The op module list, the two command lists and the command's help keep both,curatorfirst:sdk_py_gen,sdk_py_client_gen,sdk_py_admin_gen,sdk_ts_gen,sdk_rb_gen,sdk_rust_gen,sdk_rust_gen --fixtures,sdk_go_gen,agent_plugin_sync,standalone_skills,served_skills,settings_reference,settings_schema,settings_example,docs_reference,op_reach_census.rustfmtof Rust 1.85.1 andgofmt1.27.4, the versions CI pins, ran from containers, because neither is installed on this machine. The command snapshots were rewritten by their owning test in its update mode.test_cli_surface_snapshot.py,test_sdk_pointer_block.py,test_sdk_surface_contract.py,test_docs_reference.py,test_operation_registry_unique.py,test_op_reach_census.py,test_sdk_cli.py,test_cli_curator.py,test_sdk_skill_folder.py,test_doc_links.py): 496 passed.ruff format --check,ruff check, the function-length gate,mypy --stricton the Python SDK, and Prettier on the regenerated pages pass.Before that merge, after the review fixes:
test_skill_format_frontmatter.py,test_skill_format_hash.py,test_skill_format_repository_folders.py,test_unowned_tool_names.py,test_served_skills_codegen.py,test_docs_reference.py,test_cli_surface_snapshot.py,test_op_budgets.py): 160 passed. Each new case failed before its fix, except the placeholder cases, which state what the detector already did.test_package_contracts.py,test_op_transport_contract.py,test_tunable_constants.py,test_store_names_refused.py,test_degraded_unnoted.py,test_public_copy.py,test_doc_links.py,test_agent_instructions.py,tests/analyzer): 604 passed, 12 skipped.tests/integration/test_skill_check.py, against a server run from the commit of the fixes on a ClickHouse started for this task: 6 passed. It was not run again after the merge; CI runs it on the merged tree.ruff format --check,ruff check,make typecheck, the function-length gate, the secret gate, and Prettier on the two changed pages pass.sdk_py_gen,sdk_py_client_gen,sdk_py_admin_gen,sdk_ts_gen,sdk_rb_gen,agent_plugin_sync,served_skills,settings_reference,docs_reference,op_reach_census.docs_referencerewrote three field descriptions ofdocs/reference/operations/skill.md. The fixes change no wire field: they change field comments, which only that page carries.After the second merge:
sdk_py_gen,sdk_py_client_gen,sdk_py_admin_gen,sdk_ts_gen,sdk_rb_gen,sdk_rust_gen,sdk_rust_gen --fixtures,sdk_go_gen,agent_plugin_sync,standalone_skills,served_skills,docs_reference,op_reach_census.rustfmt1.85.1 andgofmt1.27.4, the versions CI pins, ran from containers, because neither is installed on this machine.test_served_skills_codegen.py,test_sdk_cli.py,test_sdk_cli_connect.py,test_sdk_pointer_block.py,test_cli_surface_snapshot.py,test_sdk_surface_contract.py,test_op_reach_census.py,test_op_budgets.py,test_op_inputs_after_gate.py,test_op_surfaces.py,test_mcp_listing_budget.py,test_mentor_planes.py,test_admission_gates.py,test_registry_narrow_only.py,test_operation_registry_unique.py): 591 passed.tests/integration/test_skill_check.py: 6 passed.After the first merge, which brought
knowledge.citations.check. The second merge brought no op:ruff format --checkandruff checkon the changed files, andmake typecheck, pass.test_package_contracts.py,test_op_transport_contract.py,test_tunable_constants.py,test_store_names_refused.py,test_degraded_unnoted.py,test_public_copy.py,test_doc_links.py,test_agent_instructions.py,test_test_inventory.py,test_integration_suite_targets.py,tests/analyzer): 1029 passed, 12 skipped. The skipped cases need aclickhousebinary, which this machine does not have, or a ClickHouse target the scan run was not given.test_read_scope_isolation.py(one_SHAPED_HINTSentry added forfiles) andtest_cross_principal_leakage.pythat reach the new op: 3 passed and 6 passed.Before the merges, the same lists passed, with one failure found and fixed:
test_no_new_tunable_constantfailed because the reason comment ofFRONTMATTER_DEPTH_MAXwas two lines above the constant. The comment was moved andtest_tunable_constants.pypassed. Also run then: the function-length gate, the secret gate, andtest_cli_hygiene.py,test_sdk_readme_facts.pyandtest_coverage_floors.py.Other:
time.perf_counteraroundcheck_packageandpackage_mentions, best of three. The fixes add two single runs: 4 ms for a request of 80 files of 400,000 characters, and 411 ms for a package at its limits.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code wrote the diff and ran the checks listed under Tests.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.Unticked: this change has no migration, no plugin file and no frontend file, so those three checks did not run; the CLA line is the committer's to confirm.
🤖 Generated with Claude Code