[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DJKJCJY9ZE5MDTPGFSDRZT":3,"skill-same:01M7DJKJCJY9ZE5MDTPGFSDRZT":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7DJKJCJY9ZE5MDTPGFSDRZT","kv-or-stream",null,"Decide between a KV watch and a JetStream stream for a new communication path. Use when designing communication between components, adding a message flow, or choosing a NATS storage primitive.","C360Studio\u002Fsemengine","C360Studio","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F107274645?v=4","01M6NQ809JZG513TZ7FJX8SAKQ","Complete 360 Studio","01M7DJK5W1EEP4D1Z9F5WVJG1T",0,"MIT","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkv-or-stream\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: kv-or-stream\ndescription: >-\n  Decide between a KV watch and a JetStream stream for a new communication path. Use when designing communication\n  between components, adding a message flow, or choosing a NATS storage primitive.\n---\n\n# KV watch or JetStream stream\n\nStart from the communication the user names. A KV watch is a subscription to changes in a NATS key-value bucket; a\nJetStream stream is a durable log that a consumer reads and acknowledges message by message.\n\n## Four tests\n\nApply them in order; the first clear answer usually settles it.\n\n1. **Restart.** If the component restarted, should it reload current facts, or resume work it had not acknowledged?\n   Reload facts: **KV watch**. Resume unacknowledged work: **stream**. A stream redelivers what was not\n   acknowledged, not what was not finished: work done before a crash cut off its acknowledgement is delivered again,\n   so the owner makes the work safe to repeat or detects the repeat. The cited graph-ingest recovery test demonstrates\n   that reapplying the input preserves the graph's statements (`graph-ingest-recovery` spec, \"Recovery on a file\n   stream is redelivery\"; `TestIntegration_Settlement_ProcessKilledBetweenApplyAndAck`).\n2. **Fan-out or queue.** Should every interested component react, or only one? Every one: **KV watch**. One:\n   **stream**.\n3. **Processing time.** Is the reaction fast and idempotent (safe to repeat), or slow with side effects? Fast and\n   idempotent: **KV watch**. Slow or with side effects: **stream**.\n4. **Nature.** Is it a fact about the world, or a request to do something? A fact (entity state, an index entry,\n   current status): **KV watch**. A request (run a task, call a model, run a tool): **stream**.\n\nIf the tests disagree, the concept may be two things; split it before choosing.\n\n## What an owner of a KV watch takes on\n\nA KV watch has no acknowledgement, and SemEngine promises no second delivery of a change a handler failed on. An\nowner that derives state from a watch applies the desired state idempotently, repairs and re-drives failed work\nitself, and reports readiness or degradation where a reader can see it. Treat the start of a watch as loading the\ninputs a restart needs, not as a retry loop. If the owner cannot take those on, change the design. Never use a KV\nwatch as a work queue.\n\n## Common cases\n\n| Communication | Primitive | Reason |\n| --- | --- | --- |\n| Entity state changed | KV watch | Current fact; fan-out; idempotent reaction |\n| A task to run | Stream | Request; one handler; side effects |\n| Index update | The index owner's KV write; readers watch it | Only the declared owner writes |\n| A slow or costly call (a model, a tool) | Stream | Request; one handler; slow |\n| Its result | Stream | A reply that must arrive at least once |\n| Outside telemetry becoming graph facts | A `graph.Graphable` payload to graph-ingest | graph-ingest is the only writer of `ENTITY_STATES` |\n\n## What the primitives give you\n\n- Every KV bucket is stored as a JetStream stream named `KV_\u003Cbucket>` (`natsclient\u002Fbacking_stream_prefix.go`), so a\n  KV write is both the current value and a change that watchers see.\n- A bucket keeps as many revisions per key as its `History` setting. `ENTITY_STATES` is configured to keep one\n  (`graph\u002Fkvcatalog\u002Fkvcatalog.go`); do not use its history to rebuild earlier state or as a backup.\n- A stream consumer acknowledges each message, and a message it does not acknowledge is delivered again\n  (`natsclient\u002Fdelivery_settlement_integration_test.go` drives this against the pinned server).\n- How nats.go marks the end of the current values when a watch starts is not promised here: no test in this tree\n  drives it (ADR-112). A design that depends on it cites a probe.\n- Many local readers of one bucket share one `graphview.View` (`pkg\u002Fgraphview`), never one `WatchAll` each: the view\n  decodes each write once and gives every reader a snapshot followed by its changes. A reader that needs its own\n  filter, history replay, every revision or its own acknowledgement still opens a real consumer.\n\nUsing both in one component, KV for state and a stream for work, is the normal shape.\n","# KV watch or JetStream stream\n\nStart from the communication the user names. A KV watch is a subscription to changes in a NATS key-value bucket; a\nJetStream stream is a durable log that a consumer reads and acknowledges message by message.\n\n## Four tests\n\nApply them in order; the first clear answer usually settles it.\n\n1. **Restart.** If the component restarted, should it reload current facts, or resume work it had not acknowledged?\n   Reload facts: **KV watch**. Resume unacknowledged work: **stream**. A stream redelivers what was not\n   acknowledged, not what was not finished: work done before a crash cut off its acknowledgement is delivered again,\n   so the owner makes the work safe to repeat or detects the repeat. The cited graph-ingest recovery test demonstrates\n   that reapplying the input preserves the graph's statements (`graph-ingest-recovery` spec, \"Recovery on a file\n   stream is redelivery\"; `TestIntegration_Settlement_ProcessKilledBetweenApplyAndAck`).\n2. **Fan-out or queue.** Should every interested component react, or only one? Every one: **KV watch**. One:\n   **stream**.\n3. **Processing time.** Is the reaction fast and idempotent (safe to repeat), or slow with side effects? Fast and\n   idempotent: **KV watch**. Slow or with side effects: **stream**.\n4. **Nature.** Is it a fact about the world, or a request to do something? A fact (entity state, an index entry,\n   current status): **KV watch**. A request (run a task, call a model, run a tool): **stream**.\n\nIf the tests disagree, the concept may be two things; split it before choosing.\n\n## What an owner of a KV watch takes on\n\nA KV watch has no acknowledgement, and SemEngine promises no second delivery of a change a handler failed on. An\nowner that derives state from a watch applies the desired state idempotently, repairs and re-drives failed work\nitself, and reports readiness or degradation where a reader can see it. Treat the start of a watch as loading the\ninputs a restart needs, not as a retry loop. If the owner cannot take those on, change the design. Never use a KV\nwatch as a work queue.\n\n## Common cases\n\n| Communication | Primitive | Reason |\n| --- | --- | --- |\n| Entity state changed | KV watch | Current fact; fan-out; idempotent reaction |\n| A task to run | Stream | Request; one handler; side effects |\n| Index update | The index owner's KV write; readers watch it | Only the declared owner writes |\n| A slow or costly call (a model, a tool) | Stream | Request; one handler; slow |\n| Its result | Stream | A reply that must arrive at least once |\n| Outside telemetry becoming graph facts | A `graph.Graphable` payload to graph-ingest | graph-ingest is the only writer of `ENTITY_STATES` |\n\n## What the primitives give you\n\n- Every KV bucket is stored as a JetStream stream named `KV_\u003Cbucket>` (`natsclient\u002Fbacking_stream_prefix.go`), so a\n  KV write is both the current value and a change that watchers see.\n- A bucket keeps as many revisions per key as its `History` setting. `ENTITY_STATES` is configured to keep one\n  (`graph\u002Fkvcatalog\u002Fkvcatalog.go`); do not use its history to rebuild earlier state or as a backup.\n- A stream consumer acknowledges each message, and a message it does not acknowledge is delivered again\n  (`natsclient\u002Fdelivery_settlement_integration_test.go` drives this against the pinned server).\n- How nats.go marks the end of the current values when a watch starts is not promised here: no test in this tree\n  drives it (ADR-112). A design that depends on it cites a probe.\n- Many local readers of one bucket share one `graphview.View` (`pkg\u002Fgraphview`), never one `WatchAll` each: the view\n  decodes each write once and gives every reader a snapshot followed by its changes. A reader that needs its own\n  filter, history replay, every revision or its own acknowledgement still opens a real consumer.\n\nUsing both in one component, KV for state and a stream for work, is the normal shape.\n",{"name":5,"description":7},"main","a8dd79128471bb120c59ffc1f2c5fdcc74d28c2b",".agents\u002Fskills\u002Fkv-or-stream","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine","https:\u002F\u002Fgithub.com\u002FC360Studio","2026-11-15 06:29:50",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add C360Studio\u002Fsemengine --skill kv-or-stream",{"tool":36,"command":37},"bunx","bunx skills add C360Studio\u002Fsemengine --skill kv-or-stream",{"tool":39,"command":40},"pnpm","pnpm dlx skills add C360Studio\u002Fsemengine --skill kv-or-stream","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkv-or-stream\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":19},"01M7DJNADQDES9RFB0RF39MARV","semengine-status","Report SemEngine Slice 04A package port progress, active PR claims, known flakes, and GitHub milestone\u002Fissue queue hygiene, and sync the GitHub Project v2 tracker. Use when asked for port status, auditing the issue queue, or updating the project board.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsemengine-status\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7DJN7JPA0M9VZZ5RRZ6XEMW","review-pr","Adapter for review-pr.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Freview-pr\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7DJN4VWVKR8B6Z7XVPKWGD8","query-pattern","Choose how code reads the graph: graph-ingest's declared request verbs, the typed exact-entity reader, or an owner's bucket access. Use when a component or a consumer needs to read entities.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fquery-pattern\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7DJN0VZEF1BYN6QCZDGRNF5","preflight","Select and run the existing SemEngine verification gates for a concrete diff before an implementation push or local-readiness assessment.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpreflight\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7DJMZVCQQ7C0XBF8S65SAV2","ponytail","Adapter for ponytail.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fponytail\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7DJMYVPY0TAV1TBKSAP36ZZ","pickup","Adapter for pickup.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpickup\u002FSKILL.md",[],[]]