From f79270828a7e33aa90efa489623198f0b1254d75 Mon Sep 17 00:00:00 2001 From: Dong1017 <55723162+Dong1017@users.noreply.github.com> Date: Fri, 27 Nov 2026 01:23:09 +0800 Subject: [PATCH 01/12] Freeze released Casebooks finding decisions and source ranges Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com> --- .../atomic-reader/casebook-domain-v0.3.4.json | 780 ++++++++++++++++++ 1 file changed, 780 insertions(+) create mode 100644 tests/fixtures/atomic-reader/casebook-domain-v0.3.4.json diff --git a/tests/fixtures/atomic-reader/casebook-domain-v0.3.4.json b/tests/fixtures/atomic-reader/casebook-domain-v0.3.4.json new file mode 100644 index 000000000..961807102 --- /dev/null +++ b/tests/fixtures/atomic-reader/casebook-domain-v0.3.4.json @@ -0,0 +1,780 @@ +{ + "files": { + "casebooks/ascend/ascend-optimization-casebook/SKILL.md": { + "bytes": 11126, + "sha256": "b1ffddd0784743840606c151e7cf23f6eb5466e90f93f6d91214fded73c0be4a" + }, + "casebooks/inference/inference-optimization-casebook/SKILL.md": { + "bytes": 10247, + "sha256": "cec75f3a721dd13e6913b597d5373833a14c39d9048951a30c4864dd2c49aac8" + }, + "casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.json": { + "bytes": 3602, + "sha256": "4f8544292b2cc3391f4d4d75994cb81fdd295eff99e55b7e60374c6c122de09e" + }, + "casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.md": { + "bytes": 3134, + "sha256": "e88bbac5d253a8e7e3a3d5e21047f23f2970c11ac23887d4303ab94fca52dd27" + }, + "casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.json": { + "bytes": 6270, + "sha256": "a2dc5db8aba62081c5743b12f854e74ae500c53bd57e2486260d0b5ae478638a" + }, + "casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.md": { + "bytes": 3557, + "sha256": "6f143bc363a3290fc008c08e57cb075f1776d1c8cca8a6a59297d5b1fbbf61bf" + }, + "casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.json": { + "bytes": 5299, + "sha256": "b2c1808919ae525efb82148a24b465459799422fefc6d420891d7dbeb36cd31a" + }, + "casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.md": { + "bytes": 2564, + "sha256": "be396983812262515899a3e2ba4f01b23ff92e1b836881882c7580372b8ae552" + }, + "casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.json": { + "bytes": 5023, + "sha256": "90e3cdca085e2d122e648aae527bd6a61de6d4fddb66c393ca25ac4541cd9122" + }, + "casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.md": { + "bytes": 2656, + "sha256": "cce2930f544a0f78f21797fba4d8ded298e4a81f76c34d7977b0e31d361bc738" + } + }, + "refs": { + "checkout:ascend-optimization-casebook": { + "dependencies": {}, + "entry_sha256": "b1ffddd0784743840606c151e7cf23f6eb5466e90f93f6d91214fded73c0be4a", + "entry_source": "casebooks/ascend/ascend-optimization-casebook/SKILL.md", + "kind": "skill", + "required_count": 1, + "resource_count": 1, + "resource_set_sha256": "056b4ae5ebcefa8b02176c80b830161fd5c1dff6e50862a54902e4bc279b0972", + "revision": "sha256:17deaadcc3ea337e2a45b9c413d9846e6744caf75699b90f45c4f8f00f171285" + }, + "checkout:case.admission-drain-occupancy": { + "case_aliases": { + "admission-drain-occupancy.json": "casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.json", + "admission-drain-occupancy.md": "casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.md", + "case.json": "casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.json" + }, + "case_file_sha256": "4f8544292b2cc3391f4d4d75994cb81fdd295eff99e55b7e60374c6c122de09e", + "dependencies": {}, + "entry_sha256": "e88bbac5d253a8e7e3a3d5e21047f23f2970c11ac23887d4303ab94fca52dd27", + "entry_source": "casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.md", + "findings": [ + { + "card_bytes": 3166, + "card_sha256": "689c00516ee278ba6dbe393b151b562013b561e93fcdb876dc47f81571c241a6", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 2249, + "finding_sha256": "b2fe60e96379bf493e95159f6a583b7946e3c31295aa49b57983876d27948946", + "missing_fields": [], + "pointer": "case.json#/findings/0", + "selector": "case.json#/findings/0", + "span_sha256": "82a530dd7402fa10f0d445609238cc0451779afa5ebc0b02feb182f8e8c518e4", + "start_byte": 1394, + "status": "complete" + }, + { + "card_bytes": 2894, + "card_sha256": "dff26a9a34531f6f0ac9850f936ffa37b689a4f486b5330c9b668b2526851b3d", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 2911, + "finding_sha256": "4bc408e09078bf693b3d144149d6081ab48c39f9732245b5a74f65746347d0e4", + "missing_fields": [], + "pointer": "case.json#/findings/1", + "selector": "case.json#/findings/1", + "span_sha256": "29844fbb80c01fedfa2d1499f6b647c39624fb23008809870f815c5fbe86b9e9", + "start_byte": 2255, + "status": "complete" + }, + { + "card_bytes": 2927, + "card_sha256": "f44a38f78d8fca892a5810b20287658a096cc5bb12919ff174cb157cb673cb65", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 3595, + "finding_sha256": "711fd3747ab01b31348494c27187af5f4f2ff0aff5e5360281e2e5a9b0fe2094", + "missing_fields": [], + "pointer": "case.json#/findings/2", + "selector": "case.json#/findings/2", + "span_sha256": "a48329e4a1aa6d303ed6bfe65b967f0b0ec4972d66d7e42f339e5d31e078cd16", + "start_byte": 2917, + "status": "complete" + } + ], + "kind": "case", + "required_count": 3, + "resource_count": 3, + "resource_set_sha256": "7ba0364976fddce235bedcfe86b5147ae6691249c5030ef1be4af1f59a54701a", + "revision": "sha256:9219b7fec8bd72877925a27956b394e36b85c54775c8b97b35f0bd843830cb03" + }, + "checkout:case.drama3-rejected-directions": { + "case_aliases": { + "case.json": "casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.json", + "drama3-rejected-directions.json": "casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.json", + "drama3-rejected-directions.md": "casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.md" + }, + "case_file_sha256": "a2dc5db8aba62081c5743b12f854e74ae500c53bd57e2486260d0b5ae478638a", + "dependencies": {}, + "entry_sha256": "6f143bc363a3290fc008c08e57cb075f1776d1c8cca8a6a59297d5b1fbbf61bf", + "entry_source": "casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.md", + "findings": [ + { + "card_bytes": 3123, + "card_sha256": "895d493a35400fca6e4e0ebb44eb4bf89a145aa5e0a099805e77d773c85c7294", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 2154, + "finding_sha256": "bbb61af22cb2cb8db8f8be8147894dedcaa5307e269b19da2e1c96419d10300c", + "missing_fields": [], + "pointer": "case.json#/findings/0", + "selector": "case.json#/findings/0", + "span_sha256": "4cae0fad3460d28e4176d079c1246dcd88af21fefcc1191412c153dc5696e075", + "start_byte": 1499, + "status": "complete" + }, + { + "card_bytes": 3307, + "card_sha256": "344d9eb6ce56d13086efa89003aec35f43ec59f3e3d3439ff4c9c4667a7a835e", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 2910, + "finding_sha256": "71adae00b999348e4618d85a92f4e0b4823a59347351cbf7359ed6b7e972c6be", + "missing_fields": [], + "pointer": "case.json#/findings/1", + "selector": "case.json#/findings/1", + "span_sha256": "e02ff5d0a442030bb8a6d8a8a6901670ab0f92ec8d2c841536ea72b63cbaac1a", + "start_byte": 2160, + "status": "complete" + }, + { + "card_bytes": 3145, + "card_sha256": "12335f7e9202106756d144342c137f0deca2da83c7e7c167f26a4e590d075e57", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 3583, + "finding_sha256": "e6db8b0be31835afd7d09a553c2a73bf651ea0d4d3ec7d156a050e978caa7db6", + "missing_fields": [], + "pointer": "case.json#/findings/2", + "selector": "case.json#/findings/2", + "span_sha256": "0eeabdcdbdaef2a15186186d1b2649be9dcd651f94038c0a5dc4136876a7cd1a", + "start_byte": 2916, + "status": "complete" + }, + { + "card_bytes": 3155, + "card_sha256": "c5b16087d07cacf52950f09f27a51b094af8309bb809cd737d97569a66e4265b", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 4342, + "finding_sha256": "0e2f7900c60c214630018a20e40d653c7a42aeb4ab8c6194880f79d362238b59", + "missing_fields": [], + "pointer": "case.json#/findings/3", + "selector": "case.json#/findings/3", + "span_sha256": "d9c5f1ab879b45558322e5ef73833d1a6aad3e8db7eb2c02ba78bd3eff9bb76b", + "start_byte": 3589, + "status": "complete" + }, + { + "card_bytes": 3162, + "card_sha256": "fa7e1f5483683f9f5ed13f60a835181e94a254d70f102b2bbe210f123e051f33", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 5027, + "finding_sha256": "6904d347ddf2de158fd297d8b2b76483cf77651faa8d41b0f52abe32d4f0d710", + "missing_fields": [], + "pointer": "case.json#/findings/4", + "selector": "case.json#/findings/4", + "span_sha256": "c687cb2d1b8bfe3d1c5b0c2d192fe9b7f64f8d6a2c5a8421a37a2a1c42914882", + "start_byte": 4348, + "status": "complete" + }, + { + "card_bytes": 3058, + "card_sha256": "250b9159a5b11546812402a6c2b1d2554aae0c592a37e01a6f11d52f9259095b", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 5658, + "finding_sha256": "06532019ed9001629747659667bea4e471546173a0419ce32b304989e0475827", + "missing_fields": [], + "pointer": "case.json#/findings/5", + "selector": "case.json#/findings/5", + "span_sha256": "7964442a9f13413d3d97125b3faece7abc39803dab979900fc6db3bab9fd1f17", + "start_byte": 5033, + "status": "complete" + }, + { + "card_bytes": 3020, + "card_sha256": "5059242f8619c6bfddd64677be1386360679cfec7970e9e04bcdec46265a9de4", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 6263, + "finding_sha256": "d1b91f9f857a39922354453d6ce294a77db5b091b0018403190479d9167fd936", + "missing_fields": [], + "pointer": "case.json#/findings/6", + "selector": "case.json#/findings/6", + "span_sha256": "d345b2c36452eea31e6ae4a6c530142a6ce543116c86c4cd6be043bad4c08b87", + "start_byte": 5664, + "status": "complete" + } + ], + "kind": "case", + "required_count": 3, + "resource_count": 3, + "resource_set_sha256": "c8763555957d7dd08d1a14b189fc636d1cd57eca3ebadb49d2d6f4076ef41c25", + "revision": "sha256:4cd73101fe76691a6a7360242925fe731cd01db167ea0b485940e835e2ebafe7" + }, + "checkout:case.qwen-ascend-rejected-directions": { + "case_aliases": { + "case.json": "casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.json", + "qwen-ascend-rejected-directions.json": "casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.json", + "qwen-ascend-rejected-directions.md": "casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.md" + }, + "case_file_sha256": "b2c1808919ae525efb82148a24b465459799422fefc6d420891d7dbeb36cd31a", + "dependencies": {}, + "entry_sha256": "be396983812262515899a3e2ba4f01b23ff92e1b836881882c7580372b8ae552", + "entry_source": "casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.md", + "findings": [ + { + "card_bytes": 2838, + "card_sha256": "f6efabd0310c884915e0ed7d857159274f340f2b6859e83a91e519b838de0244", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 1963, + "finding_sha256": "f30ae8b8d58972622c69a336d1651f753f8c51ebd448f2eca4be6ed4816548f9", + "missing_fields": [], + "pointer": "case.json#/findings/0", + "selector": "case.json#/findings/0", + "span_sha256": "23e07b6c577590ee246e90b000b767fde6aa14b348486dc7beb9ccb054c6fa96", + "start_byte": 1335, + "status": "complete" + }, + { + "card_bytes": 2891, + "card_sha256": "80a2e75f308bc068c5316701e154d699e0833f1c2da8ab0ad8f1ff28ba4c53e3", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 2623, + "finding_sha256": "3ae5fa9d8d35e3b2c1e300857635bae86cb1de51d17ab803b20d811b0c4f16d6", + "missing_fields": [], + "pointer": "case.json#/findings/1", + "selector": "case.json#/findings/1", + "span_sha256": "d3cf6b89c6ee8c3dbfe5b9b23e33496b789a4d78cad25a7e7ccbe6f6cbab73cb", + "start_byte": 1969, + "status": "complete" + }, + { + "card_bytes": 2879, + "card_sha256": "9141f296670a145136c26cd33a93b13a48b392b0b6d4fedff7c4eacf279c5264", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 3269, + "finding_sha256": "eae6ba404da54956cc4e12379f48fdb8074e81629a5fba7bf124bb64b9f0798b", + "missing_fields": [], + "pointer": "case.json#/findings/2", + "selector": "case.json#/findings/2", + "span_sha256": "3acd18f9972685069e6959936a32fdd47ef2de547cec239f9a4ba73f1c928fb9", + "start_byte": 2629, + "status": "complete" + }, + { + "card_bytes": 2764, + "card_sha256": "c52ae105af548daf62e98e052f383ceaa1cc287f7ee1c13712e8ffa85190e4fd", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 3867, + "finding_sha256": "fa1891c37e25fa3c0f5556d5438183116c76d2f1fb9e79c033bbe4776ac3d72e", + "missing_fields": [], + "pointer": "case.json#/findings/3", + "selector": "case.json#/findings/3", + "span_sha256": "504ae42f29f5131a4d3f28781713aa3a3225dc7ea39fcd458619c088fb565901", + "start_byte": 3275, + "status": "complete" + }, + { + "card_bytes": 2908, + "card_sha256": "50d53c084c49233403fe289d8eb514695073f44388dd2de3f6fd9617cd8679b2", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 4602, + "finding_sha256": "8ed6e1556b9d8a6a989555da2e4eb56c2ac53d76a19dee3d5b3a85cf8f3de85b", + "missing_fields": [], + "pointer": "case.json#/findings/4", + "selector": "case.json#/findings/4", + "span_sha256": "8d218fa1850583227973494d0966db8c2e8d2bbe4c7e8317c71c0466c7e8b627", + "start_byte": 3873, + "status": "complete" + }, + { + "card_bytes": 2818, + "card_sha256": "8e20119cb609100b6dad3b3c636d447972989cf60374f80199e3223b7212a4ae", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 5292, + "finding_sha256": "9c821396f59d2dddcb6f9452813a2ea3e8a7469954754783b66367cc0875b3a4", + "missing_fields": [], + "pointer": "case.json#/findings/5", + "selector": "case.json#/findings/5", + "span_sha256": "33d1462dd3b2f2b71d0ae352b19eb513d9a83066ffe54f54c2bb253fb581d536", + "start_byte": 4608, + "status": "complete" + } + ], + "kind": "case", + "required_count": 3, + "resource_count": 3, + "resource_set_sha256": "c98365f5d345edac58368d216243514a39bb4b85be00d7177cfb9141c7fba2c3", + "revision": "sha256:86209f049d3f7bc7f5e09e6262a93ede238e14923cd411c9d2130eb83c0277e1" + }, + "checkout:case.qwen-b300-rejected-directions": { + "case_aliases": { + "case.json": "casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.json", + "qwen-b300-rejected-directions.json": "casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.json", + "qwen-b300-rejected-directions.md": "casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.md" + }, + "case_file_sha256": "90e3cdca085e2d122e648aae527bd6a61de6d4fddb66c393ca25ac4541cd9122", + "dependencies": {}, + "entry_sha256": "cce2930f544a0f78f21797fba4d8ded298e4a81f76c34d7977b0e31d361bc738", + "entry_source": "casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.md", + "findings": [ + { + "card_bytes": 2647, + "card_sha256": "3b53f8641d37ca8aeca4eedf3c6729c538abdc05c50135d69679dc821fb83acf", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 1859, + "finding_sha256": "61ba3d068957e2c4553dafb5ff79d42057179a1c35ceb62bdc473119b956a5c7", + "missing_fields": [], + "pointer": "case.json#/findings/0", + "selector": "case.json#/findings/0", + "span_sha256": "7d711ac3744ab38a229eee69a1f60da33d7773ef0544b34287cf62f9dc0dfb24", + "start_byte": 1236, + "status": "complete" + }, + { + "card_bytes": 2602, + "card_sha256": "0d3bafc8ec368203c84a8efd701027e845e869a4f8dfa9175d619ad8469a9ba5", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 2458, + "finding_sha256": "c65f9e73c66f591771ec62ddec8928ef6dada36861f3e4f091ed0c259dfc4097", + "missing_fields": [], + "pointer": "case.json#/findings/1", + "selector": "case.json#/findings/1", + "span_sha256": "76aa1bba6a163af8333859c17cbb9f4b47a5e00d7df4d2bad76dc4ba87af604f", + "start_byte": 1865, + "status": "complete" + }, + { + "card_bytes": 2689, + "card_sha256": "4b11c97a996ffde0e91845347621c0d9adbaf376709a06c59b258960779da222", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 3117, + "finding_sha256": "f7e59fd5d3b16ccd0009d1179b3a32d2164ff80cb3ac5ed752bb45492b2b4851", + "missing_fields": [], + "pointer": "case.json#/findings/2", + "selector": "case.json#/findings/2", + "span_sha256": "c8ca005cf69d7d0ab0b24e326334fa5d0c24023185d14688cd7d777633e06d94", + "start_byte": 2464, + "status": "complete" + }, + { + "card_bytes": 2675, + "card_sha256": "68228c60a43c11c7dba2b908045595874d38e1301af9e167ed058755f199dd19", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 3770, + "finding_sha256": "ea9d0c1bca1e95c2e0ddfcdd67d5b4c17e8886087c181833183b6294e89c4214", + "missing_fields": [], + "pointer": "case.json#/findings/3", + "selector": "case.json#/findings/3", + "span_sha256": "cbbd0b5045b47d0f02bd4a9f84633475ce97082e26a03f4f33727d599c5a5304", + "start_byte": 3123, + "status": "complete" + }, + { + "card_bytes": 2493, + "card_sha256": "026e1dcf91665f42bc8d78287f29ff4fc9ab3532bf167584776eb3aeb9ad3848", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 4389, + "finding_sha256": "b0d95da536e2c229d824a86d41a0c2b1700268abd8423203caa8198b2f1a899e", + "missing_fields": [], + "pointer": "case.json#/findings/4", + "selector": "case.json#/findings/4", + "span_sha256": "a9c171fb370b31e9478754c820efa9c0b6a9403ffeaa4e3710d74a730f1bf18b", + "start_byte": 3776, + "status": "complete" + }, + { + "card_bytes": 2639, + "card_sha256": "c564925ce4beb97a893500286db1e8b80b997f470c4fa682d2cda621d47198ce", + "decision": [ + "applicability", + "prerequisites", + "recommendation", + "refusal_or_limits", + "validation" + ], + "declared": [ + "applicability", + "attribution", + "finding", + "limitations", + "origin", + "sources", + "state" + ], + "end_byte": 5016, + "finding_sha256": "17c8932d85b90b7ad3a1f64d4ff12d788ba392b96cde473e0fe4f37284f10a15", + "missing_fields": [], + "pointer": "case.json#/findings/5", + "selector": "case.json#/findings/5", + "span_sha256": "40ea7d9e88d04d550b448d5a68b5f6b3b5bad6ddff198275a97275f2c4380471", + "start_byte": 4395, + "status": "complete" + } + ], + "kind": "case", + "required_count": 3, + "resource_count": 3, + "resource_set_sha256": "318e2578716ce7e6dd9815c43a21f0d12ea2ab4b17bd65d4e619b73d10d4be11", + "revision": "sha256:c6fbc3bc68158a174b687d360d6c74fb19b33204029e3c791690376b193752fe" + }, + "checkout:inference-optimization-casebook": { + "dependencies": {}, + "entry_sha256": "cec75f3a721dd13e6913b597d5373833a14c39d9048951a30c4864dd2c49aac8", + "entry_source": "casebooks/inference/inference-optimization-casebook/SKILL.md", + "kind": "skill", + "required_count": 9, + "resource_count": 9, + "resource_set_sha256": "acbff18fd5d8d53e270aedc0ce8c54a026de19b8e2cba0cfc24b6cd185b68d81", + "revision": "sha256:af6b98cf6a8a140075e2511bf21bfb783954c89111dbc94e2d30bd7b86179abb" + }, + "package:inferrsi.ascend.skills.ascend_optimization_casebook": { + "dependencies": { + "data/skill_library": "sha256:502067b90d93cae5a58c6afd65dae5a4cbe183fd29ffb21ea67e8d703e66425d" + }, + "entry_sha256": "b1ffddd0784743840606c151e7cf23f6eb5466e90f93f6d91214fded73c0be4a", + "entry_source": "casebooks/ascend/ascend-optimization-casebook/SKILL.md", + "kind": "knowledge", + "required_count": 716, + "resource_count": 716, + "resource_set_sha256": "4999290e09960fe9635ded6a1679cd5466b1cd6b12d5b0878d362325edf0a944", + "revision": "sha256:be745b9ccf05f4e357628995237dfe2b99c59bd8ea63a9b06d3c213ba086b684" + }, + "package:inferrsi.common.skills.inference_optimization_casebook": { + "dependencies": { + "data/skill_library": "sha256:502067b90d93cae5a58c6afd65dae5a4cbe183fd29ffb21ea67e8d703e66425d" + }, + "entry_sha256": "cec75f3a721dd13e6913b597d5373833a14c39d9048951a30c4864dd2c49aac8", + "entry_source": "casebooks/inference/inference-optimization-casebook/SKILL.md", + "kind": "knowledge", + "required_count": 716, + "resource_count": 716, + "resource_set_sha256": "35373bd4464163c66e53deaa7264b0389e43ea6984f6aa59553b0971956025b3", + "revision": "sha256:c00ec12e6e664f43fc21ba509bc008018fbf8c7af91a11c145abf517687b4ab1" + } + }, + "release": "v0.3.4", + "wheel_sha256": "9a1015f2c1e1347f46d1ca899d2cb8e32c8279a75e88669b9de1a8c8bda5b6c9" +} From df9b34019de730034f70a1770ac42bb68feddd35 Mon Sep 17 00:00:00 2001 From: Dong1017 <55723162+Dong1017@users.noreply.github.com> Date: Fri, 27 Nov 2026 01:33:39 +0800 Subject: [PATCH 02/12] Replay the official Casebook decision cards from archived sources Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com> --- .../atomic-reader/casebook-sources-v0.3.4.zip | Bin 0 -> 25073 bytes tests/knowledge/test_atomic_casebooks.py | 77 ++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 tests/fixtures/atomic-reader/casebook-sources-v0.3.4.zip create mode 100644 tests/knowledge/test_atomic_casebooks.py diff --git a/tests/fixtures/atomic-reader/casebook-sources-v0.3.4.zip b/tests/fixtures/atomic-reader/casebook-sources-v0.3.4.zip new file mode 100644 index 0000000000000000000000000000000000000000..462b3bcf11c143732848da4542795d3a264e3a3d GIT binary patch literal 25073 zcmcG$Q>-UJ1MU0Ym~Gp(ZF{zD+qP}nwr$(C?LFJZ-1)AO?>wBF+>`UrsY<8%sgqu7 z{d!f&OM!r*0001pe-|OZ(Uko|6$t=vr3L`l{@pP$a56Epv$JxdH*hjCu{Hj`2UY13>0-%~3!qbr01usO`0Jss^gd%*5!1x##7%$nJJAs-V`FXE z>~Q1E(%-bytjLR}m2`?r96A?yB}=8UP8KVJ>08C}Y<4cf=w^qn=m(7qQui;HK^T3+ z=eX3VrKo2#3g?~`nkr|K>oqQwjm%#Pth368X@7t470f#-V^&iACbC23^Dbr4zci~H zm(X-gOQ@D?mqIQs4T&6;SaXz$@>JBWwyEp>U>l**)oE^2D|xD>d0P>YJaP3&)7SD9 zOKGG+XY56WIMgb)4CZ-I(z-ID;#VVOwN!@S?CDBTqd}>?bM`D(>PKiTMQ9#~FIk>b zX^nB&tu8{E1zWYX``nfu0(T}?DzfU`!alX%j~tlRJhHmFm1$CMYexL6IuPe5+4y|n ztQibyx7Mis5T-XKk#dLoII_qf5&GsSPfiGNaSqYzcD8tu@g1fi_?`TPa@aqf#G4+D zJ7BMUd*eulQM)X~{)4$uqQ9_5h zLn}i!wY+=TD19p%CT`uUnv$JVBax87abve*X$`1*kQ%}+U7^;w{exy3sA2Lh&mY2I ziD-24C7W8Dt9O#mX1nV;Gz%}OK6HP>E2W!N8`1>5a>)%U)i-li$QIZ}y6hN1`cQ+h znjU-e8mlrIWVvtj0BR=<^Hc@Z3aQ zfJQ672;LP*3|a!{fYXTXeY{ffBz9;lam+sff;hG{N%F)>!%7RNL?2rKD7u?eaP#K8 zIAPE>mc3zbJ3(;|j_OzZ3y|XPw7TCyP7XgWH;~43&y`lf zGW}5F6p1YNyTAyx>Ml$j&EYLX6kbGW61>_j-se_Fn7HVKT#LB$C)!D1Bj=edcLNS16TuP@?cN^u*O$ZRu&XJ2T~FHj=!zcuCC*g*C*OJm z3%jlnxp4SmC@AYHZ5{A#U+LGyc;Cfn9?Z(hDTqfSAHs zIhrLSXylI&bd(~M?saaO2oz6sRxl3BJHQxm^8 z+SgwbLS*CpBs+KHMJ&Ito!1!+<@ zp1T(=kZCr`*hV|jS<{I3?=lPBamdGV@Jxj;K)8Hf$zlyvLJbsles*9BvghH?w^Sp< z&)31p$V}Jk57Y{qybM*Wl7p~Al%KH%VnxD74!q(vqLX*g>VdL0y~62L^u@977C z9Wn;xGDU>l0qbEJAH0^z0o#TU;#Lr@p2#f2eE1Eb-@it#S6)V&IXjZ7fZY8~&j)dW zX|O#&4pp&anEPF@bVsPyzwC8rxW+#9naH6oA;yPXY45@DNS_lJlxY$aTdgDnyVoW? zOC&Bk#<`_#I7IAd$OZ=eJ`CvZgpiV~F@)x$;?LTEJb zBaLoqyYS-bCD)ai4!46{wQYmVVgl)@dSqh1i3DejEmQ+~VYxA{N95f*NT67m3OmDU z%&+ScWaQ&M3V_J^snhENxrWn;pDZZZp>2Hh;j``;$0Z_K_PY&elZnEyn}a~C$A0F0 zrs#`$f___65Y~NO3!k@8OX@&rL-je(M$VP-&YBpbA&Fw4UBayt9-K%TVY#kN@zQC7 z3hUFCCl>&_*IQ3@kHUC*!&{SYDzCjhX-^Cs!t*~PQYFvvqKP1hM5bwB zkKKeRA=cUiaJfPJ+ zlv0bRbfKIQ&7%DB2~6Z2wvrW9}cuNkLD&b2*RN_Pi4$;P21bm?oKSASC@-ht;T>~BtrXND&@r(GdAaRt2fe0pY{7xOmeaIiuCtS|mH&{gz z5hIxN&N~oAys+e)B#zG-HBnxXed3Gk|G(D=hkhruqLne5`=UY=kloz zY01PcYP5F<0?gU0iyUKQf()GnX|KcR7tU1GEv4Q%3GPMp^OHgX8vGn z!@WZjyH%yh-kOw;iKtV9!>ge>$5ew6H?%fgJZhEs{_cYudtpdwz|b-zx#sSb>=ECS zwIz_J@ga2AnAf2!R>lhMn!ED^2rp2fK#4?)<&;PApbjL}&!sRVNU$ZDwWY|pLtPmUV6qQX!VBOI^nbw*!?Xm}5i4W8ezc(0b-U^c8B~EW199usEzO z)#qXwLA#_pdGXWUrYc&-{*mL5iJ{SWiDVymptB*>yW!{=g z;NXN4k{g1ff2KFfP_t5Bk)tpVn3!5J-yYvGZ7^y*REM*+JP$_Ck_5^1Jd8>x_yIM+s` zzrtv{Ry3HhEoOylzuT8S{kFeX=l<3jX2s+k#eJdp#wk7*#dFOp#EyV;^OGNJq0!v( z&pzVwzQco1Jb%A+HW_;dN4{eCkbQ5P9l}!%s+l1-Jbq7U94@iaiC52pm^q|A zkvDj|UBRldz1&YMY9Pt+Up(?U8|{XFlf!gWV?h=pq|wjb`Tu1z{_`4m_I3_M^GheT zsR$e+9KQ=c?$>afx8$8dH<$RS@AkVu2%py5aDsPZpq$nZ=*(=+090rho;9yjOVeJi z-M67)>WAtAqVpTkF-^h3c6M*W(Vi0#XS}Ocmds94%mH^2GgLDPrl0bWT<%brA@|jo$b|m?o&A6CsuInsSnM{`AAUK(YQHz&nAO-V-~}`>_SPe; z-q9{wU(nFh%mNZqvrwi94UGtpCpG;1bM7bJ4+@V&-?RAasF%d{Ur2QauH<0T8318YEP6o3$1WvXC-zP zS~Q!Uk#Q4s2vo1=D%DKyP461d` z%zPBd;8&BEjoy{J=2Z=^UqY%Ry6Y$TjJ~#8y42u~O%)8b1=Kfg823(noz&Bz@D4~m zski{$&juA&^zH*_ZFV0-g^Hwol7T$)maMM|b?hT^gbsG@8FQ9Tw=-VxBZ7IjtYLXn zRvMF*>NkRzMGT8yEP?j=RSS5qsTC(3mnN=8X#<-0THSY%I{Tk370SH~C$jEHGH4-= zu{u1HgyZV^j;DpY3%vcI*e<3Ka?^JSx37CSik}KUlXDMHTpGMYcHYPl z&F*&Rk1%V#49qbXg5s)+rt$a=3FIyp?sz&5m~2VG_sXEu!ZCsiTb(j5b88IPn23mC zeFv?ebcfggi;aN9VX7viRf}=ZMaQA3&XgS(kWMG~&3*00*fdl&E{jK5JSg>M)^}&K zMxFM0{-iai1|2JE99V3f4&J0z)7*F;`C?!e0yHRrM0VNME%Zyu9J}tcc+??sY)WZ- z98T&U7RU*s%mEc&oIRYE#B@m>3I$zaFsd~XBZ?Ni)J76U^ZLV3o9J9wMMw~i)H5uC z`^|fKn4sR_Qj=S`Dj+@nBpnsvgu^`O>o>twYh-GaK@&j~WSL)}oM-LOJD6q#)th*Q z>Nq6HCTAlj-aK|P-*PCVT?9|{yYg&ONr662Tkx4~{C>KdlXi>=X%Fm;N7AnX0-E8- ze4Ee$gzZ#zvG7_H4Z`7b(jE2ZqaV0VH_hK1#i_8go#hDLDXzJ=D=bh-+5txM7YDK3 zE_b-o&9r7#OP&P>4?2zQ#@HM>&76g8rOL{w=6fOz zC~hR5-%s+lo`wkYjmleEFv;xW~0-Bp*4brktROf*?i{IRY`7ecp-lanRmF;dqED#1-doz+qmj1ApJ z20up8uq)PO{r%YIj1XD6${{77;idjWf~H{IU|mI}4vhJ$g$4y_5QMPHekX5U-W)R` zm%Qd8T|x!=$mbVq5yt=@ov}N(hw(}2Q1Lr#8fy40vRD_6U($XjVwzhCbEqRGfTzdu z;B-~WeF+Y_WP0K}NZP6rTGCM&`am56=Zv|Tfe@O}QOP@15>co)-wMYO9h`ko4#eJ` zvB*T+%!Bmiox@c~f^%t8Xhw|K`wd=oy3GK=*s**W?8qdR7~`mK6Xjy~uGs`E~b z3o)-v>Ro5b0cE%VnaEY)%HPVfo1beQ+ZLZ;{#GJRFbLrWn2NC=JaG-=V-;nnl7|RA z@T99inLZyBRXfh)M$#A@3XZZg`{7UIkpY5hl6{2-mgv|uxWG(p4Q8eNOc_k8plJME zMg2CtM(hiB7in(Uu2whZ3s4;LsUJ4h9u4<_n9b^yHB})S_ie{APE=p`$xzs3@5hm2 zVvf!p8GdfJ`_IEkGu_;L-EJpoZ`msSOpB({?K_S9 zapI065S7l>2w3D^5NhSI(uw$AsXy8)a`?DE6H&E?}Nt!!Hz>_H>yTy<>khG|QCf?eUL zLRG!=+NqlH9)Ns>%3dw~YEw-nG=YK_n~HYv-#O5lAXK!c^BGK^}5(5>dE2AJ>g;kF@Sr z5y=4sD#wwxIKkPJu$p1}4Jv|cTs$s!jN9beblrB|Ie}`tlMFp7)XD0<%4{^5i)5S- z(S8FlN1!t=Y@0v;hhPSXOz?sC|F(bYmCA_#bXd-Z7)uKhF!Y2ll<8On$3oQC+_S1Z zEki)|ps;>P4hd{?!lqp#`)DG;{e`q?fj*tHfI;uh#?A>k_xi+1Xm8SECb#(8wSAq0 zDIxKv*OCRAW|D-MUY!h>>N!WyPst(MoZPf4fgfhkqxp!Gh-%9*K#znia+wg^T6H$@ zv{bOwBuSABx6+qMRcF;v@{XH}E`O3cyx%v?f{tgWP(5$>mAF|%Zee^cP8W|k9 zrBD~;-6ZtdE_S$g&7r#H9|oF-=m}LPQ67nv7%LVY6F@F7Jx?#;bPeS{nZT2XuS2h} z7T4?X7)e6tW^?{cn8}*1tm++f1Y|Yz5|OEyFdH6amHhTG@NI`Dzz}FdGlNWR^=@CB z^PeXnxOgpLl&t=cMGJNyiES>p(7-OxVgX4qA!OC2ejv*Zrlp7^4Xn87f@6!*$`Qlx zX8nYxzDgsI4u21%0&LB3-G(6*(7Ar|o`|sr*)kE>^mb2_Khi_G-2rQxfzu#3;RA^? zIY^g~>qbf+lqc2+SrS}aQ^E1DaH!SCqJ*p=#Rg|L&I1TL7&1caoV}Xa5yp#)pt_8u zq;BuyH&|(o`M`g-t8F+OkiUd>2JkkX{XKGN?7y;hQ6Y6SquM=0e!`^Dm^Iq!6jVi4*F;u5$PJ8zG;K zl75zV*-oGAUt&LgJtos{sff0-ufX4hi0x#&-@RU8)lGR;=n%ScH|M*sB8A#0uVjrh z;Ot@bM1E#cj%UHu9@z+Pof<>_fQO8xs5OOO+AFdYc8?UMtw+2lCA&+A!h22t?=9>_ zL1UzP&AKZdJpP|m0@lld=(>{-NfEFJBF-wr;8Dx~JiR{7m@_FBKHRg{g*ST|#Ujgg zpUc4r0`g)I`!HbN!q$LlEVA94NOUN7bCf$Ba7N>8qiq-nSHcFA78LQmiDRX{kg##q zr~zJRB^A)^;Wz&w8_qGEvDc*9JqOoFZ;+t;b$2YfvY|g7^}u#J=|5sY{zJPtVq41I zO?|4|u@~5J=@9Tp?B?oQdxX!hZlpcm=ZhpF{nV3(Z~Q=$f6l~>W@WnaBVtW~l~-wS zG7IKekl8(PZ*yWi>>SRZ5@}L0eqTpTBmqtQvvyC~UmVzNQyBBM{#vMs8XoM87dvre zZ{oyj3zthYY^u{0Ro`3I=v|~3P?N+AAuCudhUF{NiGB$SOmS%O?U5u~5oKPl_jcN; zJ2xKxew8%-fJ5)Z4IFYikl%?O&@w7~L#z;#qr`6M*wkBo_*7SzZGe0zpvyx-E+E(D z95;{?_(R?av+U$FJw4pP;1w?KSiGPHX1r$&d@GCvGTp~iD=o$WNiVo!m}c^3M^e`^ zfhgf+-bJ+U`^n|@BuBi!WK?${7AqmEvrtExIh1wXeFa9%F8{hJE!V7k;y@`9E`YGp z?ZhdZOjHJq%Dd4)%~8n(Do7l_+}qLjP}Q;Lb2;jRyt*Ai)6u>i<8X!GGE= z|LQQtHWp4!|7pJ%I~rKn(%Kmrx!4=n8hOxJI@#H#sOs2lv7z|f))8#0P3c9_cKK{J z>O;(%iZ(gJ3nR)er;LaqsU$`op?=?TlaNZuELH!4*+QE5^qB4V`U-4_m?o=R7qJ&+ z&Q)2&sJNt9(q2tKDztH@jZLc9@*uxj+Pxz?IgIU0vl$(dDml?zb$@*oSxt4GnVJyq zGo)!dW0lynxH~Sm&%gfq3x$L~`8!Eb$5XcJq(UNaZN~`%oy4=!NY9QKH$Ac`q=FmZT0(`P?#jr(#E;Y*leNFXL`%Q8?%>=b$a=cTeCL)@G z!b%G2Jv%l%ux=IGO~0k6WuJ4TDo3Kt>X35px{*a=47+#p!6v&5azwk@wL-mi&apve zHjzh{>^(HE#DNbAjg-vDj=GWOD0L4`cF{T}oV^RwOrJBxsNp2J)*~@nA+t8=M3KZy zsF+gE_}$S9&93c=M|X^bsbMR|(WPY9$|9}}j=07O3Wr@%>#0>0?VGk;aCQi>GYxYk z&{j+5$5?7nvBaq%8okQ6Ek+@igFG^6gs2Gi%tGu+C9~SRNu=F-mpjw#Tk>cG7L;p3!{ZDlHj+UlT^z24q{i>O)ev#16!?`haVwmk}_r+@6(Z55< z(YTvHi%_n{q3lGW+dDejSCtmnRodJ(a8EB-m8=+4OdNL!1SQl{S|dpIrB`42 zk+*Q0#&p7QN_iH5rB>{<25UD^U%f)ti%8ejWQ@*Cg0N`6qG@9`)dZ_lkFjVy#YA8- z`ZL`07aMmT2D~g2QkPq~{Zs%mu3A3Kz7+bVA9fPN6xIO;B7qpvnyBm)!ji3axQAtN zw==WTv-{*@R-8!k!ru!j?_I$@j;y^MzYP?BD{M+}64kqPRQN8~yvpA+%ym?QeAiak z!5U>2%R1R7osBbe?i zhaW~stc(#~f^>9|PE|iI^(vuM3a2S7to_}-mQhyh5Zt*26Ir$rRBdmje|Bqo+Sk`5 zXq4P;)E)f5VUgiN#px5OeHK3X!V10^T{8Og&AI#sd^KZCmE4|xj0k+C43<#*%xh!n zK6&If!a1cB8#SBa8ER2w!x+L2ihaX2h;f(t%zD>U)MHd1T^&6Er1vcn_|Q0n1Xe@O zsSHpF(ZPw$<;?R%=kI*|^#VO9rs~77gK~<^k69k!aCm)~aJFI;krkB2j8HmfXF)X~ zJ4O`X44+E^g3<=1Ftq(GxJvJVVJ4Q!2R_s2Qp?mB< z&NmmAjJh76S!V6|7WCAe&p2<0%8oU0It7)bBv(Hu?YA5i3cdw-zFuw?Kb#V}|IE5N zmUvN%E7UUVuHYJj!+W@op#LX?zKEwM80k#;K*=5h`_tXJlNVR<1LVyp>j*Kha9;J( z{)SOBxAQ9z6m^0MqA$T+f0;X2BzrqSuvK6eVJ9Mew9<+gmmmf-WtV_ZjS}n`@%9{! zs>r|@!zvt!`cT3zdi%|^!HQJXleqDg{LzOG2M}D--1b$Ns&5py zhG?~q%1|cX5UZ#5=xrC+hroi|!w*H}bkjKiTYUr04zr%O$36akYmx>OE!^cV0Dun$ z08stkq)9f$BWf~s+iVCuk7_XcQoz;C__1rYPL4UvteNz~GF}v(`NbQk*b&OVC$DDe zZm}I(x_}%hJt_3p!%1elGuUq(90l8C?1UI*6RWNq=394@AdPj3b*{MRzT96VE4X*y zH?3)R`ntUS{`oUg7WTQPoAzWCCH#fbQ(FYOBttA{uHWa-JEl=8zLOy~b(QGL*qT9k zHnX~p8B$K1)C&8H-P79=t93zSD1hou_Ku=6ik7P1@OS^%++xHgtaPr`Sr&iZMMZYu z{pR{%c=s1I$7i?l{EVa`ie6cM z4qS65Wg7h|DKE~XwR{eUE3hhk^NT0EWreNyC+D>B?y@;-KMrAuF_6JGCbwCP8#$U2 zps~9s*9B0D=OJYJ**Yr%{lsHmKD#b{%&_I04Gh0&RdAYxo3eW5D%}Ii%$ndql$h6! z_xO~T5Zg|xJF2SnVgL8z&-3joe4WMB^ZX*%x1@xbq@#PRgrh(MW|!^dFS0ThKBQvM zLrc6uh{|HOKi#?uHD(J|Eo!+gN#dY#R=6DON4iiLBnq~ZHyM+NP~tAtS~&HCvPYiI zQkB&&9U!DWP)MsHz*7b=nD-SLm&U|MpmI&A?4K1%j@`ewZngCmb3l;!?A!7Zz=Af> zD;}bU)Jq0r$6EZ;JK?pnX`y-+RLq2=9y0t`7(y5r7GWTA+=nX+mojXyn|=a;ecm~$S zUTxVK>lR`dA)a{p-vE}#x#a6P7cxB3*9^|3t0@=K+xY$y_3uQ0U;EV0kc06S{;DzR zXBatWHD>mA?vWW|Wb?Dbsr!X=s9XxHQ*=dez0CZ~SU$GEq(0I?zlEbX0}G0aE!vmb zTyX9$QfbLyDKGL6K2eX2h8!rpK_GVr@dyShgFd$mqMbO9e#&ES*jnY?iHIb)i=tEK z;}B(r_1QpwM~1e8fAT63(&46Jf z5CazPV}Kvu&bekzT876J&!D88p5cYZQ7X%KV~1M|9_HLC4X^FTcS&S^0=KF*_(M0t zChMm8XE6Pp8?sCRT#;0kRqUn1PD2icR>DkZ< zpe0n4kT5UWJs7}a7KH6KtimfK$P=!%ld)lZNWZ^YA&ETSnX7eyvDOxG zT0p0av|jCi*tPC8Zb@jd+_fQEhyZh%_)I+C-jUVkoji6CQj?0Zb~Sa+30!LdtmLA(IabXn)3?a-5VI?0RD zm+>WIP9c@cVM{C>e7)Sdjj|5eRt_0nU)i&V%=j7w6J!kIi(Kt~5Zxbme`PlN&f7U_ zNIn|0gf?gxlW^bUnFv-f8Bmx3;;mme@R{bM~9!oJc*7)F?e`wr$vc2B*XB8?a-B`mob@Y!E`ECN37*DwPS! zwwaJWpS{V-D=VWI=_i1NRkPEnGzcVZy&T<3 zRhzj;Jv@IzE*{6usvg{3x;1etkCI4tuw-fqO)>YI`ZB*VY?O}ppHFmJs+1nUp+`m}Lp?MKg0&^KII#}(2y zgKe7s+%8Z60k>$bwvsLcGPO1LFX-SC`2=5W>0=?iO;G!WfH!rd_gG%l5L8eVz_b%! z6=l=zTdhdAF{78fLxhUhM&|epat(y71sjx>E0E}aOPms{L3X6BPNV_}^|IUoK-T(a z#a*K|@OzBYnCKt%Np+$~qekDvz*O$l&mc??*|>t;VW z2Cq=TNTvf-Nrjg>Q8Q`{EO)VxsL(1ajg87J&i*=71&T{J4#1iS=_4y_{m(P#mBRqqPi&ji|^tho&jKt*`qsd{0!9ar6R*S328eCg%84yQN?j~K6Pl85z;lq8TKURI!gABSj#TUz>_5xAshqz+AV%l1a z$xP-Df;6Lm|7eVjI?_m92m%@^q+uJM36|3XQKdE2Bs>Xfjox4r2X_|(+5^QfjhS46 zz8hcA`kbz{HX$k!%=lCTD@qWr;IkqNd(f>j_S^RoDL5!Y*z@`ayg&aWhhvf~H9MX9 zlE_X5GLotrjeto~@HjS@vfYuj%0=|9+$F6UIg+zrU)fqxKM#*$ZyGA!8fHVS<`6hq zhbd;JvA8K@$o|>Sji?&hGwWFYODccN295_vx4pR2nyDN1Z38Cn}pXUWR~KTgRIzB<}=+D2>f-IqE1aJkfcaydA7;xw?@dE;F7 zSRv@|xg87qrC4f!48-6QShE@o@#a!;ZD!8F9Eh^%ci)2d_k8c?%%{fU(=W|`ofP0^48;kr> z&a5}eC5))3L-^M|LaF>#FWmX`)xp~lebh@mKPQ$86(0zN_Jcxb(FQPvh9KZ#ZawbR z)(-DV-Hc_PaBqe25%Ri+k#P|5Z*cZfxSl2-HzZK28_*3JH%nK`QOr5!{YgO0L6Zx}w^~?yvwemXtno zG!K>EzNiELLZ0TAE2?AiCx&5nXHw#&Vlf7RiJDB9!jJ;@ThIWlJ&_D#@;f1YT^SM^ zWJ&(bv7U8K05Ii7Ec0czT9{0@c9K@MiItQ%L~ zi`T00&UP+dW@0;2I+~AE^?Q1iz$fi(?27zw=43@{06$Mr(UDZf&cT<~dFRexsb{Be`J(p+)%8oQ8s2Rz}@0Vydv}N&%W8@ zT|?Q?EKuiUh?reI5;TQcG(-D7zUdzJH5h`UP(7~`G5jNHf;511fd@MhJ$m821v^9* zE^|(=Z65(9(9__Ny@GAnR5F|%aob83+4EC5I0PiqYk4v}c2C|fTKnzqchOwj&;MYo z((^uS0N?A0P|to z7RJj$AK{g-YEs-P-m%rH!t+MR6*i71f$-I9Y{B+t@+gW~l7wP8MG<*JRO)c#$hqBR2^twMQUa0l;ZZ?}`HO-tV z=kV5DESNh+TIM{~Vjb&r7O z8#{gUAcKFCEs(r)>8_5MDy;U9=!v+g|>j4MYwMi#Ff0_$LiNo|uIH3JbOH5VpDh)~Dm z0M|5^QDn;z$sU=z84Apfx@_~ah5!I={g%bX4;RqoRt{GQ9}++sUBTs50=^`+Ol8M! zYa#=Ly75{GfzuR);ku)ERi04Ix;?_Wa zD`m~t7JW3g@(^)HDexb8dZ)ScG&OKEI(}kFd9`X)_=htO@?Qw}4`MhT%lY25Yz|Kg z(^G%SYKzAG!2|-vV3OHBS85;;=R6hlhT((DDO*X`~hjVv>hFq*%LG-+%8n%F9uqb)_#jEs}Qqo~dl)ss;A z$r)02<#;fR`ot4s#x9xZy5~hBZ>=XGNpKcJ55X$l3(V_4; zN#${s>t#u$jAh)MD^hC<1D~86B>3Wr{nQ{B-MJ|BJ6mv*sWGe+%`Etv2(;s}=U1}& zUV)tb&95^;@@z2osK+cfaJW`5+rOgBsFuMG^MaIGxf+=qj4zsUh;9QE3D7zVg zK&cE6$w3_lrnQX;odsikbh0f~@zwG+hCZkxN^sFWEVR?zh+LJ||83DaiE8p;#$-Gy zJ>>H8BlC$>Z9(d+@!qO!k|9OYv07J$2NubYK!r8`=05S=UWzxNI-;@*rr8C<2 zK#Q?oi^Cd>F=Lbg8TuSvf}JV7|E?|z8^yY_mjrfVjA_@_gzeK~(VpKjJi5_i+F0*x znwY#T12!!TR$;}xN4V&I;Uo(5D2*t3+HWjr<1{1TjHd=oP3SvF?(wN(62v*(Odd^o z)z&bCGzuDwj5??T9P`lbfbQ9WRI679V*17$3wm{DJfRM{CPl|0n3*U?{S$eR{^}iXqvUm$BydJX)%HJDCBZ%8_Zbl_r)3f9O?1Waf{yfBU4)97<(%u#?_S56bHrJA5{~{TNU?&CIV!61rQy z)qmKhT{?Y%(ADcXi!2iYp5i2$arx~%GMKrXI2}abnr-5mY z^_nI5(=BxWuG5GC^3`dD772SFwowGkF2&%mc5-{pkrPja;d(sNLF2^S(s);NUQm`m zj$!YeSRI!bG#vc5%!RQD?;-?IU&3#e*7z_zA23@su^-jYA?#7lXZru98G7!&y0HGy zjHZ7l7U=#jiLQg2i7oB_b*91p1ZfO7ZgC*>oKeg3MYURR$Ff%7Sl2NhZ4S%gkf&87 zLy-tVBK~FoP-rlxRDQ>N_k1V%>;Nby?$;-lwP_#;=6C*W60rT4GZVT#H#|dcNRldZ z?W0pkl1Qs6m8kwGbgYXko=4Mbw%DEx&&|6s(r%9vA8hY1^MZ1AkauKwvQ`qSMQ zQ|-$482h+L?c4pxY(%cwGCHWrk(M=DHM;bJ40p47AFiUuU5(a0kuiHZ*|1R->*r8< zp`(faiQLz4s7CwAv6363U(tkGGu>^sL+|Cap5d}#YkS!`Q&U)9~_w2j7KlI1?t?Jd)RZrEw0wMG1?01vP_lcDk^>E)~)9zP7 z*T8nk6%23b_@+a*9I}s##nU&A3Ib10mDv>vllCJy_`w2vf^iHU9%&Ruu!m;ClS`m!sn zZMEIFUxxS1eEW1fuixWAxijrlVB%vt$-N}aq*OJD4CA{jj}Pf{Qv=&xd{|+emLoWH zmU$Sn+YzrXGG$~+%g4`_E-$t3EaX&50FX0v{N^J3ps#n)9&REzrn|xoVxH8TU6bjl zw%Oi?kmCGH8Ja{62q~X~rX;7ROPK$-tnz0a^;ye0CG}J-qG}mUzN;S+Z;+Dx9rfH- z=HynTRvtWEndNqu$N7Qq<{!tX%J48W_eDK*URUCCIN3*ES#Fpwp^eS$&t-oR{n2XK ziAY|fLLS8pcxPGeDWmYEi7wm4W*}{DcQp7=l z*K0Crp2>2}K8nsvca{1jE6_Bd;1&NJBIp(+wx%g-+inX+inHnk0o@Uq=t3ibsEDq} zOu*{#{W4)Okz2_JvKG0a@^)e>`-n8Ao_4-lGDaY6JaTxyT9HJZD6C)&nIp_aJ%3Q{ zMep4^LMXl_1Qu*j$<#*99X>?quAV>ZhR!cLGzTbNX?d4Kv14eTD1aE~&&$S% zEdr@nhX8o1{Zq;@1^K|gbuCh5Bm3Jkj@XA1cjRgl=dp@u&-%tp$_)x7a7&oiv;h1h zj)t5bB5u>vd$~P7;pkQ_`;t1?zrZnO)xzFP5LQAJUP+yIN;B>@S#fuymlJ&>Ja9hy z3AXD`tf-6OL^BxNE*V<|W@JQSo&he#DqY5zBC=XeJx;#u&^M5m7lpYce8%ofa_f$! zG+fivz|AEpU7l@^6>i{mrQ=WoEEkB;`S;0XYS;|1_M@fDR35{7$GP}yd8fJJbI~e` zqn0vVHq^`MD}AKrm!u{h6}U4=Pitj#NCG&Z1u#1lV`srjYC*>)`(-)&9SnEu2iePB z6^L+c^6L-Gp`Z)&b&U=-qS6ZT)u3Yrm5FLeiYAnA7=5y_Ng8X9uQ&5-^#iForHm#|!E5D7lju)@j0uW#ytHo+VXXLbX ze?pZ<&yz<5+xAL1O-7|q!lYm;!2!}c#hUY$#4}nf8O@OObkq1j@@a)PeW&RXfTL~0 z zYMIUO!fPn$J6QN*1-1W&u3Zk zK)Exky)2iMS{40@ZVy}fD`_xhwC3Dv$V|-8%0y68(ghu3@LY3TT+E;y*Se&;vx3F~ zSV5TiSd`*b<_D9cn<{ECSWsabN!`WFM5$KGGIBiN(wb><9^G~#IX;gMls?P0z6h{G zDKQ5eu*u9SVl2Cb*(4ZXG>k=)UH1?0ZbIsuO9RDm47j&DyQbeW4;u z1F;?!Hy<88w09j~>Bc-E4NS$7#6+zY%Fo&u6S9nh!o8-?s!HGvA%AmY<=7RCKy~dJ zOf0#pH651_pQ{Prpt>jvRRxe+u8C@ z;V1q@*JHh}16y-$HtUW#mSz3m^9hIaMcY2tW5a+dDBQb{h?6t*Nq6AG6e8}XK;QeM zFSN(%pGM5D8MJs(m)Y zQe?672c*BT-PVJ21QX%|R1p&SQiw4({Eetz7@uCB*V}#njq_i#5(1SP3GL?&J|a3C zoX)>BE3q-rRo7LW5g_bZ*LN^mdr8sU{`yk{CP^4?e^}V7HC}A9>1kW2yk$aN#a66e zPGW=qiZG9jV)nUr=7rE*otbQ?NIlDX!tVI(5ZxQ!+LXvCcO6pmev>nofq-EagnRAe zIjQ!P(zB|<7Nfg0GOJUSH zAJ8zCZt=0mKyC~U)2A&mvbHOp^iXRl7v1{!bb4gRl*rD3x%PpiHJ=Y1>G%klIa5aW zV{@wqm03)hHEyF{iu4Ak)7sQtIU@b|>Xg%0PxWka=9sMjwL467koFDEY?V6SdTGx{xMX}B|Z(%4rQX7f}4-@_k(@Xo=sB` ze_cU_DwolmEiVYbfE&+PT3`w;p*|6T!91%^4TibXEtKS>Y8%;r-ag-huwn~&8V=kI zPQKPdb?3@RDKrFlZLgkZ8oaqbKNMbXQ9l+&Dkn=S$PLI6fJwfcESTySbXxz=4m7p5 zmUVh^HudgVinzpj93U1~o)Ge@b%ojs9Y~TKJ&@A%3G`sW!j8d7BDbU0yP-2>_5>$C zT3fe@hN6V4n0lRF$dw~%BB9q{jhMW%I?*F_l*{!)y^fV>9cEp9ye+1kAjs?> z>SefBJ%s&&k4Hd#q;oh~#9xj|o;AeK(##u6)K4qQC2C&S@P+2FfTINxgQ}Np3G)0V z9q%QkQl|D6Z;5<8=i^!zgSKMWo{& zW`Rn@JTt9>upIZv+l)bAbmfxp8&fMea`oQV^2VEHLX&C6qJ{kubK;*)EEm)KVXAfk zUr}b2Mr{V?)6?!BCql)nqNvjX+oNaY_0jn$N_YZrns&9(I^vWe*+4*xG&ygXnrq;Q z#z#g0;;Rsmf-8FJhHw+GOw1O4p)oUGp^DKbok|GL38b&qo$n&6p;58xE4>n(a%xb_ z%f*2axFdiBCI7Sof;MK^_q|S8Irk&>h8*e$kW#0kydzZR0tggU7*76~5s+OSno3pu z+_lrE(5K3w=;D7T_~Bb~;w{TJ=q*@$%iuu&4RWZY#ijceIZaRvhs$wdPH-&2ORx$5 zJ2Zs}@*%@jhHf|X0u~%>-Znci5)`g!_ai)^oVEInlv=3WRUy$Jo8sHr=0(<>z;NiC z)-7?MU~`($7AaiA0hBLSfEdj;4GP4x=(v+=nDw9gFOPF53mri}98nE-1eaonn9S`K3E;Tqe}e&xlOnYtfCK zJ?R6z4-GU5raCmjNzSpWt<39_CLqXXp7;d+UxT_xL&d%7^Z9NL!T*<_ZuFLo?e7cC z)G@~uZv3yuzUVXCHL14~Vs$3wiV+0W5KVKU<%7`_*uRBsdxApxqRfX}`e1C%C-?WRO<)1uG>i;ut=;btXSdhiQx6JuCLKML$lvKERiR=yELyvW*B|eWYFa;z4CC3)9qSN` z%{^!&rO!gtxA}KrgL7d1(kvnLK`E3>A>IVUp#;{aOv6`i#9ZxLohG^zZxE<@b>REMQ>5RMGx$DqevDqb5^thJHKg{m+1}44jKjGXi0)&}TmlH@Z%EXpJLaw#kM8n}@ZCgk=b z8N9?{g9i|*nYPLU#O6)o!K_S^Rb;7~0p6^Wu~)3`9G`f+pfN+lf%+@4WixiQ`PNSeOFn`EyfQ9Y2|1~b^p!fXFS;x@)Bx9D=+ z#x2EZGgT#d`KGDU-d+SvCU$4#S8&Q4Jle?KddqM#s-{$o5oW>*NWIl=e)5ZsVvDTD zAwo{%c)bdv8`HIf#>|=tcA>K%v98O8Y6_xeg3Q(c982*Dq}j3d%1Cm;hh%=@Nb7hG zjPY3VPxcJ9bGk+9t|&HN^G_C~nb{~0kJAxo_Q!T2Z6u1@((~`XsHWkYPmZ1BG-UDF z8Cfeg)8T@g1C;}bZ%Iqxc%D~g!J$xi(3Aod_N3(NpfB9{yl@=sJ_mKaB*nWcThLU? z@4V{UDBCGUmrn_zVtL0QLw_E{C$rQFrhuh2XOx{X4U(M_UBrZb%gn;`!$J_y*){N0 z{v{|hg=!eaXG~Ptb1@d@jbh54K)6@3^3z;ErD)q&O?_=2p9I+ig;GUEd5Jr|zzXBb zK#``fL7)6ayp&9}E@d7D-VUkngXUPsBY_S=ZW!Esld~W>E3kqOtaF@BJwROa|Ov* z7ka%>JgEGp!qku%tHdbhU?UwiOg^E(BvxhDXAvTBw{!Kum0nNrBPJImhPs{l>|wVz$>4uq$Q&MGvJq? zDlx(kCl6i%b{f$j7L=%M_it4GOBjc>(JAV$1HCG>Bdr$q2l#k;h)_n_n`8plD%i2| zgo?gZJGSkHJm#^Oh5$%fB@Nu0ya(OjSZ8G$=p&Vyt+C!5&1RLKm%N_mR{CgsY{cU@ zEH~M@^gjHwy3#avZv;)X4rr#$z}x(hjp;b=6iEZzrB4*kx|R0+Yi>wI;qlQY+F>N!5XE;p|~>DOdjl5@@QQ-hgPZvA7+ZEvn0 z6BQNztkC4FexUn5S7-*$6`Iz+UZMT%&-}Sxt3GPG!i(E+00Ior^?FKV-w?$rj?)K3 zcN`k9ieQtM(XppU1w#e0d#Ji+3Ax58Nl@`6iQCJ|%OgA`^qZ~sFDExP(gmJOC|dJJ z+#d`wu?Q*lQ!XiNT3oYF6)yOVGxA$zZDB6p?v^99{>aqP+0ErWo+E!to;%2;|8t`} zi!x4aa^-F9$E6n3coYuD5J1zf*+fX+pI{dIj({es_ zzRB!KS=^3Nuw?9FJ!AR6ak^DrGppj__Oxt@!Mqy#`$dFCafQNn{r#U0JGW(mdKA^_ zp?5dXicIVsR(QKBSb@L3HJsO?#`hImc{^VQ`$)9!k)n$cU7$*jun|jog1(`PUweK) z`A|`hi+p=+Sv=!*c>}*3tzbGdyvEuxn#wzo&x2E`qs!XAa-Eu_W!c$>-X!7Gi9+s< za%)h?EU4+Lo1{V-Y$v>Oy zc~3xijq^9+CQ(T_S-QTi_T0};q2ZxgTJ4roeJ7X|Jv2gYc28J5Gq=AQsAHtuAA5+S z+^5eHpB37ZE(8%ElgRlVx>^IUIjVNO0>47DD!=_cT)M%nkD{71s{JtG_j|Cuynu@= z^6jfftJ`c_!8KpUuHtT`aw@QI?#t^PmRaL8PhU#0rg2rVUEx6Vfbz%(4o2C0bO>mA z*a^-UC#X&vH%2JJH@fVtLuzVpojn?N$sRUn%N7q=fhM>%QntZ6b#PB@#%3yN3XkYS zlK^*G60MU1nGGKR&*tKa8y5Pqja09O-FL6S>Gw&XJj3FGZx5 zI9wrpPqqpJ&;RO~jPZ>DrhB4nl8@Y$4kBGv^o0e$P;T;>fHt-M6CmAdtLv!68oF5n z+grCKk~Wcq$#z?5I~~A^6scV3Eb8do+NCPthw**M1fiy3=gbrhb1TaZfEJ)*G@XeB zqD60Gq{b$$Q$jjW5Vt>f+ip^@wuhLG{FGK$P1|dzs zb+UCGNE1MGw3j?fG64oN%Td&DKjp@RN5lI&3L5OHnO$9c0z9T2cd2(~Bsts7IiwxT zlsvzS@`fBK%r~4WsA+Aa67}R0rz|-vN{PYCw7f-d5E6s8<;vDdCV0`S5rAloIEC8? zn=6$k)Tg%`Vek{B8mDHzBQH$EN`MZ$u^q8`cL()6#3K`iCmX!lk0B?Ow04TeItj%L zI`1Sb+8@8-s2dNW2>)slnkM#%UYtsy=~WPzO=-lr)z1`Se2P(k$9zSZQWAs}Pbi!h z!DAn?QYDS@NmgQLL-l3t4+|vRWoDj5S%}+7N*d7crB{iBL>8pAxeMC)<#V=$tV(rI z5b`8Z(cH&zje~6hG%&Y(|4fhkPlx<@7XB9tm-N4r<-dF7&jXylNYEAkWs<+m0RN%>{?jLaW}knN%s&hM m{wML_Kfl`lct3wj@(+(7J!{?J;Lx9M%;)U)`#+i!aQ_Q1b=`6R literal 0 HcmV?d00001 diff --git a/tests/knowledge/test_atomic_casebooks.py b/tests/knowledge/test_atomic_casebooks.py new file mode 100644 index 000000000..8da3c365d --- /dev/null +++ b/tests/knowledge/test_atomic_casebooks.py @@ -0,0 +1,77 @@ +"""Casebooks comparison inputs from the released v0.3.4 wheel and its native Reader.""" + +import hashlib +import json +from pathlib import Path +from zipfile import ZipFile + +import pytest + +from inferrsi.knowledge.decision_cards import DecisionSource, UnknownFinding + +FIXTURES = Path(__file__).resolve().parents[1] / "fixtures" / "atomic-reader" +BASELINE = json.loads((FIXTURES / "casebook-domain-v0.3.4.json").read_bytes()) +CASES = {ref: row for ref, row in BASELINE["refs"].items() if row["kind"] == "case"} +FINDINGS = [(ref, index) for ref, row in CASES.items() for index in range(len(row["findings"]))] + + +def digest(data): + return hashlib.sha256(data).hexdigest() + + +def canonical(value): + return json.dumps(value, ensure_ascii=False, separators=(",", ":"), sort_keys=True).encode() + + +@pytest.fixture(scope="module") +def originals(): + with ZipFile(FIXTURES / "casebook-sources-v0.3.4.zip") as archive: + files = {name: archive.read(name) for name in archive.namelist()} + assert {name: {"bytes": len(raw), "sha256": digest(raw)} for name, raw in files.items()} == ( + BASELINE["files"] + ) + return files + + +def decision_source(ref, originals): + row = CASES[ref] + raw = originals[row["case_aliases"]["case.json"]] + record = json.loads(raw) + assert row["case_file_sha256"] == digest(raw) + return DecisionSource(ref, row["revision"], "case", "case.json", record["content"], record) + + +@pytest.mark.parametrize(("ref", "index"), FINDINGS) +def test_one_released_finding_reproduces_its_native_decision_card(originals, ref, index): + row = CASES[ref] + expected = row["findings"][index] + source = decision_source(ref, originals) + raw = originals[row["case_aliases"]["case.json"]] + excerpt = raw[expected["start_byte"]:expected["end_byte"]] + assert digest(excerpt) == expected["span_sha256"] + finding = json.loads(excerpt) + assert source.record["findings"][index] == finding + assert digest(canonical(finding)) == expected["finding_sha256"] + + selector = expected["selector"] + budget = expected["card_bytes"] + exact = source.project(finding=selector, max_bytes=budget) + card = exact["card"] + assert card["atom"]["pointer"] == expected["pointer"] + assert card["declared"]["finding"] == finding + assert exact["status"] == card["status"] == expected["status"] + assert card["missing_fields"] == expected["missing_fields"] + assert len(canonical(card)) == exact["card_bytes"] == budget + assert digest(canonical(card)) == expected["card_sha256"] + + short = source.project(finding=selector, max_bytes=budget - 1) + assert short["status"] == "over_budget" and "card" not in short + + +@pytest.mark.parametrize("ref", sorted(CASES)) +def test_casebooks_require_a_finding_from_the_selected_case(originals, ref): + source = decision_source(ref, originals) + with pytest.raises(ValueError, match="Select one --finding"): + source.project() + with pytest.raises(UnknownFinding): + source.project(finding=f"case.json#/findings/{len(CASES[ref]['findings'])}") From 10326a5d1236355a6a620aafec720d2edb22e7ce Mon Sep 17 00:00:00 2001 From: Dong1017 <55723162+Dong1017@users.noreply.github.com> Date: Fri, 27 Nov 2026 02:15:23 +0800 Subject: [PATCH 03/12] Pin four released Case sources and 22 individual finding atoms Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com> --- .gitattributes | 3 + .../case.admission-drain-occupancy.guide.json | 68 +++++ ...se.admission-drain-occupancy.original.json | 180 +++++++++++++ ...case.drama3-rejected-directions.guide.json | 67 +++++ ...e.drama3-rejected-directions.original.json | 238 ++++++++++++++++++ ...qwen-ascend-rejected-directions.guide.json | 67 +++++ ...n-ascend-rejected-directions.original.json | 226 +++++++++++++++++ ...e.qwen-b300-rejected-directions.guide.json | 66 +++++ ...wen-b300-rejected-directions.original.json | 225 +++++++++++++++++ .../casebooks/admission-drain-occupancy.json | 69 +++++ .../casebooks/admission-drain-occupancy.md | 55 ++++ .../casebooks/drama3-rejected-directions.json | 121 +++++++++ .../casebooks/drama3-rejected-directions.md | 24 ++ .../qwen-ascend-rejected-directions.json | 106 ++++++++ .../qwen-ascend-rejected-directions.md | 24 ++ .../qwen-b300-rejected-directions.json | 109 ++++++++ .../qwen-b300-rejected-directions.md | 23 ++ tests/knowledge/test_atomic_casebooks.py | 59 +++++ 18 files changed, 1730 insertions(+) create mode 100644 src/inferrsi/knowledge/atoms/case.admission-drain-occupancy.guide.json create mode 100644 src/inferrsi/knowledge/atoms/case.admission-drain-occupancy.original.json create mode 100644 src/inferrsi/knowledge/atoms/case.drama3-rejected-directions.guide.json create mode 100644 src/inferrsi/knowledge/atoms/case.drama3-rejected-directions.original.json create mode 100644 src/inferrsi/knowledge/atoms/case.qwen-ascend-rejected-directions.guide.json create mode 100644 src/inferrsi/knowledge/atoms/case.qwen-ascend-rejected-directions.original.json create mode 100644 src/inferrsi/knowledge/atoms/case.qwen-b300-rejected-directions.guide.json create mode 100644 src/inferrsi/knowledge/atoms/case.qwen-b300-rejected-directions.original.json create mode 100644 src/inferrsi/knowledge/atoms/casebooks/admission-drain-occupancy.json create mode 100644 src/inferrsi/knowledge/atoms/casebooks/admission-drain-occupancy.md create mode 100644 src/inferrsi/knowledge/atoms/casebooks/drama3-rejected-directions.json create mode 100644 src/inferrsi/knowledge/atoms/casebooks/drama3-rejected-directions.md create mode 100644 src/inferrsi/knowledge/atoms/casebooks/qwen-ascend-rejected-directions.json create mode 100644 src/inferrsi/knowledge/atoms/casebooks/qwen-ascend-rejected-directions.md create mode 100644 src/inferrsi/knowledge/atoms/casebooks/qwen-b300-rejected-directions.json create mode 100644 src/inferrsi/knowledge/atoms/casebooks/qwen-b300-rejected-directions.md diff --git a/.gitattributes b/.gitattributes index 226ca6356..f75926676 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13,6 +13,9 @@ /evidence/README.md text eol=lf /evidence/_template/** text eol=lf +# Case atoms address byte ranges in the original release files. +/src/inferrsi/knowledge/atoms/casebooks/* -text + # Retain this upstream license's original CRLF Git blob bytes. /src/inferrsi/knowledge/data/skill_library/systems/frameworks/torch-npu/torch-npu/references/licenses/op-plugin-LICENSE.txt -text diff --git a/src/inferrsi/knowledge/atoms/case.admission-drain-occupancy.guide.json b/src/inferrsi/knowledge/atoms/case.admission-drain-occupancy.guide.json new file mode 100644 index 000000000..6aad0c381 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/case.admission-drain-occupancy.guide.json @@ -0,0 +1,68 @@ +{ + "authority": "checkout", + "metadata": { + "id": "case.admission-drain-occupancy.guide", + "kind": "knowledge", + "title": "Admission occupancy is not whole-run occupancy", + "backend": "cuda", + "origin": [ + "internal" + ], + "state": "historical_observation", + "applicability": [ + "Continuous admission, mixed prefill/decode and final drain", + "Recorded Drama3 B300 C64 diagnostic only" + ], + "limitations": [ + "Campaign INCONCLUSIVE", + "No new measurement or trace reproduction", + "Selected-phase occupancy is not service throughput", + "Raw evidence remains under its existing owner" + ], + "attribution": "InferRSI issue #10 diagnostic evidence; extraction retains the original observation and its limits", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.md", + "sha256": "e88bbac5d253a8e7e3a3d5e21047f23f2970c11ac23887d4303ab94fca52dd27" + }, + { + "type": "internal", + "issue": "https://github.com/InferMatrixLab/InferRSI/issues/10", + "run": "drama3-mixed-20261016", + "artifact": "vllm-continuous-schedule.json", + "sha256": "29e5cafe329cb85eaba69db7536a28a83fb7e3ac29bc154fc8747f317f6a4b3f", + "request_metadata_sha256": "bd50166976a4753b33c8aeb5a774ebb5711c74ccbba0df1843885f353ecdc996", + "integrity_status": "reported_not_rehashed", + "evidence_url": "https://github.com/InferMatrixLab/InferRSI/blob/c13027983b853fee3700de6aabde52b72e61885a/evidence/drama3-b300-scale150/results/diagnostic-lessons.md#continuous-admission-profile-and-mixed-backbone-2026-10-16" + } + ], + "entrypoint": "admission-drain-occupancy.md", + "atom": { + "layer": "L3", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.md", + "byte_range": [ + 0, + 3134 + ], + "sha256": "e88bbac5d253a8e7e3a3d5e21047f23f2970c11ac23887d4303ab94fca52dd27" + } + } + }, + "content": { + "admission-drain-occupancy.md": { + "path": "casebooks/admission-drain-occupancy.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/case.admission-drain-occupancy.original.json b/src/inferrsi/knowledge/atoms/case.admission-drain-occupancy.original.json new file mode 100644 index 000000000..b8fb4a672 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/case.admission-drain-occupancy.original.json @@ -0,0 +1,180 @@ +{ + "authority": "checkout", + "metadata": { + "id": "case.admission-drain-occupancy.original", + "kind": "knowledge", + "title": "Admission occupancy is not whole-run occupancy", + "backend": "cuda", + "origin": [ + "internal" + ], + "state": "historical_observation", + "applicability": [ + "Continuous admission, mixed prefill/decode and final drain", + "Recorded Drama3 B300 C64 diagnostic only" + ], + "limitations": [ + "Campaign INCONCLUSIVE", + "No new measurement or trace reproduction", + "Selected-phase occupancy is not service throughput", + "Raw evidence remains under its existing owner" + ], + "attribution": "InferRSI issue #10 diagnostic evidence; extraction retains the original observation and its limits", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.json", + "sha256": "4f8544292b2cc3391f4d4d75994cb81fdd295eff99e55b7e60374c6c122de09e" + }, + { + "type": "internal", + "issue": "https://github.com/InferMatrixLab/InferRSI/issues/10", + "run": "drama3-mixed-20261016", + "artifact": "vllm-continuous-schedule.json", + "sha256": "29e5cafe329cb85eaba69db7536a28a83fb7e3ac29bc154fc8747f317f6a4b3f", + "request_metadata_sha256": "bd50166976a4753b33c8aeb5a774ebb5711c74ccbba0df1843885f353ecdc996", + "integrity_status": "reported_not_rehashed", + "evidence_url": "https://github.com/InferMatrixLab/InferRSI/blob/c13027983b853fee3700de6aabde52b72e61885a/evidence/drama3-b300-scale150/results/diagnostic-lessons.md#continuous-admission-profile-and-mixed-backbone-2026-10-16" + } + ], + "entrypoint": "case.json", + "atom": { + "layer": "L3", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.json", + "byte_range": [ + 0, + 3602 + ], + "sha256": "4f8544292b2cc3391f4d4d75994cb81fdd295eff99e55b7e60374c6c122de09e" + }, + "source_pointers": [ + "" + ] + } + }, + "content": { + "case.json": { + "path": "casebooks/admission-drain-occupancy.json" + } + }, + "parts": { + "identity": { + "layer": "L0", + "pointers": [ + "/id", + "/kind", + "/backend" + ], + "byte_range": [ + 4, + 81 + ], + "sha256": "20229c5fde158feda971aaf38b1083c1224ae85995eb387aea9a3750b1146f81" + }, + "origin-state": { + "layer": "L1", + "pointers": [ + "/origin", + "/state" + ], + "byte_range": [ + 85, + 144 + ], + "sha256": "a0cf30b585b5ae364c5825fc160025f28064be575cedbe123739f8d1331be20f" + }, + "resources": { + "layer": "L2", + "pointers": [ + "/content", + "/required_resources" + ], + "byte_range": [ + 148, + 249 + ], + "sha256": "8b95453271f4ec54318420fda1203a0487460837c1b68530d2a9bb3bf90801ae" + }, + "sources": { + "layer": "L1", + "pointers": [ + "/sources" + ], + "byte_range": [ + 253, + 935 + ], + "sha256": "43de95f40f46e16a5f716c6774bdbc590cd8e2f1238b17ca1e6d9a09c29998f5" + }, + "applicability": { + "layer": "L1", + "pointers": [ + "/applicability" + ], + "byte_range": [ + 939, + 1062 + ], + "sha256": "24ee65c81e2254c74fa5fa179aaf72869e0bc9237ed0952178debb570000cc32" + }, + "limits-attribution": { + "layer": "L1", + "pointers": [ + "/limitations", + "/attribution" + ], + "byte_range": [ + 1066, + 1372 + ], + "sha256": "80ce13bce9ed80b83e0be1a65b4a01ad4870631e35dece019b10efa94f9ef197" + }, + "finding-0": { + "layer": "L1", + "pointers": [ + "/findings/0" + ], + "byte_range": [ + 1394, + 2249 + ], + "sha256": "82a530dd7402fa10f0d445609238cc0451779afa5ebc0b02feb182f8e8c518e4", + "title": "Split admitted traffic from the final drain when reading decode occupancy" + }, + "finding-1": { + "layer": "L1", + "pointers": [ + "/findings/1" + ], + "byte_range": [ + 2255, + 2911 + ], + "sha256": "29844fbb80c01fedfa2d1499f6b647c39624fb23008809870f815c5fbe86b9e9", + "title": "Count scheduler steps using owning CPU annotations" + }, + "finding-2": { + "layer": "L1", + "pointers": [ + "/findings/2" + ], + "byte_range": [ + 2917, + 3595 + ], + "sha256": "a48329e4a1aa6d303ed6bfe65b967f0b0ec4972d66d7e42f339e5d31e078cd16", + "title": "Carry the complete cohort into the service gate" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/case.drama3-rejected-directions.guide.json b/src/inferrsi/knowledge/atoms/case.drama3-rejected-directions.guide.json new file mode 100644 index 000000000..4ad1b832e --- /dev/null +++ b/src/inferrsi/knowledge/atoms/case.drama3-rejected-directions.guide.json @@ -0,0 +1,67 @@ +{ + "authority": "checkout", + "metadata": { + "id": "case.drama3-rejected-directions.guide", + "kind": "knowledge", + "title": "Drama3 B300: rejected directions and invalid controls", + "backend": "cuda", + "origin": [ + "internal" + ], + "state": "historical_observation", + "applicability": [ + "Drama3 standalone native-computation runtime on one B300", + "Only each cited microbenchmark, fixed-state diagnostic or complete service trial" + ], + "limitations": [ + "Campaign remains INCONCLUSIVE and optimization is paused", + "Individual completed gate failures do not complete the all-concurrency acceptance matrix", + "Repository summary inspected; external raw traces and runtime artifacts not rerun or rehashed", + "No root cause inferred from client accounting or cross-screen timing subtraction" + ], + "attribution": "Issue #10 diagnostic lessons, including runtime 47c3d2ec4e3406d8a71fccc3cb4967783c2650f5; revisit checks are current suggestions", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.md", + "sha256": "6f143bc363a3290fc008c08e57cb075f1776d1c8cca8a6a59297d5b1fbbf61bf" + }, + { + "type": "git", + "url": "https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/evidence/drama3-b300-scale150/results/diagnostic-lessons.md", + "commit": "d51c941dc57807c1e16ea698cd9291f414110c45", + "paths": [ + "evidence/drama3-b300-scale150/results/diagnostic-lessons.md" + ], + "issue": "https://github.com/InferMatrixLab/InferRSI/issues/10" + } + ], + "entrypoint": "drama3-rejected-directions.md", + "atom": { + "layer": "L3", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.md", + "byte_range": [ + 0, + 3557 + ], + "sha256": "6f143bc363a3290fc008c08e57cb075f1776d1c8cca8a6a59297d5b1fbbf61bf" + } + } + }, + "content": { + "drama3-rejected-directions.md": { + "path": "casebooks/drama3-rejected-directions.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/case.drama3-rejected-directions.original.json b/src/inferrsi/knowledge/atoms/case.drama3-rejected-directions.original.json new file mode 100644 index 000000000..ba8512954 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/case.drama3-rejected-directions.original.json @@ -0,0 +1,238 @@ +{ + "authority": "checkout", + "metadata": { + "id": "case.drama3-rejected-directions.original", + "kind": "knowledge", + "title": "Drama3 B300: rejected directions and invalid controls", + "backend": "cuda", + "origin": [ + "internal" + ], + "state": "historical_observation", + "applicability": [ + "Drama3 standalone native-computation runtime on one B300", + "Only each cited microbenchmark, fixed-state diagnostic or complete service trial" + ], + "limitations": [ + "Campaign remains INCONCLUSIVE and optimization is paused", + "Individual completed gate failures do not complete the all-concurrency acceptance matrix", + "Repository summary inspected; external raw traces and runtime artifacts not rerun or rehashed", + "No root cause inferred from client accounting or cross-screen timing subtraction" + ], + "attribution": "Issue #10 diagnostic lessons, including runtime 47c3d2ec4e3406d8a71fccc3cb4967783c2650f5; revisit checks are current suggestions", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.json", + "sha256": "a2dc5db8aba62081c5743b12f854e74ae500c53bd57e2486260d0b5ae478638a" + }, + { + "type": "git", + "url": "https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/evidence/drama3-b300-scale150/results/diagnostic-lessons.md", + "commit": "d51c941dc57807c1e16ea698cd9291f414110c45", + "paths": [ + "evidence/drama3-b300-scale150/results/diagnostic-lessons.md" + ], + "issue": "https://github.com/InferMatrixLab/InferRSI/issues/10" + } + ], + "entrypoint": "case.json", + "atom": { + "layer": "L3", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.json", + "byte_range": [ + 0, + 6270 + ], + "sha256": "a2dc5db8aba62081c5743b12f854e74ae500c53bd57e2486260d0b5ae478638a" + }, + "source_pointers": [ + "" + ] + } + }, + "content": { + "case.json": { + "path": "casebooks/drama3-rejected-directions.json" + } + }, + "parts": { + "identity": { + "layer": "L0", + "pointers": [ + "/id", + "/kind", + "/backend" + ], + "byte_range": [ + 4, + 82 + ], + "sha256": "d4529591039baeaf24838c5ab7cfc09f80490a5c6d4049c989384fb400c16a60" + }, + "origin-state": { + "layer": "L1", + "pointers": [ + "/origin", + "/state" + ], + "byte_range": [ + 86, + 145 + ], + "sha256": "a0cf30b585b5ae364c5825fc160025f28064be575cedbe123739f8d1331be20f" + }, + "resources": { + "layer": "L2", + "pointers": [ + "/content", + "/required_resources" + ], + "byte_range": [ + 149, + 252 + ], + "sha256": "9528a4c7c2bdf0c8e11c14546ac76f9d804a40f76f7ebd8918b348244074fad9" + }, + "sources": { + "layer": "L1", + "pointers": [ + "/sources" + ], + "byte_range": [ + 256, + 660 + ], + "sha256": "2538ed8c5621060fb1e7dba6dae29a82f41b6899c854c8beade600659e7406db" + }, + "applicability": { + "layer": "L1", + "pointers": [ + "/applicability" + ], + "byte_range": [ + 664, + 825 + ], + "sha256": "12332d282309b690073fdc12283d73527fcbff464ea3a79667a76ac98241f593" + }, + "tags": { + "layer": "L0", + "pointers": [ + "/tags" + ], + "byte_range": [ + 829, + 976 + ], + "sha256": "0aa15eaebe4ed478bd29a65100a2d3d0761a46165608dc062a9c469c5850a4db" + }, + "limits-attribution": { + "layer": "L1", + "pointers": [ + "/limitations", + "/attribution" + ], + "byte_range": [ + 980, + 1477 + ], + "sha256": "1cddd6a8a73b86559b45089dccded2bede890141e057e876273c6177daa616ee" + }, + "finding-0": { + "layer": "L1", + "pointers": [ + "/findings/0" + ], + "byte_range": [ + 1499, + 2154 + ], + "sha256": "4cae0fad3460d28e4176d079c1246dcd88af21fefcc1191412c153dc5696e075", + "title": "Qualify fused tower projections and longer decode groups at service scope" + }, + "finding-1": { + "layer": "L1", + "pointers": [ + "/findings/1" + ], + "byte_range": [ + 2160, + 2910 + ], + "sha256": "e02ff5d0a442030bb8a6d8a8a6901670ab0f92ec8d2c841536ea72b63cbaac1a", + "title": "Check ATen cuBLAS workspace sharing when codec capture changes WER" + }, + "finding-2": { + "layer": "L1", + "pointers": [ + "/findings/2" + ], + "byte_range": [ + 2916, + 3583 + ], + "sha256": "0eeabdcdbdaef2a15186186d1b2649be9dcd651f94038c0a5dc4136876a7cd1a", + "title": "Require the complete C64 continuation gate for production prefix reuse" + }, + "finding-3": { + "layer": "L1", + "pointers": [ + "/findings/3" + ], + "byte_range": [ + 3589, + 4342 + ], + "sha256": "d9c5f1ab879b45558322e5ef73833d1a6aad3e8db7eb2c02ba78bd3eff9bb76b", + "title": "Reset private padding rows before an A/A state comparison" + }, + "finding-4": { + "layer": "L1", + "pointers": [ + "/findings/4" + ], + "byte_range": [ + 4348, + 5027 + ], + "sha256": "c687cb2d1b8bfe3d1c5b0c2d192fe9b7f64f8d6a2c5a8421a37a2a1c42914882", + "title": "Require physical traffic and a timing win before enabling transparent VMM compression" + }, + "finding-5": { + "layer": "L1", + "pointers": [ + "/findings/5" + ], + "byte_range": [ + 5033, + 5658 + ], + "sha256": "7964442a9f13413d3d97125b3faece7abc39803dab979900fc6db3bab9fd1f17", + "title": "Measure complete kernels before retaining a producer scale-tile cache" + }, + "finding-6": { + "layer": "L1", + "pointers": [ + "/findings/6" + ], + "byte_range": [ + 5664, + 6263 + ], + "sha256": "d345b2c36452eea31e6ae4a6c530142a6ce543116c86c4cd6be043bad4c08b87", + "title": "Revisit FP8 SIMT only with an improved mapping or cost case" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/case.qwen-ascend-rejected-directions.guide.json b/src/inferrsi/knowledge/atoms/case.qwen-ascend-rejected-directions.guide.json new file mode 100644 index 000000000..b546c8edc --- /dev/null +++ b/src/inferrsi/knowledge/atoms/case.qwen-ascend-rejected-directions.guide.json @@ -0,0 +1,67 @@ +{ + "authority": "checkout", + "metadata": { + "id": "case.qwen-ascend-rejected-directions.guide", + "kind": "knowledge", + "title": "Qwen Ascend: reported rejected directions", + "backend": "ascend", + "origin": [ + "external" + ], + "state": "author_reported", + "applicability": [ + "Author-reported single Ascend 910B1 Qwen-Image-2.1-Turbo cohort", + "BF16, eager, TORCH_SDPA, CFG=1, 1280x704, native eight sigmas" + ], + "limitations": [ + "Imported author report; locally_verified=false", + "Raw request timings, RGBA outputs and frozen validator are absent from this import", + "InferRSI acceptance remains INCONCLUSIVE; the source 30 percent target was not met", + "No cross-device or HTTP-serving qualification" + ], + "attribution": "amy-why-3459 source report, retained by the existing Ascend guide; revisit checks are current suggestions", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.md", + "sha256": "be396983812262515899a3e2ba4f01b23ff92e1b836881882c7580372b8ae552" + }, + { + "type": "git", + "url": "https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/docs/qwen-image-2.1-turbo-ascend.md", + "commit": "d51c941dc57807c1e16ea698cd9291f414110c45", + "paths": [ + "docs/qwen-image-2.1-turbo-ascend.md" + ], + "upstream_head": "399cc01d1bc4542964d91aaa17fb43862a8cf3b3" + } + ], + "entrypoint": "qwen-ascend-rejected-directions.md", + "atom": { + "layer": "L3", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.md", + "byte_range": [ + 0, + 2564 + ], + "sha256": "be396983812262515899a3e2ba4f01b23ff92e1b836881882c7580372b8ae552" + } + } + }, + "content": { + "qwen-ascend-rejected-directions.md": { + "path": "casebooks/qwen-ascend-rejected-directions.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/case.qwen-ascend-rejected-directions.original.json b/src/inferrsi/knowledge/atoms/case.qwen-ascend-rejected-directions.original.json new file mode 100644 index 000000000..ff6fa184a --- /dev/null +++ b/src/inferrsi/knowledge/atoms/case.qwen-ascend-rejected-directions.original.json @@ -0,0 +1,226 @@ +{ + "authority": "checkout", + "metadata": { + "id": "case.qwen-ascend-rejected-directions.original", + "kind": "knowledge", + "title": "Qwen Ascend: reported rejected directions", + "backend": "ascend", + "origin": [ + "external" + ], + "state": "author_reported", + "applicability": [ + "Author-reported single Ascend 910B1 Qwen-Image-2.1-Turbo cohort", + "BF16, eager, TORCH_SDPA, CFG=1, 1280x704, native eight sigmas" + ], + "limitations": [ + "Imported author report; locally_verified=false", + "Raw request timings, RGBA outputs and frozen validator are absent from this import", + "InferRSI acceptance remains INCONCLUSIVE; the source 30 percent target was not met", + "No cross-device or HTTP-serving qualification" + ], + "attribution": "amy-why-3459 source report, retained by the existing Ascend guide; revisit checks are current suggestions", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.json", + "sha256": "b2c1808919ae525efb82148a24b465459799422fefc6d420891d7dbeb36cd31a" + }, + { + "type": "git", + "url": "https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/docs/qwen-image-2.1-turbo-ascend.md", + "commit": "d51c941dc57807c1e16ea698cd9291f414110c45", + "paths": [ + "docs/qwen-image-2.1-turbo-ascend.md" + ], + "upstream_head": "399cc01d1bc4542964d91aaa17fb43862a8cf3b3" + } + ], + "entrypoint": "case.json", + "atom": { + "layer": "L3", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.json", + "byte_range": [ + 0, + 5299 + ], + "sha256": "b2c1808919ae525efb82148a24b465459799422fefc6d420891d7dbeb36cd31a" + }, + "source_pointers": [ + "" + ] + } + }, + "content": { + "case.json": { + "path": "casebooks/qwen-ascend-rejected-directions.json" + } + }, + "parts": { + "identity": { + "layer": "L0", + "pointers": [ + "/id", + "/kind", + "/backend" + ], + "byte_range": [ + 4, + 89 + ], + "sha256": "5f7bf4057bb01acc35c7c872acfadae0b774837557a19eb62978bd6c35bd0858" + }, + "origin-state": { + "layer": "L1", + "pointers": [ + "/origin", + "/state" + ], + "byte_range": [ + 93, + 145 + ], + "sha256": "df56c2f9fd5086a28c5a15b842132f0b1dfc955e886ffd1305e5d60530c69199" + }, + "resources": { + "layer": "L2", + "pointers": [ + "/content", + "/required_resources" + ], + "byte_range": [ + 149, + 262 + ], + "sha256": "417f242b6e9fc2d203990a8101baa2aaea4d87d34cab2943885f0b17afc1e999" + }, + "sources": { + "layer": "L1", + "pointers": [ + "/sources" + ], + "byte_range": [ + 266, + 618 + ], + "sha256": "66c96228acf2ced4936a91cdbbdc5a4ed5a246efebc038656f4e50a3641ba398" + }, + "applicability": { + "layer": "L1", + "pointers": [ + "/applicability" + ], + "byte_range": [ + 622, + 771 + ], + "sha256": "79ce2ad23b61b043474f3ace058c9104cbd9cd4b2d73d669a8ada982e5ebd0f9" + }, + "tags": { + "layer": "L0", + "pointers": [ + "/tags" + ], + "byte_range": [ + 775, + 897 + ], + "sha256": "47b154d5445efcf3a7e5044de07d9b81290bd5e727acc10120e19664d837e832" + }, + "limits-attribution": { + "layer": "L1", + "pointers": [ + "/limitations", + "/attribution" + ], + "byte_range": [ + 901, + 1313 + ], + "sha256": "e4072e23c0b8126c50dc39c42ab491fd7ad9780a1340c8d774a6846e9d845662" + }, + "finding-0": { + "layer": "L1", + "pointers": [ + "/findings/0" + ], + "byte_range": [ + 1335, + 1963 + ], + "sha256": "23e07b6c577590ee246e90b000b767fde6aa14b348486dc7beb9ccb054c6fa96", + "title": "Check eager RoPE table and expanded SDPA mask retention against recomputation" + }, + "finding-1": { + "layer": "L1", + "pointers": [ + "/findings/1" + ], + "byte_range": [ + 1969, + 2623 + ], + "sha256": "d3cf6b89c6ee8c3dbfe5b9b23e33496b789a4d78cad25a7e7ccbe6f6cbab73cb", + "title": "Budget live NPU memory before retaining per-step masks and prompt tensors" + }, + "finding-2": { + "layer": "L1", + "pointers": [ + "/findings/2" + ], + "byte_range": [ + 2629, + 3269 + ], + "sha256": "3acd18f9972685069e6959936a32fdd47ef2de547cec239f9a4ba73f1c928fb9", + "title": "Qualify fusion attention with the actual mask, dtype and shape" + }, + "finding-3": { + "layer": "L1", + "pointers": [ + "/findings/3" + ], + "byte_range": [ + 3275, + 3867 + ], + "sha256": "504ae42f29f5131a4d3f28781713aa3a3225dc7ea39fcd458619c088fb565901", + "title": "Recheck queueing and graph mode under the target stack" + }, + "finding-4": { + "layer": "L1", + "pointers": [ + "/findings/4" + ], + "byte_range": [ + 3873, + 4602 + ], + "sha256": "8d218fa1850583227973494d0966db8c2e8d2bbe4c7e8317c71c0466c7e8b627", + "title": "Check initialization residency before combining RoPE, VAE and attention fast paths" + }, + "finding-5": { + "layer": "L1", + "pointers": [ + "/findings/5" + ], + "byte_range": [ + 4608, + 5292 + ], + "sha256": "33d1462dd3b2f2b71d0ae352b19eb513d9a83066ffe54f54c2bb253fb581d536", + "title": "Qualify host headroom for the later RoPE and VAE reservation failure" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/case.qwen-b300-rejected-directions.guide.json b/src/inferrsi/knowledge/atoms/case.qwen-b300-rejected-directions.guide.json new file mode 100644 index 000000000..0953d13ae --- /dev/null +++ b/src/inferrsi/knowledge/atoms/case.qwen-b300-rejected-directions.guide.json @@ -0,0 +1,66 @@ +{ + "authority": "checkout", + "metadata": { + "id": "case.qwen-b300-rejected-directions.guide", + "kind": "knowledge", + "title": "Qwen B300: rejected directions to check before retrying", + "backend": "cuda", + "origin": [ + "internal" + ], + "state": "historical_observation", + "applicability": [ + "Qwen-Image-2.1-Turbo, four B300, BF16, native eight steps", + "Only the source ledger's individual trials and controls" + ], + "limitations": [ + "The final campaign PASS does not qualify each rejected direction", + "Exploratory trial timings are not additive gains or causal comparisons", + "No experiment was rerun for this extraction" + ], + "attribution": "Historical issue #3 optimization ledger; revisit checks are current diagnostic suggestions", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.md", + "sha256": "cce2930f544a0f78f21797fba4d8ded298e4a81f76c34d7977b0e31d361bc738" + }, + { + "type": "git", + "url": "https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/docs/qwen-image-2.1-turbo-b300.md#optimization-ledger", + "commit": "d51c941dc57807c1e16ea698cd9291f414110c45", + "paths": [ + "docs/qwen-image-2.1-turbo-b300.md" + ], + "issue": "https://github.com/InferMatrixLab/InferRSI/issues/3" + } + ], + "entrypoint": "qwen-b300-rejected-directions.md", + "atom": { + "layer": "L3", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.md", + "byte_range": [ + 0, + 2656 + ], + "sha256": "cce2930f544a0f78f21797fba4d8ded298e4a81f76c34d7977b0e31d361bc738" + } + } + }, + "content": { + "qwen-b300-rejected-directions.md": { + "path": "casebooks/qwen-b300-rejected-directions.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/case.qwen-b300-rejected-directions.original.json b/src/inferrsi/knowledge/atoms/case.qwen-b300-rejected-directions.original.json new file mode 100644 index 000000000..66a7097b0 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/case.qwen-b300-rejected-directions.original.json @@ -0,0 +1,225 @@ +{ + "authority": "checkout", + "metadata": { + "id": "case.qwen-b300-rejected-directions.original", + "kind": "knowledge", + "title": "Qwen B300: rejected directions to check before retrying", + "backend": "cuda", + "origin": [ + "internal" + ], + "state": "historical_observation", + "applicability": [ + "Qwen-Image-2.1-Turbo, four B300, BF16, native eight steps", + "Only the source ledger's individual trials and controls" + ], + "limitations": [ + "The final campaign PASS does not qualify each rejected direction", + "Exploratory trial timings are not additive gains or causal comparisons", + "No experiment was rerun for this extraction" + ], + "attribution": "Historical issue #3 optimization ledger; revisit checks are current diagnostic suggestions", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.json", + "sha256": "90e3cdca085e2d122e648aae527bd6a61de6d4fddb66c393ca25ac4541cd9122" + }, + { + "type": "git", + "url": "https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/docs/qwen-image-2.1-turbo-b300.md#optimization-ledger", + "commit": "d51c941dc57807c1e16ea698cd9291f414110c45", + "paths": [ + "docs/qwen-image-2.1-turbo-b300.md" + ], + "issue": "https://github.com/InferMatrixLab/InferRSI/issues/3" + } + ], + "entrypoint": "case.json", + "atom": { + "layer": "L3", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.json", + "byte_range": [ + 0, + 5023 + ], + "sha256": "90e3cdca085e2d122e648aae527bd6a61de6d4fddb66c393ca25ac4541cd9122" + }, + "source_pointers": [ + "" + ] + } + }, + "content": { + "case.json": { + "path": "casebooks/qwen-b300-rejected-directions.json" + } + }, + "parts": { + "identity": { + "layer": "L0", + "pointers": [ + "/id", + "/kind", + "/backend" + ], + "byte_range": [ + 4, + 85 + ], + "sha256": "0d44367cf163401d199108f507f028a28b5ed80c16955183e54f30b26fb4d813" + }, + "origin-state": { + "layer": "L1", + "pointers": [ + "/origin", + "/state" + ], + "byte_range": [ + 89, + 148 + ], + "sha256": "a0cf30b585b5ae364c5825fc160025f28064be575cedbe123739f8d1331be20f" + }, + "resources": { + "layer": "L2", + "pointers": [ + "/content", + "/required_resources" + ], + "byte_range": [ + 152, + 261 + ], + "sha256": "6f7d2361a5e679d3a9e4fb4d4f9dc31c453ba615036ae10a43232d16476e7682" + }, + "sources": { + "layer": "L1", + "pointers": [ + "/sources" + ], + "byte_range": [ + 265, + 636 + ], + "sha256": "724ec712cf03e6d28dd7b22b53ac22ab6a9a7395fb849363a76bc8171355f549" + }, + "applicability": { + "layer": "L1", + "pointers": [ + "/applicability" + ], + "byte_range": [ + 640, + 777 + ], + "sha256": "98c4fc9e08308fe68b498818464287eed07fd25a13580fbfb61b1d0e7212f741" + }, + "tags": { + "layer": "L0", + "pointers": [ + "/tags" + ], + "byte_range": [ + 781, + 895 + ], + "sha256": "03142f7dbf363b437bd2bb718cee43ab81d5c74733f69819bb957c9459f96af8" + }, + "limits-attribution": { + "layer": "L1", + "pointers": [ + "/limitations", + "/attribution" + ], + "byte_range": [ + 899, + 1214 + ], + "sha256": "a2a0838509dcea0b54142d955103df0dd73ec170a3986cbca31a85347744556a" + }, + "finding-0": { + "layer": "L1", + "pointers": [ + "/findings/0" + ], + "byte_range": [ + 1236, + 1859 + ], + "sha256": "7d711ac3744ab38a229eee69a1f60da33d7773ef0544b34287cf62f9dc0dfb24", + "title": "Require full-image parity for fused Q/K RMSNorm and complex RoPE" + }, + "finding-1": { + "layer": "L1", + "pointers": [ + "/findings/1" + ], + "byte_range": [ + 1865, + 2458 + ], + "sha256": "76aa1bba6a163af8333859c17cbb9f4b47a5e00d7df4d2bad76dc4ba87af604f", + "title": "Pair a packed Q/K/V 5D layout with full request timing" + }, + "finding-2": { + "layer": "L1", + "pointers": [ + "/findings/2" + ], + "byte_range": [ + 2464, + 3117 + ], + "sha256": "c8ca005cf69d7d0ab0b24e326334fa5d0c24023185d14688cd7d777633e06d94", + "title": "Measure complete graph replay before promoting projection or norm/RoPE changes" + }, + "finding-3": { + "layer": "L1", + "pointers": [ + "/findings/3" + ], + "byte_range": [ + 3123, + 3770 + ], + "sha256": "cbbd0b5045b47d0f02bd4a9f84633475ce97082e26a03f4f33727d599c5a5304", + "title": "Verify critical-path time for broadcast scales and empty concatenation removal" + }, + "finding-4": { + "layer": "L1", + "pointers": [ + "/findings/4" + ], + "byte_range": [ + 3776, + 4389 + ], + "sha256": "a9c171fb370b31e9478754c820efa9c0b6a9403ffeaa4e3710d74a730f1bf18b", + "title": "Treat H17 and the noisy H13 run as host-confounded readings" + }, + "finding-5": { + "layer": "L1", + "pointers": [ + "/findings/5" + ], + "byte_range": [ + 4395, + 5016 + ], + "sha256": "40ea7d9e88d04d550b448d5a68b5f6b3b5bad6ddff198275a97275f2c4380471", + "title": "Carry a compiled launch API probe through full-pipeline integration before judging gain" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/casebooks/admission-drain-occupancy.json b/src/inferrsi/knowledge/atoms/casebooks/admission-drain-occupancy.json new file mode 100644 index 000000000..24c35b4c8 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/casebooks/admission-drain-occupancy.json @@ -0,0 +1,69 @@ +{ + "id": "case.admission-drain-occupancy", + "kind": "case", + "backend": "cuda", + "origin": ["internal"], + "state": "historical_observation", + "content": "admission-drain-occupancy.md", + "required_resources": ["admission-drain-occupancy.json"], + "sources": [ + { + "type": "internal", + "issue": "https://github.com/InferMatrixLab/InferRSI/issues/10", + "run": "drama3-mixed-20261016", + "artifact": "vllm-continuous-schedule.json", + "sha256": "29e5cafe329cb85eaba69db7536a28a83fb7e3ac29bc154fc8747f317f6a4b3f", + "request_metadata_sha256": "bd50166976a4753b33c8aeb5a774ebb5711c74ccbba0df1843885f353ecdc996", + "integrity_status": "reported_not_rehashed", + "evidence_url": "https://github.com/InferMatrixLab/InferRSI/blob/c13027983b853fee3700de6aabde52b72e61885a/evidence/drama3-b300-scale150/results/diagnostic-lessons.md#continuous-admission-profile-and-mixed-backbone-2026-10-16" + } + ], + "applicability": ["Continuous admission, mixed prefill/decode and final drain", "Recorded Drama3 B300 C64 diagnostic only"], + "limitations": ["Campaign INCONCLUSIVE", "No new measurement or trace reproduction", "Selected-phase occupancy is not service throughput", "Raw evidence remains under its existing owner"], + "attribution": "InferRSI issue #10 diagnostic evidence; extraction retains the original observation and its limits", + "findings": [ + { + "direction": "Split admitted traffic from the final drain when reading decode occupancy", + "outcome": "caveat", + "reason": "Across the 256-request B300 diagnostic, pure decode averaged 60.718 of 64 active requests during admission, 8.793 in drain and 28.146 over the full trace. The trace-wide mean cannot identify how full decode was while requests were still entering.", + "revisit_when": "Mark the client admission interval and the final drain in the trace before using occupancy to select a scheduling hypothesis.", + "keywords": [ + "active decode batch", + "continuous admission", + "final drain", + "whole-run occupancy", + "C64" + ], + "scope": "local", + "bounds": "Drama3 B300, 256 requests and a C64 continuous-admission diagnostic; approximate CPU/GPU clock alignment." + }, + { + "direction": "Count scheduler steps using owning CPU annotations", + "outcome": "caveat", + "reason": "The owning CPU annotations count 1 prefill, 37 mixed, 762 decode and 2 empty steps, totaling 802. PIECEWISE fragments describe graph execution, and scheduled prompt entries may describe chunks.", + "revisit_when": "Verify annotation ownership, align the clocks and pair the counts with actual generated work when profiling another trace.", + "keywords": [ + "owning CPU annotation", + "PIECEWISE", + "mixed batch", + "prefill chunks", + "scheduler steps" + ], + "scope": "regime_bound" + }, + { + "direction": "Carry the complete cohort into the service gate", + "outcome": "caveat", + "reason": "Near-full decode occupancy in a selected interval is a diagnostic. The service decision still depends on all requests, complete quality and repetition groups, and the end-to-end metric.", + "revisit_when": "Use phase statistics to pick a hypothesis. Evaluate the resulting change with the unchanged complete cohort and matched frozen service controls.", + "keywords": [ + "acceptance gate", + "service throughput", + "request cohort", + "quality groups", + "model-only microbenchmark" + ], + "scope": "general" + } + ] +} diff --git a/src/inferrsi/knowledge/atoms/casebooks/admission-drain-occupancy.md b/src/inferrsi/knowledge/atoms/casebooks/admission-drain-occupancy.md new file mode 100644 index 000000000..6a422888f --- /dev/null +++ b/src/inferrsi/knowledge/atoms/casebooks/admission-drain-occupancy.md @@ -0,0 +1,55 @@ +# Admission occupancy is not whole-run occupancy + +Campaign INCONCLUSIVE. This extraction adds no performance validation. Kind, +origin, state and source identities belong to the +[typed source and scope record](admission-drain-occupancy.json). + +## Observation + +In the recorded Drama3 B300 C64 continuous-admission diagnostic (256 requests), +the owning CPU annotations counted 802 scheduler steps: 1 prefill, 37 mixed, +762 decode and 2 empty. During the client-admission interval, pure decode averaged +60.718 active requests out of 64; final drain averaged 8.793. The whole-trace +pure-decode average was 28.146. Scheduled prompt entries may be chunks, not +unique requests. These are recorded diagnostic observations, not new measurements. + +## Action + +The original investigation separated the client-admission and drain intervals, +counted scheduler execution annotations rather than PIECEWISE graph fragments, +and retained the full request cohort for acceptance. No measurement is rerun by +reading this case. + +## Interpretation + +A whole-run mean batch can be dominated by drain. Using it as sustained-admission +occupancy can misidentify scheduling headroom. Conversely, a near-full batch in +a selected interval does not establish a service speedup. Client in-flight counts +also include queueing and codec work; CPU/GPU clock alignment was approximate. +This interpretation is narrower than a causal diagnosis of the service limit. + +## Applicability and counter-signals + +Use for finite autoregressive service cohorts with ongoing admission, mixed +prefill/decode and a final drain. Retain phase definitions and actual generated +work. Counter-signals include no ongoing admission, incomparable input/output +lengths, clocks that cannot be aligned and missing owning annotations. Kernel +sums, annotation unions and SM utilization are different quantities. + +Keep all requests and complete quality/repetition groups in the end-to-end +acceptance metric. Do not replace it with a selected-phase rate or a model-only +microbenchmark. Hardware, model and runtime scope comes from the original frozen +plan; another engine or device needs its own evidence. + +## Preserved evidence + +- [Acceptance issue #10](https://github.com/InferMatrixLab/InferRSI/issues/10). +- [Original diagnostic section at the inspected repository snapshot](https://github.com/InferMatrixLab/InferRSI/blob/c13027983b853fee3700de6aabde52b72e61885a/evidence/drama3-b300-scale150/results/diagnostic-lessons.md#continuous-admission-profile-and-mixed-backbone-2026-10-16). +- [Frozen plan](https://github.com/InferMatrixLab/InferRSI/blob/c13027983b853fee3700de6aabde52b72e61885a/evidence/drama3-b300-scale150/plan/plan.json). +- Original artifact identity, recorded raw trace and request metadata SHA256: + the [typed source and scope record](admission-drain-occupancy.json). + Raw bytes were not independently retrieved or rehashed for this extraction. + +The local frozen evidence remains untouched. Observation is carried from its +2026-10-16 report; extraction inspected that section on 2026-10-16. No missing +model pin, runtime revision or repeated acceptance outcome is reconstructed. diff --git a/src/inferrsi/knowledge/atoms/casebooks/drama3-rejected-directions.json b/src/inferrsi/knowledge/atoms/casebooks/drama3-rejected-directions.json new file mode 100644 index 000000000..188f6534d --- /dev/null +++ b/src/inferrsi/knowledge/atoms/casebooks/drama3-rejected-directions.json @@ -0,0 +1,121 @@ +{ + "id": "case.drama3-rejected-directions", + "kind": "case", + "backend": "cuda", + "origin": ["internal"], + "state": "historical_observation", + "content": "drama3-rejected-directions.md", + "required_resources": ["drama3-rejected-directions.json"], + "sources": [{ + "type": "git", + "url": "https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/evidence/drama3-b300-scale150/results/diagnostic-lessons.md", + "commit": "d51c941dc57807c1e16ea698cd9291f414110c45", + "paths": ["evidence/drama3-b300-scale150/results/diagnostic-lessons.md"], + "issue": "https://github.com/InferMatrixLab/InferRSI/issues/10" + }], + "applicability": ["Drama3 standalone native-computation runtime on one B300", "Only each cited microbenchmark, fixed-state diagnostic or complete service trial"], + "tags": ["negative-evidence", "service-regression", "quality-rejection", "harness-mismatch", "prefix-reuse", "memory-compression", "analysis-only"], + "limitations": ["Campaign remains INCONCLUSIVE and optimization is paused", "Individual completed gate failures do not complete the all-concurrency acceptance matrix", "Repository summary inspected; external raw traces and runtime artifacts not rerun or rehashed", "No root cause inferred from client accounting or cross-screen timing subtraction"], + "attribution": "Issue #10 diagnostic lessons, including runtime 47c3d2ec4e3406d8a71fccc3cb4967783c2650f5; revisit checks are current suggestions", + "findings": [ + { + "direction": "Qualify fused tower projections and longer decode groups at service scope", + "outcome": "no_gain", + "reason": "The recorded isolated checks could be correct or faster while full-service throughput did not improve. Multi-step decode also deferred new admissions.", + "revisit_when": "Check active batch sizes through admission and drain, then time the complete path with sampling and codec under the same service workload.", + "keywords": [ + "tower projection fusion", + "multi-step decode", + "throughput", + "delayed admission", + "codec" + ], + "scope": "regime_bound" + }, + { + "direction": "Check ATen cuBLAS workspace sharing when codec capture changes WER", + "outcome": "caveat", + "reason": "The fixed-request controls initially passed despite service WER failures in both arms. In a later bounded replay, private codec capture passed the tested service control while shared capture failed; the runtime guarded dedicated capture.", + "revisit_when": "Preserve the private/dedicated capture setup and matched controls. Establish WER and throughput for the proposed overlap and concurrency separately.", + "keywords": [ + "async service", + "codec graph capture", + "WER", + "shared ATen cuBLAS workspace", + "private capture" + ], + "scope": "regime_bound" + }, + { + "direction": "Require the complete C64 continuation gate for production prefix reuse", + "outcome": "rejected", + "reason": "The graph/state checks and both full quality groups passed, while the complete C64 continuation gate failed. The recorded production default stayed off.", + "revisit_when": "Keep all returned work and final drain in the replay. Inspect the actual schedule and GPU critical path before proposing another production setting.", + "keywords": [ + "prefix reuse", + "C64 continuation gate", + "default-off", + "final drain", + "full quality groups" + ], + "scope": "regime_bound" + }, + { + "direction": "Reset private padding rows before an A/A state comparison", + "outcome": "caveat", + "reason": "The initial prefix-reuse comparison paired distinct physical padding histories. The reported discrepancy was in a private slot, and an identical-input control superseded that setup.", + "revisit_when": "Recreate all physical input rows with identical histories and finish A/A before interpreting any later state mismatch.", + "keywords": [ + "prefix reuse control", + "private padding history", + "physical rows", + "identical-input", + "A/A" + ], + "scope": "local", + "bounds": "Initial Drama3 prefix-reuse harness comparison, later replaced by matched-input controls." + }, + { + "direction": "Require physical traffic and a timing win before enabling transparent VMM compression", + "outcome": "no_gain", + "reason": "VMM compression passed native correctness and lifetime checks, yet its fixed three-body screen missed the frozen timing gate. The runtime did not promote it.", + "revisit_when": "Confirm the workload is bandwidth-sensitive and measure physical bytes or effective compression together with the complete timed body.", + "keywords": [ + "transparent VMM", + "weight compression", + "physical traffic", + "native lifetime", + "three-body timing" + ], + "scope": "regime_bound" + }, + { + "direction": "Measure complete kernels before retaining a producer scale-tile cache", + "outcome": "no_gain", + "reason": "The producer scale-tile cache did not meet its complete-body reduction gate. The screen stopped before model or service promotion.", + "revisit_when": "Run a bounded screen for a materially different shape or resource constraint. Include a matched complete kernel as the control.", + "keywords": [ + "producer scale tile cache", + "complete-body", + "source gate", + "kernel timing", + "resource regime" + ], + "scope": "regime_bound" + }, + { + "direction": "Revisit FP8 SIMT only with an improved mapping or cost case", + "outcome": "rejected", + "reason": "The fixed eight-lane mapping was stopped by CPU/AOT analysis before runtime evaluation. No accelerator timing supports a hardware-wide conclusion.", + "revisit_when": "Supply a different lane mapping or a supported cost model before deciding whether a native run is warranted.", + "keywords": [ + "FP8 SIMT", + "eight-lane mapping", + "CPU/AOT", + "cost analysis", + "runtime benchmark" + ], + "scope": "regime_bound" + } + ] +} diff --git a/src/inferrsi/knowledge/atoms/casebooks/drama3-rejected-directions.md b/src/inferrsi/knowledge/atoms/casebooks/drama3-rejected-directions.md new file mode 100644 index 000000000..8ae6e0a8a --- /dev/null +++ b/src/inferrsi/knowledge/atoms/casebooks/drama3-rejected-directions.md @@ -0,0 +1,24 @@ +# Drama3 B300: rejected directions and invalid controls + +The [pinned diagnostic ledger](https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/evidence/drama3-b300-scale150/results/diagnostic-lessons.md) +and [acceptance issue #10](https://github.com/InferMatrixLab/InferRSI/issues/10) +own the observations and exact runtime/artifact pins. The campaign remains +INCONCLUSIVE and optimization is paused. A completed individual gate failure +does not supply missing concurrency/repetition evidence. No experiment is +reopened and no external raw trace is rehashed here. +Kind, origin, state and source identities belong to the +[typed source and scope record](drama3-rejected-directions.json). + +| Direction | Recorded observation and disposition | Suggested revisit condition and first check | +| --- | --- | --- | +| Fused tower projections / multi-step decode | Faster or correct in isolated checks but no full-service throughput gain; multi-step decode delayed admission. | Measure actual active batches, admission/drain and complete service latency, including sampling and codec. Kernel timing alone cannot select the runtime. | +| Async service / overlap | Early fixed-request controls passed while service WER failed in both arms. Later bounded dynamic replay identified shared ATen cuBLAS workspace interference: dedicated codec capture matched tested states, and fresh private-capture service WER passed while shared capture failed. The runtime added a dedicated-capture guard. | Preserve the required private/dedicated capture setup and unchanged controls. This specific reproducer does not establish one cause for every historical WER failure, or qualify arbitrary overlap/throughput; all-concurrency acceptance remains unmet. | +| Production prefix reuse | Extensive graph/state checks and both full quality groups passed, yet the complete C64 service continuation gate failed; default-off. | Retain final drain and all returned work. Investigate the actual schedule and GPU critical path before retrying; removed MoE rows and intake-only rates cannot replace the failed service score. | +| Initial prefix-reuse harness comparison | Compared different private padding histories; mismatch was confined to a private slot before later states were checked. Corrected identical-input controls reran it. | Reset complete physical input rows and run A/A before blaming production math. Do not reuse this superseded setup failure as evidence of model incompatibility. | +| Transparent VMM weight compression | Native correctness/lifetime checks passed, but the fixed three-body screen missed its frozen timing gate; no runtime promotion. | First measure the current bottleneck and physical traffic/compression where possible. Mapped flags and logical capacity do not prove a bandwidth benefit. | +| Producer scale-tile cache | Complete-body reductions missed the source gate; stopped without model/service promotion. | New shapes or a different resource regime may justify another bounded screen; do not subtract unrelated historical screens to infer a cause. | +| Fixed eight-lane FP8 SIMT proposal | Stopped at CPU/AOT cost analysis for that mapping, before a runtime benchmark. | Revisit only with a changed mapping or supported cost model; this is an analytical rejection, not an empirical GPU failure or universal ceiling. | + +The last column is proposed diagnosis. Preserve native computation, precision +and frozen acceptance rules; none of these cases authorizes a lossy shortcut, +looser validator or a resumed hardware campaign. diff --git a/src/inferrsi/knowledge/atoms/casebooks/qwen-ascend-rejected-directions.json b/src/inferrsi/knowledge/atoms/casebooks/qwen-ascend-rejected-directions.json new file mode 100644 index 000000000..191e319c8 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/casebooks/qwen-ascend-rejected-directions.json @@ -0,0 +1,106 @@ +{ + "id": "case.qwen-ascend-rejected-directions", + "kind": "case", + "backend": "ascend", + "origin": ["external"], + "state": "author_reported", + "content": "qwen-ascend-rejected-directions.md", + "required_resources": ["qwen-ascend-rejected-directions.json"], + "sources": [{ + "type": "git", + "url": "https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/docs/qwen-image-2.1-turbo-ascend.md", + "commit": "d51c941dc57807c1e16ea698cd9291f414110c45", + "paths": ["docs/qwen-image-2.1-turbo-ascend.md"], + "upstream_head": "399cc01d1bc4542964d91aaa17fb43862a8cf3b3" + }], + "applicability": ["Author-reported single Ascend 910B1 Qwen-Image-2.1-Turbo cohort", "BF16, eager, TORCH_SDPA, CFG=1, 1280x704, native eight sigmas"], + "tags": ["negative-evidence", "resource-failure", "OOM", "no-demonstrated-gain", "RoPE", "fusion-attention", "task-queue"], + "limitations": ["Imported author report; locally_verified=false", "Raw request timings, RGBA outputs and frozen validator are absent from this import", "InferRSI acceptance remains INCONCLUSIVE; the source 30 percent target was not met", "No cross-device or HTTP-serving qualification"], + "attribution": "amy-why-3459 source report, retained by the existing Ascend guide; revisit checks are current suggestions", + "findings": [ + { + "direction": "Check eager RoPE table and expanded SDPA mask retention against recomputation", + "outcome": "no_gain", + "reason": "The source trials produced identical pixels with retained cos/sin or expanded masks, but those alternatives were slower and were discarded.", + "revisit_when": "On the target shapes, measure the work avoided and the lifetime and cost of the retained tensors in a paired end-to-end run.", + "keywords": [ + "eager RoPE", + "cos sin precompute", + "SDPA mask", + "pixel identical", + "retention cost" + ], + "scope": "regime_bound" + }, + { + "direction": "Budget live NPU memory before retaining per-step masks and prompt tensors", + "outcome": "rejected", + "reason": "That cache configuration exhausted device memory on the reported run. Its feasibility depends on what stays resident alongside the cached tensors.", + "revisit_when": "Inspect tensor lifetimes, allocator headroom and peak residency. Retry a paired test when the request shape or residency policy materially changes.", + "keywords": [ + "cache per-step masks", + "prompt tensors", + "NPU OOM", + "device memory", + "allocator headroom" + ], + "scope": "local" + }, + { + "direction": "Qualify fusion attention with the actual mask, dtype and shape", + "outcome": "no_gain", + "reason": "The recorded fusion-attention runs, including precise=2 and precise=0 and steps without masks, showed either no gain or a gain below the source experiment’s keep criterion.", + "revisit_when": "Verify dispatch and numerical behavior for the present mask and tensor layout. Follow operator checks with a matched pipeline timing.", + "keywords": [ + "fusion attention", + "precise=2", + "precise=0", + "mask-free", + "Ascend" + ], + "scope": "regime_bound" + }, + { + "direction": "Recheck queueing and graph mode under the target stack", + "outcome": "no_gain", + "reason": "TASK_QUEUE_ENABLE=1/2 and enforce_eager=0 failed to improve the recorded eager configuration; some variants were slower.", + "revisit_when": "Confirm the execution route and scheduling overhead after a runtime change, with a fixed workload and equal warmups across arms.", + "keywords": [ + "TASK_QUEUE_ENABLE", + "enforce_eager", + "host dispatch", + "task queue", + "eager execution" + ], + "scope": "regime_bound" + }, + { + "direction": "Check initialization residency before combining RoPE, VAE and attention fast paths", + "outcome": "rejected", + "reason": "The run with RoPE, the VAE fastpath and fusion attention ran out of memory during initialization. This identifies a failure phase for that particular combination.", + "revisit_when": "Measure what each component reserves during initialization before assembling another multi-path configuration.", + "keywords": [ + "RoPE VAE fusion attention", + "triple stack", + "initialization OOM", + "startup memory" + ], + "scope": "local", + "bounds": "Triple-stack initialization, separate from later two-path requests on a busy host." + }, + { + "direction": "Qualify host headroom for the later RoPE and VAE reservation failure", + "outcome": "inconclusive", + "reason": "A later run of the kept two-path stack on a busy host encountered resource-reservation failures. Fusion attention was not part of that stack.", + "revisit_when": "Check available device resources and contention on the target host before judging repeatability or timing.", + "keywords": [ + "kept RoPE VAE fastpath", + "busy host", + "resource reservation", + "outside contention" + ], + "scope": "local", + "bounds": "Later resource-reservation failure for the separate RoPE plus VAE stack." + } + ] +} diff --git a/src/inferrsi/knowledge/atoms/casebooks/qwen-ascend-rejected-directions.md b/src/inferrsi/knowledge/atoms/casebooks/qwen-ascend-rejected-directions.md new file mode 100644 index 000000000..833456407 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/casebooks/qwen-ascend-rejected-directions.md @@ -0,0 +1,24 @@ +# Qwen Ascend: reported rejected directions + +These observations come from the [pinned Ascend guide](https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/docs/qwen-image-2.1-turbo-ascend.md), +which attributes them to amy-why-3459 at the upstream head recorded in the +typed record below. +They apply to its one-910B1, BF16, eager, 1280x704, native eight-sigma cohort. +They are author-reported, `locally_verified=false`, with InferRSI acceptance +INCONCLUSIVE. No raw timings, images or frozen validator were imported. +Kind, origin, state and source identities belong to the +[typed source and scope record](qwen-ascend-rejected-directions.json). + +| Direction | Recorded observation and disposition | Suggested revisit condition and first check | +| --- | --- | --- | +| Cache eager RoPE cos/sin or expanded SDPA masks | Pixel-identical, but discarded as slower in the source trials. | Profile current recomputation and retained-tensor costs; qualify a matched timing cohort before attributing a regression. | +| Cache per-step masks and prompt tensors | NPU OOM. | First inventory live tensor lifetimes and allocator headroom. A different residency policy or workload may change feasibility; the report does not establish a universal memory limit. | +| Fusion attention, including precise=2/0 and mask-free steps | No gain or a gain below the source keep criterion. | Check exact mask, dtype, shapes and device support; run operator quality then complete pipeline timing. Do not reuse the source keep threshold as a repository default. | +| TASK_QUEUE_ENABLE=1/2 or enforce_eager=0 | No gain or slower than the source eager configuration. | Inspect the actual execution path and scheduling overhead under the new stack; repeat with unchanged workload and warmups. | +| RoPE + VAE fastpath + fusion attention | Initialization OOM for this triple stack. | Inventory initialization residency before attempting a new combination. | +| Separate kept RoPE + VAE stack on a later busy host | Later requests failed resource reservation; this is a different stack/host cohort from the triple-stack initialization failure. | Qualify current headroom and outside contention before retrying; do not attribute this resource blockage to fusion attention. | + +Revisit checks are new diagnostic suggestions, not reproduced causes or a +performance claim. Pixel identity and a looser quality gate remain separate. +The independently reported 910B3 cohort and CUDA results are different scopes; +neither automatically overturns nor confirms a 910B1 observation. diff --git a/src/inferrsi/knowledge/atoms/casebooks/qwen-b300-rejected-directions.json b/src/inferrsi/knowledge/atoms/casebooks/qwen-b300-rejected-directions.json new file mode 100644 index 000000000..dc608b0bd --- /dev/null +++ b/src/inferrsi/knowledge/atoms/casebooks/qwen-b300-rejected-directions.json @@ -0,0 +1,109 @@ +{ + "id": "case.qwen-b300-rejected-directions", + "kind": "case", + "backend": "cuda", + "origin": ["internal"], + "state": "historical_observation", + "content": "qwen-b300-rejected-directions.md", + "required_resources": ["qwen-b300-rejected-directions.json"], + "sources": [{ + "type": "git", + "url": "https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/docs/qwen-image-2.1-turbo-b300.md#optimization-ledger", + "commit": "d51c941dc57807c1e16ea698cd9291f414110c45", + "paths": ["docs/qwen-image-2.1-turbo-b300.md"], + "issue": "https://github.com/InferMatrixLab/InferRSI/issues/3" + }], + "applicability": ["Qwen-Image-2.1-Turbo, four B300, BF16, native eight steps", "Only the source ledger's individual trials and controls"], + "tags": ["negative-evidence", "quality-rejection", "no-demonstrated-gain", "confounded-run", "RoPE", "CUDA-Graph"], + "limitations": ["The final campaign PASS does not qualify each rejected direction", "Exploratory trial timings are not additive gains or causal comparisons", "No experiment was rerun for this extraction"], + "attribution": "Historical issue #3 optimization ledger; revisit checks are current diagnostic suggestions", + "findings": [ + { + "direction": "Require full-image parity for fused Q/K RMSNorm and complex RoPE", + "outcome": "rejected", + "reason": "The H3 operator checks passed, yet its complete images failed and the change was reverted. The later kept H10/H13 implementations were different.", + "revisit_when": "Reproduce the reduction, complex FMA ordering and BF16 materialization, then check native full images after the operator comparisons.", + "keywords": [ + "H3", + "Q/K RMSNorm", + "complex RoPE", + "BF16 materialization", + "image quality" + ], + "scope": "regime_bound" + }, + { + "direction": "Pair a packed Q/K/V 5D layout with full request timing", + "outcome": "rejected", + "reason": "H1 passed quality but the exploratory exchange was discarded. The ledger’s standalone trial does not resolve the cost of layout staging or copies.", + "revisit_when": "For a changed topology or layout, keep the comparison matched and account for staging, transfers and request time separately.", + "keywords": [ + "H1", + "QKV", + "packed 5D exchange", + "layout staging", + "copies" + ], + "scope": "regime_bound" + }, + { + "direction": "Measure complete graph replay before promoting projection or norm/RoPE changes", + "outcome": "no_gain", + "reason": "H6 and H7 were removed after failing to produce a material end-to-end gain. H7 includes capture/replay and copy costs that matter to the final decision.", + "revisit_when": "Test a materially different capture boundary or buffer lifetime against a paired full request. Account for capture, replay and copies.", + "keywords": [ + "H6", + "H7", + "graph replay", + "norm RoPE", + "capture boundary", + "post-attention" + ], + "scope": "regime_bound" + }, + { + "direction": "Verify critical-path time for broadcast scales and empty concatenation removal", + "outcome": "no_gain", + "reason": "The H14/H16 decode scale/gate broadcast and empty concatenation changes were removed or reverted because the trials did not demonstrate a benefit.", + "revisit_when": "Profile the intended configuration to see whether these operations are on its critical path, and retain the matched service control.", + "keywords": [ + "H14", + "H16", + "decode broadcast", + "scale gate", + "empty concat", + "critical path" + ], + "scope": "regime_bound" + }, + { + "direction": "Treat H17 and the noisy H13 run as host-confounded readings", + "outcome": "inconclusive", + "reason": "Concurrent diagnostics and host load were observed during these attempts, so the timing difference does not isolate the code change.", + "revisit_when": "Repeat the same request on a qualified host without overlapping diagnostics.", + "keywords": [ + "H17", + "H13", + "host load", + "concurrent diagnostics", + "confounded timing" + ], + "scope": "local", + "bounds": "The cited exploratory H17 run and noisy H13 attempt." + }, + { + "direction": "Carry a compiled launch API probe through full-pipeline integration before judging gain", + "outcome": "inconclusive", + "reason": "H18 improved host enqueue in a diagnostic. It never went through the complete pipeline, so the resulting service overhead was not measured.", + "revisit_when": "Confirm actual dispatch and full-image correctness in the integrated candidate, then measure request time.", + "keywords": [ + "H18", + "compiled launch API", + "host enqueue", + "pipeline integration", + "dispatch" + ], + "scope": "regime_bound" + } + ] +} diff --git a/src/inferrsi/knowledge/atoms/casebooks/qwen-b300-rejected-directions.md b/src/inferrsi/knowledge/atoms/casebooks/qwen-b300-rejected-directions.md new file mode 100644 index 000000000..4e7f79b76 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/casebooks/qwen-b300-rejected-directions.md @@ -0,0 +1,23 @@ +# Qwen B300: rejected directions to check before retrying + +Scope: Qwen-Image-2.1-Turbo, four B300, BF16, native eight-step image generation. +The [pinned ledger](https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/docs/qwen-image-2.1-turbo-b300.md#optimization-ledger) +and [acceptance issue #3](https://github.com/InferMatrixLab/InferRSI/issues/3) +own the observations. The final campaign PASS belongs to its retained stack, +not these rejected alternatives. No source experiment is rerun here. +Kind, origin, state and source identities belong to the +[typed source and scope record](qwen-b300-rejected-directions.json). + +| Direction | Recorded observation and disposition | Suggested revisit condition and first check | +| --- | --- | --- | +| H3: initial Q/K RMSNorm + complex RoPE fusion | Operator tests passed; complete images failed; reverted. This is a quality rejection, not a kernel-speed result. | First match the actual reduction, complex FMA order and BF16 materialization; compare full native images after operator checks. H10/H13 show later, different implementations were retained, so the technique is not permanently excluded. | +| H1: packed Q/K/V 5D exchange | Quality passed but the exploratory trial was discarded. | Changed layouts/topology may justify another trial; measure staging/copies and the complete request against a matched control. Do not infer the cause from the one ledger timing. | +| H6/H7: graph projection/norm/RoPE or post-attention work | Removed for no material E2E gain; H7 records replay/copy costs. | A new capture boundary or buffer lifetime may change the tradeoff; include capture/replay, copies and full request cost. | +| H14/H16: broadcast decode scale/gate or skip empty concatenation | No demonstrated benefit; removed/reverted. | Confirm these operations are on the current critical path before repeating; retain a matched E2E control. | +| H17 and the noisy H13 attempt | Observed host load/concurrent diagnostics invalidate causal attribution. | Repeat on a qualified, uncontended host. Do not classify the numerical timing difference as a confirmed code regression. | +| H18: compiled launch API probe | Host enqueue improved in a diagnostic; no E2E integration was performed. | Treat it as an unintegrated lead; verify actual execution, correctness and complete service overhead before accepting it. | + +The last column is a proposed diagnostic procedure, not an observed root cause +or permission to reopen the campaign. A new revision, workload or hardware +requires its own frozen controls and quality gate. Old helper hashes remain +bound to the original source revision. diff --git a/tests/knowledge/test_atomic_casebooks.py b/tests/knowledge/test_atomic_casebooks.py index 8da3c365d..a1aa1ee88 100644 --- a/tests/knowledge/test_atomic_casebooks.py +++ b/tests/knowledge/test_atomic_casebooks.py @@ -10,6 +10,8 @@ from inferrsi.knowledge.decision_cards import DecisionSource, UnknownFinding FIXTURES = Path(__file__).resolve().parents[1] / "fixtures" / "atomic-reader" +ATOMS = FIXTURES.parents[2] / "src" / "inferrsi" / "knowledge" / "atoms" +RELEASE_COMMIT = "e2f3be102c66c358803ed2186ed67bf627ebcbdf" BASELINE = json.loads((FIXTURES / "casebook-domain-v0.3.4.json").read_bytes()) CASES = {ref: row for ref, row in BASELINE["refs"].items() if row["kind"] == "case"} FINDINGS = [(ref, index) for ref, row in CASES.items() for index in range(len(row["findings"]))] @@ -75,3 +77,60 @@ def test_casebooks_require_a_finding_from_the_selected_case(originals, ref): source.project() with pytest.raises(UnknownFinding): source.project(finding=f"case.json#/findings/{len(CASES[ref]['findings'])}") + + +@pytest.mark.parametrize("ref", sorted(CASES)) +def test_case_atoms_keep_both_complete_sources_and_the_original_credit(originals, ref): + row = CASES[ref] + record = decision_source(ref, originals).record + for suffix, resource in (("original", "case.json"), ("guide", record["content"])): + identity = record["id"] + "." + suffix + descriptor = json.loads((ATOMS / (identity + ".json")).read_bytes()) + meta = descriptor["metadata"] + assert (descriptor["authority"], meta["id"]) == ("checkout", identity) + for field in ("origin", "state", "applicability", "limitations", "attribution"): + assert meta[field] == record[field] + assert meta["sources"][1:] == record["sources"] + old_path = row["case_aliases"][resource] + raw = originals[old_path] + assert (ATOMS / descriptor["content"][resource]["path"]).read_bytes() == raw + assert meta["entrypoint"] == resource + pin = meta["sources"][0] + assert (pin["commit"], pin["sha256"]) == (RELEASE_COMMIT, digest(raw)) + assert pin["path"] == "src/inferrsi/knowledge/data/skill_library/" + old_path + assert meta["atom"]["layer"] == "L3" + assert meta["atom"]["source_span"] == { + "source_index": 0, "path": pin["path"], + "byte_range": [0, len(raw)], "sha256": digest(raw), + } + + +@pytest.mark.parametrize(("ref", "index"), FINDINGS) +def test_one_finding_and_its_shared_fields_reproduce_the_released_card(ref, index): + row = CASES[ref] + expected = row["findings"][index] + identity = ref.partition(":")[2] + descriptor = json.loads((ATOMS / (identity + ".original.json")).read_bytes()) + raw = (ATOMS / descriptor["content"]["case.json"]["path"]).read_bytes() + shared = {} + for name in ("origin-state", "sources", "applicability", "limits-attribution"): + part = descriptor["parts"][name] + start, end = part["byte_range"] + data = raw[start:end] + fields = json.loads(b"{" + data + b"}") + assert part["layer"] == "L1" and digest(data) == part["sha256"] + assert part["pointers"] == ["/" + field for field in fields] + shared.update(fields) + part = descriptor["parts"][f"finding-{index}"] + assert (part["layer"], part["pointers"]) == ("L1", [f"/findings/{index}"]) + start, end = part["byte_range"] + assert (start, end) == (expected["start_byte"], expected["end_byte"]) + data = raw[start:end] + assert digest(data) == part["sha256"] == expected["span_sha256"] + # Retain the public index without providing sibling finding contents. + shared["findings"] = [{} for _ in range(index)] + [json.loads(data)] + markdown = Path(row["entry_source"]).name + source = DecisionSource(ref, row["revision"], "case", "case.json", markdown, shared) + result = source.project(finding=expected["selector"]) + assert result["status"] == expected["status"] + assert digest(canonical(result["card"])) == expected["card_sha256"] From e8a14a55ff58ed8afae0c3c4c6f2a23b0a5ad0fe Mon Sep 17 00:00:00 2001 From: Dong1017 <55723162+Dong1017@users.noreply.github.com> Date: Fri, 27 Nov 2026 02:42:05 +0800 Subject: [PATCH 04/12] Open the four released Cases through pinned public finding selections Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com> --- docs/apps-module-migrations.json | 1 + docs/guides/knowledge/knowledge-layout.md | 10 + src/inferrsi/knowledge/atomic_build.py | 91 ++++++- .../case.admission-drain-occupancy.json | 164 ++++++++++++ .../case.drama3-rejected-directions.json | 245 ++++++++++++++++++ .../case.qwen-ascend-rejected-directions.json | 228 ++++++++++++++++ .../case.qwen-b300-rejected-directions.json | 226 ++++++++++++++++ .../knowledge/knowledge_operations.py | 24 +- tests/knowledge/test_atomic_casebooks.py | 159 ++++++++++++ 9 files changed, 1138 insertions(+), 10 deletions(-) create mode 100644 src/inferrsi/knowledge/compositions/case.admission-drain-occupancy.json create mode 100644 src/inferrsi/knowledge/compositions/case.drama3-rejected-directions.json create mode 100644 src/inferrsi/knowledge/compositions/case.qwen-ascend-rejected-directions.json create mode 100644 src/inferrsi/knowledge/compositions/case.qwen-b300-rejected-directions.json diff --git a/docs/apps-module-migrations.json b/docs/apps-module-migrations.json index af51ef056..49ab68810 100644 --- a/docs/apps-module-migrations.json +++ b/docs/apps-module-migrations.json @@ -551,6 +551,7 @@ "tests/apps/test_apps_knowledge.py", "tests/apps/test_optimization_session.py", "tests/harness/test_harness_generation_seal.py", + "tests/knowledge/test_atomic_casebooks.py", "tests/knowledge/test_atomic_records.py" ], "status": "retired", diff --git a/docs/guides/knowledge/knowledge-layout.md b/docs/guides/knowledge/knowledge-layout.md index d84691609..1745787e4 100644 --- a/docs/guides/knowledge/knowledge-layout.md +++ b/docs/guides/knowledge/knowledge-layout.md @@ -26,6 +26,16 @@ entrypoint and content. The builder derives its navigation record. A Case provides the original `case.json` so a finding can be reopened by stable ID or by its JSON pointer at the requested revision. +For a Case backed by released files, `case_resources` maps each public resource +name to a pinned L3 node. The builder derives the entrypoint and required +resource order from the original `case.json`, checks relative paths against the +same source snapshot, and retains both names when the release exposed its JSON +under two names. The public L1 route takes one finding and delivers its source +span with the Case's original applicability, state, limits, credit and sources. +L0 opens the Case's navigation, L2 its guide, and L3 both complete originals. +The [Case migration tests](../../../tests/knowledge/test_atomic_casebooks.py) +replay the released Reader's decision cards through the installed public refs. + A self-contained Record keeps its released JSON bytes under `atoms/records/`. Its L3 descriptor can declare named `parts`, each with a layer, source JSON pointers, a half-open byte range and a digest. The builder seals each part as diff --git a/src/inferrsi/knowledge/atomic_build.py b/src/inferrsi/knowledge/atomic_build.py index 59774fe5b..ee227c9dc 100644 --- a/src/inferrsi/knowledge/atomic_build.py +++ b/src/inferrsi/knowledge/atomic_build.py @@ -13,7 +13,7 @@ from .atomic_json import matches_span, member_spans from .atomic_reader import atom_material, permits_operations from .decision_cards import DecisionSource -from .knowledge_operations import IDENTITY, Bundle, _json, safe_path +from .knowledge_operations import IDENTITY, Bundle, _json, case_required_resources, safe_path _PUBLISH = {"read", "retain", "redistribute"} @@ -41,11 +41,100 @@ def _record_content(metadata: dict, node: str, material: dict) -> bytes: return _json(record) +def _verify_case_finding_routes(metadata, raw, record, material): + case = DecisionSource(metadata["id"], "", "case", "case.json", record["content"], record) + declaration = metadata["composition"] + members = member_spans(raw) + source = metadata["sources"][0] + nodes = declaration["nodes"] + + def finding_spans(roots): + pending, visited, spans = list(roots), set(), set() + while pending: + name = pending.pop() + if name in visited: + continue + visited.add(name) + if name not in nodes: + raise ValueError(f"Undeclared Case decision node: {name}") + node = nodes[name] + pin = AtomPin(node["ref"], node["revision"]) + if pin not in material: + raise ValueError(f"Missing pinned Case decision node: {pin.ref}") + _, origin = material[pin] + if origin["source"] != source: + raise ValueError("A source-backed Case decision must use its original Case") + lo, hi = origin["source_byte_range"] + findings = members["/findings"] + if lo < findings.end and findings.start < hi: + spans.add((lo, hi)) + pending.extend(node.get("requires", [])) + return spans + + for route in declaration["routes"].values(): + if route["layer"] != "L1": + continue + selector = route.get("finding") + if not isinstance(selector, str): + raise ValueError("A Case L1 decision route needs one original finding") + index, _ = case.finding(selector) + member = members[f"/findings/{index}"] + selected = {(member.start, member.end)} + if (finding_spans(route["required"]) != selected + or finding_spans(route.get("optional", [])) - selected): + raise ValueError("Case decision route must bind only its selected original finding") + + +def _case_content(metadata: dict, bindings: dict, material: dict) -> dict[str, bytes]: + """Resolve the original Case and its declared relative resources from pinned L3 nodes.""" + if not isinstance(bindings, dict) or "case.json" not in bindings: + raise ValueError("Case resources must bind the original case.json") + content, origins = {}, {} + nodes = metadata["composition"]["nodes"] + for name, key in bindings.items(): + safe_path(name) + if not isinstance(key, str) or key not in nodes: + raise ValueError(f"Undeclared Case resource node for {name}") + node = nodes[key] + pin = AtomPin(node["ref"], node["revision"]) + if pin not in material: + raise ValueError(f"Missing pinned Case resource for {name}") + body, origin = material[pin] + if not _complete_original(body, origin): + raise ValueError(f"Case resource requires a complete L3 original: {name}") + content[name], origins[name] = body, origin["source"] + + source = origins["case.json"] + record = json.loads(content["case.json"]) + if (not isinstance(record, dict) or record.get("kind") != "case" + or record.get("id") != metadata["id"] or source != metadata["sources"][0]): + raise ValueError("Case identity or pinned source differs from the original") + required = case_required_resources(record) + if (len(set(required)) != len(required) or set(bindings) != set(required) + or metadata.get("entrypoint", record["content"]) != record["content"] + or metadata.get("required_resources", required) != required): + raise ValueError("Case resource bindings must cover the original relative resources") + parent = PurePosixPath(source["path"]).parent + for name, origin in origins.items(): + if name == "case.json": + continue + if (origin.get("repo") != source.get("repo") or origin.get("commit") != source.get("commit") + or origin.get("path") != (parent / name).as_posix()): + raise ValueError(f"Case resource differs from its original relative source: {name}") + metadata.update(entrypoint=record["content"], required_resources=required) + _verify_case_finding_routes(metadata, content["case.json"], record, material) + return content + + def _authored(directory, path, field, descriptor, material) -> tuple[AtomPin, Bundle]: metadata = descriptor["metadata"] if field not in metadata or ("atom" in metadata and "composition" in metadata): raise ValueError(f"{path.name} must declare one {field}") content = {} + if "case_resources" in descriptor: + if field != "composition" or metadata["kind"] != "case" or "content" in descriptor: + raise ValueError("Only a Case composition may bind its content through case_resources") + content = _case_content(metadata, descriptor["case_resources"], material) for name, value in descriptor.get("content", {}).items(): safe_path(name) if isinstance(value, dict) and value.keys() == {"path"}: diff --git a/src/inferrsi/knowledge/compositions/case.admission-drain-occupancy.json b/src/inferrsi/knowledge/compositions/case.admission-drain-occupancy.json new file mode 100644 index 000000000..235dc4196 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/case.admission-drain-occupancy.json @@ -0,0 +1,164 @@ +{ + "authority": "checkout", + "metadata": { + "id": "case.admission-drain-occupancy", + "kind": "case", + "title": "Admission occupancy is not whole-run occupancy", + "backend": "cuda", + "origin": [ + "internal" + ], + "state": "historical_observation", + "applicability": [ + "Continuous admission, mixed prefill/decode and final drain", + "Recorded Drama3 B300 C64 diagnostic only" + ], + "limitations": [ + "Campaign INCONCLUSIVE", + "No new measurement or trace reproduction", + "Selected-phase occupancy is not service throughput", + "Raw evidence remains under its existing owner" + ], + "attribution": "InferRSI issue #10 diagnostic evidence; extraction retains the original observation and its limits", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.json", + "sha256": "4f8544292b2cc3391f4d4d75994cb81fdd295eff99e55b7e60374c6c122de09e" + }, + { + "type": "internal", + "issue": "https://github.com/InferMatrixLab/InferRSI/issues/10", + "run": "drama3-mixed-20261016", + "artifact": "vllm-continuous-schedule.json", + "sha256": "29e5cafe329cb85eaba69db7536a28a83fb7e3ac29bc154fc8747f317f6a4b3f", + "request_metadata_sha256": "bd50166976a4753b33c8aeb5a774ebb5711c74ccbba0df1843885f353ecdc996", + "integrity_status": "reported_not_rehashed", + "evidence_url": "https://github.com/InferMatrixLab/InferRSI/blob/c13027983b853fee3700de6aabde52b72e61885a/evidence/drama3-b300-scale150/results/diagnostic-lessons.md#continuous-admission-profile-and-mixed-backbone-2026-10-16" + } + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "original": { + "ref": "checkout:case.admission-drain-occupancy.original", + "revision": "sha256:2b53c58c066e63a9b86c71be3c0306b6fd3097a3ef0d2baad634d080363893d5" + }, + "guide": { + "ref": "checkout:case.admission-drain-occupancy.guide", + "revision": "sha256:e44d3cf8be60a00fd4878283026d001f3b4008639494d2d916ee61d36f89deaa" + }, + "identity": { + "ref": "checkout:case.admission-drain-occupancy.original.identity", + "revision": "sha256:e253ec161014fe35b0fb50fe9fb9a1b92953fccea9b783fdd9db477357716644" + }, + "origin-state": { + "ref": "checkout:case.admission-drain-occupancy.original.origin-state", + "revision": "sha256:f04879c8dd393d125845e9291615e4f4cd9bb923bb672ff468ad6a51390955dd" + }, + "resources": { + "ref": "checkout:case.admission-drain-occupancy.original.resources", + "revision": "sha256:d7be1a24bbfce858b4feb4c1299e690c9be6ca86e5858f3418e4a50e1cc94d0d" + }, + "sources": { + "ref": "checkout:case.admission-drain-occupancy.original.sources", + "revision": "sha256:c7486fe74355f6bdb3d004465daa0cc689ca3f20da44f8634bb4f4d68c3ed3d5" + }, + "applicability": { + "ref": "checkout:case.admission-drain-occupancy.original.applicability", + "revision": "sha256:c0c8d7f191e3bbae6514be1efba49081c8accd354d8f063f3035b0d4290ba4cd" + }, + "limits-attribution": { + "ref": "checkout:case.admission-drain-occupancy.original.limits-attribution", + "revision": "sha256:aa31eb72cbb61634b0ab9376e0507a7e170cb95fff60292d3302b5bc472d73ae" + }, + "finding-0": { + "ref": "checkout:case.admission-drain-occupancy.original.finding-0", + "revision": "sha256:d20980e4727d59d320f9997326d2310eefa9a190d4e245f3c5a60dc194bf4e1c", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-1": { + "ref": "checkout:case.admission-drain-occupancy.original.finding-1", + "revision": "sha256:74c6ea8880fc56a782e26eac88633371cb1ae7002be86f02f6c4c5542f633262", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-2": { + "ref": "checkout:case.admission-drain-occupancy.original.finding-2", + "revision": "sha256:b92090930f6801a39bc28d214b9f25dfb19c7aa2739ab0ffb527f6fa3a2b4a23", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "identity" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "resources", + "guide" + ] + }, + "originals": { + "layer": "L3", + "required": [ + "original", + "guide" + ] + }, + "finding-0": { + "layer": "L1", + "finding": "case.json#/findings/0", + "required": [ + "finding-0" + ] + }, + "finding-1": { + "layer": "L1", + "finding": "case.json#/findings/1", + "required": [ + "finding-1" + ] + }, + "finding-2": { + "layer": "L1", + "finding": "case.json#/findings/2", + "required": [ + "finding-2" + ] + } + } + } + }, + "case_resources": { + "admission-drain-occupancy.json": "original", + "admission-drain-occupancy.md": "guide", + "case.json": "original" + } +} diff --git a/src/inferrsi/knowledge/compositions/case.drama3-rejected-directions.json b/src/inferrsi/knowledge/compositions/case.drama3-rejected-directions.json new file mode 100644 index 000000000..56bef406c --- /dev/null +++ b/src/inferrsi/knowledge/compositions/case.drama3-rejected-directions.json @@ -0,0 +1,245 @@ +{ + "authority": "checkout", + "metadata": { + "id": "case.drama3-rejected-directions", + "kind": "case", + "title": "Drama3 B300: rejected directions and invalid controls", + "backend": "cuda", + "origin": [ + "internal" + ], + "state": "historical_observation", + "applicability": [ + "Drama3 standalone native-computation runtime on one B300", + "Only each cited microbenchmark, fixed-state diagnostic or complete service trial" + ], + "limitations": [ + "Campaign remains INCONCLUSIVE and optimization is paused", + "Individual completed gate failures do not complete the all-concurrency acceptance matrix", + "Repository summary inspected; external raw traces and runtime artifacts not rerun or rehashed", + "No root cause inferred from client accounting or cross-screen timing subtraction" + ], + "attribution": "Issue #10 diagnostic lessons, including runtime 47c3d2ec4e3406d8a71fccc3cb4967783c2650f5; revisit checks are current suggestions", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.json", + "sha256": "a2dc5db8aba62081c5743b12f854e74ae500c53bd57e2486260d0b5ae478638a" + }, + { + "type": "git", + "url": "https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/evidence/drama3-b300-scale150/results/diagnostic-lessons.md", + "commit": "d51c941dc57807c1e16ea698cd9291f414110c45", + "paths": [ + "evidence/drama3-b300-scale150/results/diagnostic-lessons.md" + ], + "issue": "https://github.com/InferMatrixLab/InferRSI/issues/10" + } + ], + "tags": [ + "negative-evidence", + "service-regression", + "quality-rejection", + "harness-mismatch", + "prefix-reuse", + "memory-compression", + "analysis-only" + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "original": { + "ref": "checkout:case.drama3-rejected-directions.original", + "revision": "sha256:a1ce299b00d6a0ceef621d1273d525d8ed6a2f3bb7d39b2abb2be4c8ca95bdc3" + }, + "guide": { + "ref": "checkout:case.drama3-rejected-directions.guide", + "revision": "sha256:891e949998aebd588e74336d108d520cc43bc8741b7142dc6d161a254779ee72" + }, + "identity": { + "ref": "checkout:case.drama3-rejected-directions.original.identity", + "revision": "sha256:22304724b64974a0f0b81f2680fb06b773d8048a59b16edfcf1894da73900f21" + }, + "origin-state": { + "ref": "checkout:case.drama3-rejected-directions.original.origin-state", + "revision": "sha256:e0d50ef1887398ce1059b32902fc079de610f6b7cda45d1c66c63aad12024c7e" + }, + "resources": { + "ref": "checkout:case.drama3-rejected-directions.original.resources", + "revision": "sha256:28d3e41ad3ceee23f92739213fc9ab04a5a2e377193f39b7e2a374be585f5199" + }, + "sources": { + "ref": "checkout:case.drama3-rejected-directions.original.sources", + "revision": "sha256:972bf5b324830e9fcf99e4f596ca1836cc65144e9712de7cde7a5bb4862fe526" + }, + "applicability": { + "ref": "checkout:case.drama3-rejected-directions.original.applicability", + "revision": "sha256:2bb286ec6ffe88836f566558d589e0f39d61770f287844ce542585c58f749c99" + }, + "tags": { + "ref": "checkout:case.drama3-rejected-directions.original.tags", + "revision": "sha256:ac03993f767a22fb53241142faaf800e396e43ad84e4d3133b7b3892637079d4" + }, + "limits-attribution": { + "ref": "checkout:case.drama3-rejected-directions.original.limits-attribution", + "revision": "sha256:019484272f43324a950638d947e7f10519cc5cfdabe8acbfe280e6e30552f6d2" + }, + "finding-0": { + "ref": "checkout:case.drama3-rejected-directions.original.finding-0", + "revision": "sha256:c01c2db6029283055624c3c5278285b24488a26761fb1e249a3e821a9f2f1cf3", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-1": { + "ref": "checkout:case.drama3-rejected-directions.original.finding-1", + "revision": "sha256:7bd38374a0c27e6725cb866f722d7185d7ef2b507c8d1a24137788fe539e4b10", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-2": { + "ref": "checkout:case.drama3-rejected-directions.original.finding-2", + "revision": "sha256:80a405f669f84c662bcfd5a7142369140c68112b7ad5ae20a7c29e772f7ca4c9", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-3": { + "ref": "checkout:case.drama3-rejected-directions.original.finding-3", + "revision": "sha256:e4ba2dfde8e80ce9a6a309a5397456402d15681216b1c1e05392751746cf2f11", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-4": { + "ref": "checkout:case.drama3-rejected-directions.original.finding-4", + "revision": "sha256:714592729833a92b4b29c15c105593e65de6589ef469a6b974698946183d0136", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-5": { + "ref": "checkout:case.drama3-rejected-directions.original.finding-5", + "revision": "sha256:1c4be5c17ec0878bbe470bbd9704b7a87c7b74fc43eed93c92d5ac929f2025c4", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-6": { + "ref": "checkout:case.drama3-rejected-directions.original.finding-6", + "revision": "sha256:c3192628ef0168a95aab0da0dd9b256f5fe22288dbcdc78f0e619caf16309ed7", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "identity", + "tags" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "resources", + "guide" + ] + }, + "originals": { + "layer": "L3", + "required": [ + "original", + "guide" + ] + }, + "finding-0": { + "layer": "L1", + "finding": "case.json#/findings/0", + "required": [ + "finding-0" + ] + }, + "finding-1": { + "layer": "L1", + "finding": "case.json#/findings/1", + "required": [ + "finding-1" + ] + }, + "finding-2": { + "layer": "L1", + "finding": "case.json#/findings/2", + "required": [ + "finding-2" + ] + }, + "finding-3": { + "layer": "L1", + "finding": "case.json#/findings/3", + "required": [ + "finding-3" + ] + }, + "finding-4": { + "layer": "L1", + "finding": "case.json#/findings/4", + "required": [ + "finding-4" + ] + }, + "finding-5": { + "layer": "L1", + "finding": "case.json#/findings/5", + "required": [ + "finding-5" + ] + }, + "finding-6": { + "layer": "L1", + "finding": "case.json#/findings/6", + "required": [ + "finding-6" + ] + } + } + } + }, + "case_resources": { + "case.json": "original", + "drama3-rejected-directions.json": "original", + "drama3-rejected-directions.md": "guide" + } +} diff --git a/src/inferrsi/knowledge/compositions/case.qwen-ascend-rejected-directions.json b/src/inferrsi/knowledge/compositions/case.qwen-ascend-rejected-directions.json new file mode 100644 index 000000000..77a671a20 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/case.qwen-ascend-rejected-directions.json @@ -0,0 +1,228 @@ +{ + "authority": "checkout", + "metadata": { + "id": "case.qwen-ascend-rejected-directions", + "kind": "case", + "title": "Qwen Ascend: reported rejected directions", + "backend": "ascend", + "origin": [ + "external" + ], + "state": "author_reported", + "applicability": [ + "Author-reported single Ascend 910B1 Qwen-Image-2.1-Turbo cohort", + "BF16, eager, TORCH_SDPA, CFG=1, 1280x704, native eight sigmas" + ], + "limitations": [ + "Imported author report; locally_verified=false", + "Raw request timings, RGBA outputs and frozen validator are absent from this import", + "InferRSI acceptance remains INCONCLUSIVE; the source 30 percent target was not met", + "No cross-device or HTTP-serving qualification" + ], + "attribution": "amy-why-3459 source report, retained by the existing Ascend guide; revisit checks are current suggestions", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.json", + "sha256": "b2c1808919ae525efb82148a24b465459799422fefc6d420891d7dbeb36cd31a" + }, + { + "type": "git", + "url": "https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/docs/qwen-image-2.1-turbo-ascend.md", + "commit": "d51c941dc57807c1e16ea698cd9291f414110c45", + "paths": [ + "docs/qwen-image-2.1-turbo-ascend.md" + ], + "upstream_head": "399cc01d1bc4542964d91aaa17fb43862a8cf3b3" + } + ], + "tags": [ + "negative-evidence", + "resource-failure", + "OOM", + "no-demonstrated-gain", + "RoPE", + "fusion-attention", + "task-queue" + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "original": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original", + "revision": "sha256:5d73751d8affa1e9e90c064a17dc1d278acde79e607bf627f9e1d12a6306750c" + }, + "guide": { + "ref": "checkout:case.qwen-ascend-rejected-directions.guide", + "revision": "sha256:c6c9d593fa1a2494a8a9c473dda926af563f868afd22e3e99c254f31a170f282" + }, + "identity": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original.identity", + "revision": "sha256:44deeed2b1d2f1254d7d5006b80e4396a2fd511fc971995a9998d371c52fcb3f" + }, + "origin-state": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original.origin-state", + "revision": "sha256:657e09c1defea7587e3c9e86fea1125fb415894fed0e54ccb0eed90b3f60472e" + }, + "resources": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original.resources", + "revision": "sha256:d5f00f7ffcae09a113b4b18eecd195f46b9032ee116586822ed5d29237390a35" + }, + "sources": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original.sources", + "revision": "sha256:ee3645e7b9d15f9f05428c5d4ea5b3baa040bd74bfa843979f9be1485d82c165" + }, + "applicability": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original.applicability", + "revision": "sha256:b74edc8d941ecf313856a539e17d7c3d7028ff04adcc71ac93361dcfdb3057dd" + }, + "tags": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original.tags", + "revision": "sha256:0bb2d1ff0a9340811b5e88cb0d205b829ef291ae16c84a2951f3a6a55d276e78" + }, + "limits-attribution": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original.limits-attribution", + "revision": "sha256:60fa8cb3222c2c907233151e781724258b91b1d83762796768e2e4727b8ab3d0" + }, + "finding-0": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original.finding-0", + "revision": "sha256:1c7180b432c1f771d87aca1b8f1bb164764fae0d69655c295aed28bd82f6c2da", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-1": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original.finding-1", + "revision": "sha256:81450ca0d26dd0f924d879c3d5d42ac1d64c0c5894c99a0ba7cf6d2ecc1e95e9", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-2": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original.finding-2", + "revision": "sha256:4615fbd7a6244c8cfe1c93a5d5c3568d2ffc256778365f95faf6c77eff3434ec", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-3": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original.finding-3", + "revision": "sha256:6914bc815ff635f8f90f678b742ce6a442fe014603a9a5ca8ff3c32f40a5715e", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-4": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original.finding-4", + "revision": "sha256:cbeafad7589667ed587f254efc87904afe10dbd856a2eaac2404bb4b91c192bf", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-5": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original.finding-5", + "revision": "sha256:f73b4dba213797ce26763ff52bce986f531532a91dc91cf34f77d1cd916c260e", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "identity", + "tags" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "resources", + "guide" + ] + }, + "originals": { + "layer": "L3", + "required": [ + "original", + "guide" + ] + }, + "finding-0": { + "layer": "L1", + "finding": "case.json#/findings/0", + "required": [ + "finding-0" + ] + }, + "finding-1": { + "layer": "L1", + "finding": "case.json#/findings/1", + "required": [ + "finding-1" + ] + }, + "finding-2": { + "layer": "L1", + "finding": "case.json#/findings/2", + "required": [ + "finding-2" + ] + }, + "finding-3": { + "layer": "L1", + "finding": "case.json#/findings/3", + "required": [ + "finding-3" + ] + }, + "finding-4": { + "layer": "L1", + "finding": "case.json#/findings/4", + "required": [ + "finding-4" + ] + }, + "finding-5": { + "layer": "L1", + "finding": "case.json#/findings/5", + "required": [ + "finding-5" + ] + } + } + } + }, + "case_resources": { + "case.json": "original", + "qwen-ascend-rejected-directions.json": "original", + "qwen-ascend-rejected-directions.md": "guide" + } +} diff --git a/src/inferrsi/knowledge/compositions/case.qwen-b300-rejected-directions.json b/src/inferrsi/knowledge/compositions/case.qwen-b300-rejected-directions.json new file mode 100644 index 000000000..8b50236fc --- /dev/null +++ b/src/inferrsi/knowledge/compositions/case.qwen-b300-rejected-directions.json @@ -0,0 +1,226 @@ +{ + "authority": "checkout", + "metadata": { + "id": "case.qwen-b300-rejected-directions", + "kind": "case", + "title": "Qwen B300: rejected directions to check before retrying", + "backend": "cuda", + "origin": [ + "internal" + ], + "state": "historical_observation", + "applicability": [ + "Qwen-Image-2.1-Turbo, four B300, BF16, native eight steps", + "Only the source ledger's individual trials and controls" + ], + "limitations": [ + "The final campaign PASS does not qualify each rejected direction", + "Exploratory trial timings are not additive gains or causal comparisons", + "No experiment was rerun for this extraction" + ], + "attribution": "Historical issue #3 optimization ledger; revisit checks are current diagnostic suggestions", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.json", + "sha256": "90e3cdca085e2d122e648aae527bd6a61de6d4fddb66c393ca25ac4541cd9122" + }, + { + "type": "git", + "url": "https://github.com/InferMatrixLab/InferRSI/blob/d51c941dc57807c1e16ea698cd9291f414110c45/docs/qwen-image-2.1-turbo-b300.md#optimization-ledger", + "commit": "d51c941dc57807c1e16ea698cd9291f414110c45", + "paths": [ + "docs/qwen-image-2.1-turbo-b300.md" + ], + "issue": "https://github.com/InferMatrixLab/InferRSI/issues/3" + } + ], + "tags": [ + "negative-evidence", + "quality-rejection", + "no-demonstrated-gain", + "confounded-run", + "RoPE", + "CUDA-Graph" + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "original": { + "ref": "checkout:case.qwen-b300-rejected-directions.original", + "revision": "sha256:f9118c7f4ba8d539ff87cc4f9cf1890aa250ad20625ed5a79fecd81d155d388a" + }, + "guide": { + "ref": "checkout:case.qwen-b300-rejected-directions.guide", + "revision": "sha256:744854a77597c27600f368da02e7098d1a55b402a1abcfe04afc2c9be2a6a528" + }, + "identity": { + "ref": "checkout:case.qwen-b300-rejected-directions.original.identity", + "revision": "sha256:418134c015ad6c033182cfcd7f89d6d8a33b6e2bc12b9002e8713a56bca68e5d" + }, + "origin-state": { + "ref": "checkout:case.qwen-b300-rejected-directions.original.origin-state", + "revision": "sha256:8ef14243a71d71e0126af4b664629f7058e76429ec13d4304a964b29c076952c" + }, + "resources": { + "ref": "checkout:case.qwen-b300-rejected-directions.original.resources", + "revision": "sha256:f2e85554a46450ac34886f5517bfcff304dce1897ab3e9be45d5a6421d67c470" + }, + "sources": { + "ref": "checkout:case.qwen-b300-rejected-directions.original.sources", + "revision": "sha256:b8de0d114bda2ab440084a5e3936c914be52bf8a798c6119c2e7cf6ae7785462" + }, + "applicability": { + "ref": "checkout:case.qwen-b300-rejected-directions.original.applicability", + "revision": "sha256:e8073f28453b3d5ba66eff293f9b3ae99e8c1909c3a1b560868e7317ed9c1223" + }, + "tags": { + "ref": "checkout:case.qwen-b300-rejected-directions.original.tags", + "revision": "sha256:f906af9950ce099b5bb0a70e98f8bbf6195e81a1c0808fbbedc6af5ac803e010" + }, + "limits-attribution": { + "ref": "checkout:case.qwen-b300-rejected-directions.original.limits-attribution", + "revision": "sha256:fb55908872b30493be207980d161e54e19e5a6007d4deb753f6e3205c6dd6b1b" + }, + "finding-0": { + "ref": "checkout:case.qwen-b300-rejected-directions.original.finding-0", + "revision": "sha256:cf4af594e024a2846868dd619fd6873816ef1dcddac89b8bcf1fbf2b65653b14", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-1": { + "ref": "checkout:case.qwen-b300-rejected-directions.original.finding-1", + "revision": "sha256:e2133612781a09e11c891543c592e77ca84e44cc851ec986e22642e9ddc78cd5", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-2": { + "ref": "checkout:case.qwen-b300-rejected-directions.original.finding-2", + "revision": "sha256:fd2c82cfc21689322f3198aef732395610a6d64ce0ff815b2d43443a02d92e27", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-3": { + "ref": "checkout:case.qwen-b300-rejected-directions.original.finding-3", + "revision": "sha256:2d02c0bdb596e9f42c7fbabffd1c63d619969ed5ada0a106b9fbfe1b0b784f29", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-4": { + "ref": "checkout:case.qwen-b300-rejected-directions.original.finding-4", + "revision": "sha256:325b91d0bf9a771dfeb9e7e01b6557e0ca7450bb67045d047b65cf435307b3a6", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + }, + "finding-5": { + "ref": "checkout:case.qwen-b300-rejected-directions.original.finding-5", + "revision": "sha256:efd06e43357fd1f047b8be1e2a204e5499c1df824837dd22db005f448cb0bcf8", + "requires": [ + "origin-state", + "sources", + "applicability", + "limits-attribution" + ] + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "identity", + "tags" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "resources", + "guide" + ] + }, + "originals": { + "layer": "L3", + "required": [ + "original", + "guide" + ] + }, + "finding-0": { + "layer": "L1", + "finding": "case.json#/findings/0", + "required": [ + "finding-0" + ] + }, + "finding-1": { + "layer": "L1", + "finding": "case.json#/findings/1", + "required": [ + "finding-1" + ] + }, + "finding-2": { + "layer": "L1", + "finding": "case.json#/findings/2", + "required": [ + "finding-2" + ] + }, + "finding-3": { + "layer": "L1", + "finding": "case.json#/findings/3", + "required": [ + "finding-3" + ] + }, + "finding-4": { + "layer": "L1", + "finding": "case.json#/findings/4", + "required": [ + "finding-4" + ] + }, + "finding-5": { + "layer": "L1", + "finding": "case.json#/findings/5", + "required": [ + "finding-5" + ] + } + } + } + }, + "case_resources": { + "case.json": "original", + "qwen-b300-rejected-directions.json": "original", + "qwen-b300-rejected-directions.md": "guide" + } +} diff --git a/src/inferrsi/knowledge/knowledge_operations.py b/src/inferrsi/knowledge/knowledge_operations.py index 3b5af8a67..9a94c8eb0 100644 --- a/src/inferrsi/knowledge/knowledge_operations.py +++ b/src/inferrsi/knowledge/knowledge_operations.py @@ -56,6 +56,20 @@ def safe_path(value: str) -> str: return value +def case_required_resources(record: dict) -> list[str]: + """Return the complete Case resource list in its public read order.""" + for field in ("references", "dependencies"): + if field in record: + raise ValueError(f"Case {field} are not supported; declare required_resources") + declared = record.get("required_resources", []) + if not isinstance(declared, list) or any(not isinstance(p, str) for p in declared): + raise ValueError("Case required_resources must be a string list") + if len(set(declared)) != len(declared): + raise ValueError("Case required_resources must not repeat a path") + relative = record["content"] + return [relative, "case.json", *(p for p in declared if p != relative)] + + def case_resource_path(root: Path, record_path: Path, resource: object) -> Path: """Resolve a resource a case record names, refusing anything outside `root`. @@ -572,16 +586,8 @@ def _checkout(self, identity: str) -> Bundle: record = json.loads(original.decode("utf-8")) if record.get("id") != identity or record.get("kind") != "case": raise ValueError(f"Case identity changed during read: {identity}") - for field in ("references", "dependencies"): - if field in record: - raise ValueError(f"Case {field} are not supported; declare required_resources") - declared = record.get("required_resources", []) - if not isinstance(declared, list) or any(not isinstance(p, str) for p in declared): - raise ValueError("Case required_resources must be a string list") - if len(set(declared)) != len(declared): - raise ValueError("Case required_resources must not repeat a path") + required = case_required_resources(record) relative = record["content"] - required = [relative, "case.json", *(p for p in declared if p != relative)] content = {"case.json": original} for resource in [relative, *required[2:]]: resource_path = case_resource_path(self.skill_root, path, resource) diff --git a/tests/knowledge/test_atomic_casebooks.py b/tests/knowledge/test_atomic_casebooks.py index a1aa1ee88..a6a115462 100644 --- a/tests/knowledge/test_atomic_casebooks.py +++ b/tests/knowledge/test_atomic_casebooks.py @@ -2,12 +2,18 @@ import hashlib import json +import shutil from pathlib import Path from zipfile import ZipFile import pytest +from inferrsi.apps.workflows.knowledge import read_selection +from inferrsi.knowledge.atomic_build import build_generation +from inferrsi.knowledge.atomic_generation import InstalledGeneration from inferrsi.knowledge.decision_cards import DecisionSource, UnknownFinding +from tests.knowledge.test_atomic_generation import RELEASE_ROOT, make_author_root, write_json +from tests.knowledge.test_atomic_reader import allow FIXTURES = Path(__file__).resolve().parents[1] / "fixtures" / "atomic-reader" ATOMS = FIXTURES.parents[2] / "src" / "inferrsi" / "knowledge" / "atoms" @@ -134,3 +140,156 @@ def test_one_finding_and_its_shared_fields_reproduce_the_released_card(ref, inde result = source.project(finding=expected["selector"]) assert result["status"] == expected["status"] assert digest(canonical(result["card"])) == expected["card_sha256"] + + +def case_sources(root, originals): + author = make_author_root(root) + release = root / "pinned" + shutil.copytree(RELEASE_ROOT, release) + for name, raw in originals.items(): + path = release / "src/inferrsi/knowledge/data/skill_library" / name + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(raw) + for ref in CASES: + name = ref.partition(":")[2] + for suffix in ("original", "guide"): + filename = f"{name}.{suffix}.json" + shutil.copyfile(ATOMS / filename, author / "atoms" / filename) + shutil.copyfile(ATOMS.parent / "compositions" / (name + ".json"), + author / "compositions" / (name + ".json")) + shutil.copytree(ATOMS / "casebooks", author / "atoms/casebooks") + return author, release + + +@pytest.fixture(scope="module") +def installed_cases(tmp_path_factory, originals): + root = tmp_path_factory.mktemp("cases") + author, release = case_sources(root, originals) + target = root / "installed" + generation = build_generation(author, target, permits=allow, + source_roots={RELEASE_COMMIT: release}) + return InstalledGeneration(target, expected=generation) + + +def select(installed, ref, layer, budget, **request): + revision = request.pop("revision", installed.catalog[ref]["revision"]) + return read_selection(installed, ref, revision=revision, layer=layer, max_bytes=budget, + context={}, permits=request.pop("permits", allow), **request) + + +def assert_empty(delivery, reason): + assert delivery.receipt["status"] == reason + assert delivery.bodies == () and delivery.receipt["delivered"] == [] + assert delivery.receipt["body_bytes"] == 0 + + +@pytest.mark.parametrize("ref", sorted(CASES)) +def test_public_case_resources_and_layers(installed_cases, originals, ref): + row = CASES[ref] + released = {name: originals[path] for name, path in row["case_aliases"].items()} + record = json.loads(released["case.json"]) + guide = record["content"] + revision = installed_cases.catalog[ref]["revision"] + _, bundle = installed_cases.read_resolved(ref, revision=revision) + assert bundle.content == released and not bundle.dependencies + required = [guide, "case.json", *record["required_resources"]] + assert bundle.metadata["required_resources"] == required + assert bundle.metadata["entrypoint"] == guide + for key in ("origin", "state", "applicability", "limitations", "attribution"): + assert bundle.metadata[key] == record[key] + assert bundle.metadata["sources"][1:] == record["sources"] + for layer in ("L0", "L2", "L3"): + result = select(installed_cases, ref, layer, sum(map(len, released.values()))) + assert result.receipt["status"] == "delivered" + for item, body in zip(result.receipt["delivered"], result.bodies, strict=True): + start, end = item["source_byte_range"] + name = item["source_path"].split("/skill_library/", 1)[1] + assert body == originals[name][start:end] + assert item["source_range_verification"] == "verified_at_build" + if layer == "L0": + assert json.loads(b"{" + result.bodies[0] + b"}")["id"] == record["id"] + elif layer == "L2": + assert result.bodies[-1] == released[guide] + else: + assert result.bodies == (released["case.json"], released[guide]) + for selector in (None, "id:missing", f"case.json#/findings/{len(row['findings'])}"): + result = select(installed_cases, ref, "L1", 100_000, finding=selector) + assert_empty(result, "not_applicable") + assert_empty(select(installed_cases, ref, "L1", 100_000, revision=row["revision"], + finding=row["findings"][0]["selector"]), "unavailable_revision") + + +@pytest.mark.parametrize(("ref", "index"), FINDINGS) +def test_public_selection_delivers_one_released_card(installed_cases, originals, ref, index): + row = CASES[ref] + expected = row["findings"][index] + raw = originals[row["case_aliases"]["case.json"]] + selector = expected["selector"] + result = select(installed_cases, ref, "L1", len(raw), finding=selector) + assert result.receipt["status"] == "delivered" + assert result.receipt["selection"]["canonical_finding"] == selector + assert len(result.bodies) == 5 + fields = {} + for item, body in zip(result.receipt["delivered"], result.bodies, strict=True): + lo, hi = item["source_byte_range"] + assert item["source_range_verification"] == "verified_at_build" + assert item["source"]["commit"] == RELEASE_COMMIT and item["layer"] == "L1" + assert raw[lo:hi] == body and digest(body) == item["source_sha256"] + if [lo, hi] == [expected["start_byte"], expected["end_byte"]]: + assert digest(body) == expected["span_sha256"] and "findings" not in fields + fields["findings"] = [{} for _ in range(index)] + [json.loads(body)] + else: + shared = json.loads(b"{" + body + b"}") + assert not fields.keys() & shared.keys() and "findings" not in shared + fields.update(shared) + card = DecisionSource(ref, row["revision"], "case", "case.json", + Path(row["entry_source"]).name, fields).project(finding=selector)["card"] + assert card["status"] == expected["status"] + assert (len(canonical(card)), digest(canonical(card))) == (expected["card_bytes"], + expected["card_sha256"]) + size = result.receipt["body_bytes"] + assert size == sum(map(len, result.bodies)) + assert select(installed_cases, ref, "L1", size, finding=selector) == result + short = select(installed_cases, ref, "L1", size - 1, finding=selector) + assert_empty(short, "over_budget") + assert short.receipt["required_bytes"] == size + for denied in (ref, ref + ".original.limits-attribution", ref + f".original.finding-{index}"): + refusal = select(installed_cases, ref, "L1", size, finding=selector, + permits=lambda pin, op: pin.ref != denied) + assert_empty(refusal, "permission_denied") + + +@pytest.mark.parametrize(("change", "error"), [ + ("missing alias", "cover the original"), ("another guide", "original relative source"), + ("excerpt", "complete L3 original"), ("stale", "Missing pinned"), ("identity", "identity"), + ("swapped selector", "selected original finding"), + ("optional sibling", "selected original finding"), +]) +def test_build_refuses_broken_case_bindings(tmp_path, originals, change, error): + author, release = case_sources(tmp_path, originals) + first, second = sorted(CASES)[:2] + directory = author / "compositions" + path = directory / (first.partition(":")[2] + ".json") + spec = json.loads(path.read_bytes()) + declaration = spec["metadata"]["composition"] + nodes, routes = declaration["nodes"], declaration["routes"] + other = json.loads((directory / (second.partition(":")[2] + ".json")).read_bytes()) + if change == "missing alias": + del spec["case_resources"][Path(CASES[first]["case_aliases"]["case.json"]).name] + elif change == "another guide": + nodes["guide"] = other["metadata"]["composition"]["nodes"]["guide"] + elif change == "excerpt": + spec["case_resources"]["case.json"] = "identity" + elif change == "stale": + nodes["original"]["revision"] = "sha256:" + "0" * 64 + elif change == "identity": + spec["metadata"]["id"] = second.partition(":")[2] + elif change == "swapped selector": + routes["finding-0"]["finding"] = routes["finding-1"]["finding"] + else: + routes["finding-0"]["optional"] = ["finding-1"] + write_json(path, spec) + target = tmp_path / "published" + with pytest.raises(ValueError, match=error): + build_generation(author, target, permits=allow, source_roots={RELEASE_COMMIT: release}) + assert not target.exists() From 7734e11d1ea238ae7b76ba227e2734ef67c3ed4b Mon Sep 17 00:00:00 2001 From: Dong1017 <55723162+Dong1017@users.noreply.github.com> Date: Fri, 27 Nov 2026 03:35:43 +0800 Subject: [PATCH 05/12] Reject Case reads missing original decision fields or finding routes Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com> --- .gitattributes | 1 - src/inferrsi/knowledge/atomic_build.py | 27 ++++++++++++++++++------ tests/knowledge/test_atomic_casebooks.py | 14 ++++++++++-- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/.gitattributes b/.gitattributes index f75926676..4bdb61b8a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13,7 +13,6 @@ /evidence/README.md text eol=lf /evidence/_template/** text eol=lf -# Case atoms address byte ranges in the original release files. /src/inferrsi/knowledge/atoms/casebooks/* -text # Retain this upstream license's original CRLF Git blob bytes. diff --git a/src/inferrsi/knowledge/atomic_build.py b/src/inferrsi/knowledge/atomic_build.py index ee227c9dc..cd0c7c177 100644 --- a/src/inferrsi/knowledge/atomic_build.py +++ b/src/inferrsi/knowledge/atomic_build.py @@ -48,7 +48,7 @@ def _verify_case_finding_routes(metadata, raw, record, material): source = metadata["sources"][0] nodes = declaration["nodes"] - def finding_spans(roots): + def required_spans(roots): pending, visited, spans = list(roots), set(), set() while pending: name = pending.pop() @@ -64,13 +64,13 @@ def finding_spans(roots): _, origin = material[pin] if origin["source"] != source: raise ValueError("A source-backed Case decision must use its original Case") - lo, hi = origin["source_byte_range"] - findings = members["/findings"] - if lo < findings.end and findings.start < hi: - spans.add((lo, hi)) + if origin["layer"] != "L1": + raise ValueError("A Case decision must use original L1 fields") + spans.add(tuple(origin["source_byte_range"])) pending.extend(node.get("requires", [])) return spans + findings = members["/findings"] for route in declaration["routes"].values(): if route["layer"] != "L1": continue @@ -80,9 +80,22 @@ def finding_spans(roots): index, _ = case.finding(selector) member = members[f"/findings/{index}"] selected = {(member.start, member.end)} - if (finding_spans(route["required"]) != selected - or finding_spans(route.get("optional", [])) - selected): + required = required_spans(route["required"]) + optional = required_spans(route.get("optional", [])) + overlapping = {span for span in required | optional + if span[0] < findings.end and findings.start < span[1]} + if not selected <= required or overlapping != selected: raise ValueError("Case decision route must bind only its selected original finding") + declared = case.project(finding=selector)["card"]["declared"] + for field in declared.keys() - {"finding"}: + member = members["/" + field] + if not any(lo <= member.start and member.end <= hi for lo, hi in required): + raise ValueError(f"Case route omits a required original decision field: {field}") + for index in range(len(record["findings"])): + selected = select_routes(declaration, layer="L1", context={}, case=case, + finding=case.finding_locator(index)) + if selected.refusal: + raise ValueError("Case must provide a decision route for every original finding") def _case_content(metadata: dict, bindings: dict, material: dict) -> dict[str, bytes]: diff --git a/tests/knowledge/test_atomic_casebooks.py b/tests/knowledge/test_atomic_casebooks.py index a6a115462..0ba0b7efd 100644 --- a/tests/knowledge/test_atomic_casebooks.py +++ b/tests/knowledge/test_atomic_casebooks.py @@ -133,7 +133,6 @@ def test_one_finding_and_its_shared_fields_reproduce_the_released_card(ref, inde assert (start, end) == (expected["start_byte"], expected["end_byte"]) data = raw[start:end] assert digest(data) == part["sha256"] == expected["span_sha256"] - # Retain the public index without providing sibling finding contents. shared["findings"] = [{} for _ in range(index)] + [json.loads(data)] markdown = Path(row["entry_source"]).name source = DecisionSource(ref, row["revision"], "case", "case.json", markdown, shared) @@ -264,6 +263,10 @@ def test_public_selection_delivers_one_released_card(installed_cases, originals, ("excerpt", "complete L3 original"), ("stale", "Missing pinned"), ("identity", "identity"), ("swapped selector", "selected original finding"), ("optional sibling", "selected original finding"), + ("missing limits", "required original decision field"), + ("optional limits", "required original decision field"), + ("missing sources", "required original decision field"), + ("missing finding route", "every original finding"), ]) def test_build_refuses_broken_case_bindings(tmp_path, originals, change, error): author, release = case_sources(tmp_path, originals) @@ -286,8 +289,15 @@ def test_build_refuses_broken_case_bindings(tmp_path, originals, change, error): spec["metadata"]["id"] = second.partition(":")[2] elif change == "swapped selector": routes["finding-0"]["finding"] = routes["finding-1"]["finding"] - else: + elif change == "optional sibling": routes["finding-0"]["optional"] = ["finding-1"] + elif change == "missing finding route": + del routes["finding-0"] + else: + shared = "sources" if change == "missing sources" else "limits-attribution" + nodes["finding-0"]["requires"].remove(shared) + if change == "optional limits": + routes["finding-0"]["optional"] = [shared] write_json(path, spec) target = tmp_path / "published" with pytest.raises(ValueError, match=error): From 1461cc697eb864e4b5514277c89ff66c484bce06 Mon Sep 17 00:00:00 2001 From: Dong1017 <55723162+Dong1017@users.noreply.github.com> Date: Fri, 27 Nov 2026 03:08:23 +0800 Subject: [PATCH 06/12] Freeze the released decisions for both Casebook guide namespaces Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com> --- .../atomic-reader/casebook-domain-v0.3.4.json | 56 +++++++++++++++++++ .../knowledge/test_atomic_casebook_entries.py | 39 +++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 tests/knowledge/test_atomic_casebook_entries.py diff --git a/tests/fixtures/atomic-reader/casebook-domain-v0.3.4.json b/tests/fixtures/atomic-reader/casebook-domain-v0.3.4.json index 961807102..1245f8fdf 100644 --- a/tests/fixtures/atomic-reader/casebook-domain-v0.3.4.json +++ b/tests/fixtures/atomic-reader/casebook-domain-v0.3.4.json @@ -43,10 +43,24 @@ }, "refs": { "checkout:ascend-optimization-casebook": { + "decision": { + "atom": { + "kind": "skill", + "resource": "casebooks/ascend/ascend-optimization-casebook/SKILL.md" + }, + "card_bytes": 3543, + "card_sha256": "52399e16c9862a21ce6dba1bcbd101ecf1e313f285d8f46da9d6e16e2a1b5727", + "missing_fields": [ + "validation" + ], + "status": "partial" + }, "dependencies": {}, "entry_sha256": "b1ffddd0784743840606c151e7cf23f6eb5466e90f93f6d91214fded73c0be4a", "entry_source": "casebooks/ascend/ascend-optimization-casebook/SKILL.md", "kind": "skill", + "legacy_entrypoint": "casebooks/ascend/ascend-optimization-casebook/SKILL.md", + "legacy_entrypoint_sha256": "b1ffddd0784743840606c151e7cf23f6eb5466e90f93f6d91214fded73c0be4a", "required_count": 1, "resource_count": 1, "resource_set_sha256": "056b4ae5ebcefa8b02176c80b830161fd5c1dff6e50862a54902e4bc279b0972", @@ -741,34 +755,76 @@ "revision": "sha256:c6fbc3bc68158a174b687d360d6c74fb19b33204029e3c791690376b193752fe" }, "checkout:inference-optimization-casebook": { + "decision": { + "atom": { + "kind": "skill", + "resource": "casebooks/inference/inference-optimization-casebook/SKILL.md" + }, + "card_bytes": 7645, + "card_sha256": "641e80a7fa243d7eaff436e2ab6443b885b2bad9d0f838e1d6cd36a116aba11d", + "missing_fields": [ + "validation" + ], + "status": "partial" + }, "dependencies": {}, "entry_sha256": "cec75f3a721dd13e6913b597d5373833a14c39d9048951a30c4864dd2c49aac8", "entry_source": "casebooks/inference/inference-optimization-casebook/SKILL.md", "kind": "skill", + "legacy_entrypoint": "casebooks/inference/inference-optimization-casebook/SKILL.md", + "legacy_entrypoint_sha256": "cec75f3a721dd13e6913b597d5373833a14c39d9048951a30c4864dd2c49aac8", "required_count": 9, "resource_count": 9, "resource_set_sha256": "acbff18fd5d8d53e270aedc0ce8c54a026de19b8e2cba0cfc24b6cd185b68d81", "revision": "sha256:af6b98cf6a8a140075e2511bf21bfb783954c89111dbc94e2d30bd7b86179abb" }, "package:inferrsi.ascend.skills.ascend_optimization_casebook": { + "decision": { + "atom": { + "kind": "skill", + "resource": "data/skill_library/casebooks/ascend/ascend-optimization-casebook/SKILL.md" + }, + "card_bytes": 3584, + "card_sha256": "731014f5585ec42d6be81596f67f94e976dff32c85d2ba426bcbd91d06fa0444", + "missing_fields": [ + "validation" + ], + "status": "partial" + }, "dependencies": { "data/skill_library": "sha256:502067b90d93cae5a58c6afd65dae5a4cbe183fd29ffb21ea67e8d703e66425d" }, "entry_sha256": "b1ffddd0784743840606c151e7cf23f6eb5466e90f93f6d91214fded73c0be4a", "entry_source": "casebooks/ascend/ascend-optimization-casebook/SKILL.md", "kind": "knowledge", + "legacy_entrypoint": "record.json", + "legacy_entrypoint_sha256": "8b36d24ebeefdc1b6e093fe0550ff3dc0d1c7bad939ccfc2326c35557c09a575", "required_count": 716, "resource_count": 716, "resource_set_sha256": "4999290e09960fe9635ded6a1679cd5466b1cd6b12d5b0878d362325edf0a944", "revision": "sha256:be745b9ccf05f4e357628995237dfe2b99c59bd8ea63a9b06d3c213ba086b684" }, "package:inferrsi.common.skills.inference_optimization_casebook": { + "decision": { + "atom": { + "kind": "skill", + "resource": "data/skill_library/casebooks/inference/inference-optimization-casebook/SKILL.md" + }, + "card_bytes": 7686, + "card_sha256": "abbc6e65d68c265b9e370d3cd977ea73a3b32a0deae4abc42f3d6ff6bf50e0b8", + "missing_fields": [ + "validation" + ], + "status": "partial" + }, "dependencies": { "data/skill_library": "sha256:502067b90d93cae5a58c6afd65dae5a4cbe183fd29ffb21ea67e8d703e66425d" }, "entry_sha256": "cec75f3a721dd13e6913b597d5373833a14c39d9048951a30c4864dd2c49aac8", "entry_source": "casebooks/inference/inference-optimization-casebook/SKILL.md", "kind": "knowledge", + "legacy_entrypoint": "record.json", + "legacy_entrypoint_sha256": "c44a40a3a5917af4d73494ee86944a303314d96bfebba4cc3902a305a2cc8c84", "required_count": 716, "resource_count": 716, "resource_set_sha256": "35373bd4464163c66e53deaa7264b0389e43ea6984f6aa59553b0971956025b3", diff --git a/tests/knowledge/test_atomic_casebook_entries.py b/tests/knowledge/test_atomic_casebook_entries.py new file mode 100644 index 000000000..08ff9a757 --- /dev/null +++ b/tests/knowledge/test_atomic_casebook_entries.py @@ -0,0 +1,39 @@ +"""Compare both Casebook guides against the decisions observed from the released wheel.""" + +from zipfile import ZipFile + +import pytest + +from inferrsi.knowledge.catalog import _skill_search_source +from inferrsi.knowledge.decision_cards import DecisionSource +from tests.knowledge.test_atomic_casebooks import BASELINE, FIXTURES, canonical, digest + +GUIDES = {ref: row for ref, row in BASELINE["refs"].items() if "decision" in row} + + +@pytest.mark.parametrize("ref", sorted(GUIDES)) +def test_released_guide_reproduces_each_namespaced_decision(ref): + row = GUIDES[ref] + expected = row["decision"] + with ZipFile(FIXTURES / "casebook-sources-v0.3.4.zip") as archive: + data = archive.read(row["entry_source"]) + assert digest(data) == row["entry_sha256"] + _, metadata = _skill_search_source(data.decode()) + assert metadata["empirical_validation"] == "not_run" + guide = ("" if ref.startswith("checkout:") else "data/skill_library/") + row["entry_source"] + assert expected["atom"] == {"kind": "skill", "resource": guide} + if ref.startswith("package:"): + assert row["legacy_entrypoint"] == "record.json" + assert row["legacy_entrypoint_sha256"] != digest(data) + else: + assert row["legacy_entrypoint"] == guide and row["legacy_entrypoint_sha256"] == digest(data) + source = DecisionSource(ref, row["revision"], "skill", guide, guide, metadata) + budget = expected["card_bytes"] + reply = source.project(max_bytes=budget) + card = reply["card"] + assert reply["card_bytes"] == len(canonical(card)) == budget + assert digest(canonical(card)) == expected["card_sha256"] + assert card["status"] == expected["status"] == "partial" + assert card["missing_fields"] == expected["missing_fields"] == ["validation"] + short = source.project(max_bytes=budget - 1) + assert short["status"] == "over_budget" and "card" not in short From 24aba9aa246bc4b9c3a4541e9b0e3af3e0074af2 Mon Sep 17 00:00:00 2001 From: Dong1017 <55723162+Dong1017@users.noreply.github.com> Date: Fri, 27 Nov 2026 03:37:00 +0800 Subject: [PATCH 07/12] Install and read the two released Casebook directory Skills Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com> --- src/inferrsi/knowledge/atomic_build.py | 76 ++++-- src/inferrsi/knowledge/atomic_generation.py | 21 +- .../knowledge/atomic_skill_directory.py | 97 +++++++ ...ascend-optimization-casebook.original.json | 95 +++++++ .../casebooks/ascend-optimization-casebook.md | 244 ++++++++++++++++++ .../inference-optimization-casebook.md | 190 ++++++++++++++ ...erence-optimization-casebook.original.json | 103 ++++++++ .../ascend-optimization-casebook.json | 107 ++++++++ .../inference-optimization-casebook.json | 171 ++++++++++++ .../knowledge/test_atomic_casebook_entries.py | 173 ++++++++++++- 10 files changed, 1249 insertions(+), 28 deletions(-) create mode 100644 src/inferrsi/knowledge/atomic_skill_directory.py create mode 100644 src/inferrsi/knowledge/atoms/ascend-optimization-casebook.original.json create mode 100644 src/inferrsi/knowledge/atoms/casebooks/ascend-optimization-casebook.md create mode 100644 src/inferrsi/knowledge/atoms/casebooks/inference-optimization-casebook.md create mode 100644 src/inferrsi/knowledge/atoms/inference-optimization-casebook.original.json create mode 100644 src/inferrsi/knowledge/compositions/ascend-optimization-casebook.json create mode 100644 src/inferrsi/knowledge/compositions/inference-optimization-casebook.json diff --git a/src/inferrsi/knowledge/atomic_build.py b/src/inferrsi/knowledge/atomic_build.py index cd0c7c177..5b5e8be97 100644 --- a/src/inferrsi/knowledge/atomic_build.py +++ b/src/inferrsi/knowledge/atomic_build.py @@ -12,6 +12,7 @@ from .atomic_generation import FORMAT, PUBLIC_TASKS, SEAL, InstalledGeneration, digest, owned_path from .atomic_json import matches_span, member_spans from .atomic_reader import atom_material, permits_operations +from .atomic_skill_directory import directory_content, export_directory_skill, skill_spans from .decision_cards import DecisionSource from .knowledge_operations import IDENTITY, Bundle, _json, case_required_resources, safe_path @@ -98,25 +99,29 @@ def required_spans(roots): raise ValueError("Case must provide a decision route for every original finding") -def _case_content(metadata: dict, bindings: dict, material: dict) -> dict[str, bytes]: - """Resolve the original Case and its declared relative resources from pinned L3 nodes.""" - if not isinstance(bindings, dict) or "case.json" not in bindings: - raise ValueError("Case resources must bind the original case.json") +def _pinned_resources(metadata: dict, bindings: dict, material: dict) -> tuple[dict, dict]: content, origins = {}, {} nodes = metadata["composition"]["nodes"] for name, key in bindings.items(): safe_path(name) if not isinstance(key, str) or key not in nodes: - raise ValueError(f"Undeclared Case resource node for {name}") + raise ValueError(f"Undeclared resource node for {name}") node = nodes[key] pin = AtomPin(node["ref"], node["revision"]) if pin not in material: - raise ValueError(f"Missing pinned Case resource for {name}") + raise ValueError(f"Missing pinned resource for {name}") body, origin = material[pin] if not _complete_original(body, origin): - raise ValueError(f"Case resource requires a complete L3 original: {name}") + raise ValueError(f"Resource requires a complete L3 original: {name}") content[name], origins[name] = body, origin["source"] + return content, origins + +def _case_content(metadata: dict, bindings: dict, material: dict) -> dict[str, bytes]: + """Resolve the original Case and its declared relative resources from pinned L3 nodes.""" + if not isinstance(bindings, dict) or "case.json" not in bindings: + raise ValueError("Case resources must bind the original case.json") + content, origins = _pinned_resources(metadata, bindings, material) source = origins["case.json"] record = json.loads(content["case.json"]) if (not isinstance(record, dict) or record.get("kind") != "case" @@ -139,15 +144,28 @@ def _case_content(metadata: dict, bindings: dict, material: dict) -> dict[str, b return content -def _authored(directory, path, field, descriptor, material) -> tuple[AtomPin, Bundle]: +def _authored(directory, path, field, descriptor, material, roots) -> tuple[AtomPin, Bundle]: metadata = descriptor["metadata"] if field not in metadata or ("atom" in metadata and "composition" in metadata): raise ValueError(f"{path.name} must declare one {field}") content = {} + directory_export = metadata[field].get("skill") == {"directory_entry": True} + if directory_export and "directory_resources" not in descriptor: + raise ValueError("Directory Skill export requires checked original directory resources") if "case_resources" in descriptor: if field != "composition" or metadata["kind"] != "case" or "content" in descriptor: raise ValueError("Only a Case composition may bind its content through case_resources") content = _case_content(metadata, descriptor["case_resources"], material) + if "directory_resources" in descriptor: + if (field != "composition" or metadata["kind"] != "skill" + or descriptor.get("authority") != "checkout" or "content" in descriptor + or descriptor.get("dependencies")): + raise ValueError("Directory resources require a self-contained checkout Skill") + bindings = descriptor["directory_resources"] + if not isinstance(bindings, dict): + raise ValueError("Skill directory resources must bind original relative names") + content, origins = _pinned_resources(metadata, bindings, material) + content = directory_content(metadata, bindings, content, origins, material, roots) for name, value in descriptor.get("content", {}).items(): safe_path(name) if isinstance(value, dict) and value.keys() == {"path"}: @@ -230,12 +248,12 @@ def _verify_source(body: bytes, record: dict, roots: Mapping[str, Path]) -> bool return True -def _authored_inputs(directory: Path, field: str, material: dict): +def _authored_inputs(directory: Path, field: str, material: dict, roots=None): for path in sorted(directory.glob("*.json")): if not re.fullmatch(IDENTITY, path.stem): raise ValueError(f"Invalid descriptor filename: {path.name}") descriptor = json.loads(owned_path(directory, path.name).read_bytes()) - pin, bundle = _authored(directory, path, field, descriptor, material) + pin, bundle = _authored(directory, path, field, descriptor, material, roots) yield path.stem, pin, bundle if "parts" not in descriptor: continue @@ -247,30 +265,40 @@ def _authored_inputs(directory: Path, field: str, material: dict): parts = descriptor["parts"] if not isinstance(parts, dict) or not parts: raise ValueError("Atom parts must declare named source spans") - members = member_spans(body) + is_skill = PurePosixPath(origin["source_path"]).name == "SKILL.md" + members = skill_spans(body) if is_skill else member_spans(body) for name, part in parts.items(): if not re.fullmatch(r"[a-z0-9][a-z0-9-]*", name): raise ValueError(f"Invalid atom part name: {name}") start, end = part["byte_range"] if type(start) is not int or type(end) is not int or not 0 <= start < end <= len(body): raise ValueError(f"Invalid source range for atom part {name}") - pointers = part["pointers"] - if (not isinstance(pointers, list) or not pointers - or not all(isinstance(ptr, str) and ptr.startswith("/") for ptr in pointers)): - raise ValueError(f"Expected source JSON pointers for atom part {name}") - if not matches_span(members, pointers, start, end): - raise ValueError(f"JSON pointers do not match the source range for part {name}") + if is_skill: + section = part.get("skill_section") + if (not isinstance(section, str) + or members.get(section) != (part["layer"], start, end)): + raise ValueError(f"Mismatched Skill section source range or layer: {name}") + locator = {"source_section": section} + fields = section + else: + pointers = part.get("pointers") + if (not isinstance(pointers, list) or not pointers or not all( + isinstance(ptr, str) and ptr.startswith("/") for ptr in pointers)): + raise ValueError(f"Expected source JSON pointers for atom part {name}") + if not matches_span(members, pointers, start, end): + raise ValueError(f"JSON pointers do not match the source range for part {name}") + locator = {"source_pointers": pointers} + fields = ", ".join(ptr.removeprefix("/") for ptr in pointers) atom = bundle.metadata["atom"] span = {**atom["source_span"], "byte_range": [start, end], "sha256": part["sha256"]} title = bundle.metadata.get("title", bundle.metadata["id"]) - fields = ", ".join(ptr.removeprefix("/") for ptr in pointers) child = Bundle({ **bundle.metadata, "id": bundle.metadata["id"] + "." + name, "title": part.get("title", f"{title} — {fields}"), "summary": part.get("summary", bundle.metadata.get("summary", "")), "entrypoint": "excerpt", "atom": {**atom, "resource": "excerpt", "layer": part["layer"], - "source_span": span, "source_pointers": pointers}, + "source_span": span, **locator}, }, {"excerpt": body[start:end]}, {}) child_pin = AtomPin(pin.ref + "." + name, child.revision) yield path.stem + "." + name, child_pin, child @@ -283,7 +311,7 @@ def _prepare(source: Path, permits: Callable[[AtomPin, str], bool], roots: Mappi directory = owned_path(source, family) if not directory.is_dir(): raise ValueError(f"Missing authored {family} directory") - for stem, pin, bundle in _authored_inputs(directory, field, material): + for stem, pin, bundle in _authored_inputs(directory, field, material, roots): if pin.ref in entries: raise ValueError(f"Duplicate qualified reference: {pin.ref}") view = bundle.view() @@ -296,7 +324,8 @@ def _prepare(source: Path, permits: Callable[[AtomPin, str], bool], roots: Mappi if prefix + ".json" in files: raise ValueError(f"Duplicate generated manifest: {prefix}") files[prefix + ".json"] = _json(bundle.manifest()) - files.update({prefix + "/" + name: data for name, data in bundle.content.items()}) + if declaration.get("skill") != {"directory_entry": True}: + files.update({prefix + "/" + name: data for name, data in bundle.content.items()}) entry = {"revision": pin.revision, "manifest": prefix + ".json", "kind": view["kind"]} for key in ("title", "summary"): if isinstance(view.get(key), str): @@ -324,7 +353,10 @@ def _prepare(source: Path, permits: Callable[[AtomPin, str], bool], roots: Mappi if route["layer"] not in layers: raise ValueError(f"No required root supplies {route['layer']} for {pin.ref}") if "skill" in declaration: - name, output = _host_skill(declaration["skill"], nodes, material) + if declaration["skill"] == {"directory_entry": True}: + name, output = export_directory_skill(bundle) + else: + name, output = _host_skill(declaration["skill"], nodes, material) if name in skills: raise ValueError(f"Multiple compositions export host skill {name}") skills[name] = pin.ref diff --git a/src/inferrsi/knowledge/atomic_generation.py b/src/inferrsi/knowledge/atomic_generation.py index f9a1d0cb2..d840b6b4e 100644 --- a/src/inferrsi/knowledge/atomic_generation.py +++ b/src/inferrsi/knowledge/atomic_generation.py @@ -4,7 +4,7 @@ import hashlib import json -from pathlib import Path +from pathlib import Path, PurePosixPath from .atomic_composition import AtomPin from .knowledge_operations import Bundle, UnavailableRevision, _json, safe_path @@ -21,6 +21,12 @@ def digest(data: bytes) -> str: return hashlib.sha256(data).hexdigest() +def directory_skill_path(metadata: dict, name: str) -> str: + entry = PurePosixPath(safe_path(metadata["entrypoint"])) + relative = PurePosixPath(safe_path(name)).relative_to(entry.parent) + return f"skills/{safe_path(metadata['id'])}/{relative.as_posix()}" + + def owned_path(root: Path, name: str) -> Path: """Resolve a portable resource within its owner, rejecting links and Windows junctions.""" path = root @@ -68,16 +74,21 @@ def __init__(self, root: Path, *, expected: str | None = None): pin = AtomPin(ref, entry["revision"]) path = safe_path(entry["manifest"]) manifest = json.loads(files[path]) - content = {name: files[path.removesuffix(".json") + "/" + safe_path(name)] - for name in manifest["resources"]} + metadata = manifest["metadata"] + skill = metadata.get("composition", {}).get("skill") + if skill == {"directory_entry": True}: + content = {name: files[directory_skill_path(metadata, name)] + for name in manifest["resources"]} + else: + content = {name: files[path.removesuffix(".json") + "/" + safe_path(name)] + for name in manifest["resources"]} bundle = Bundle(manifest["metadata"], content, manifest["dependencies"]) if (ref.partition(":")[2] != bundle.metadata["id"] or bundle.manifest() != manifest or bundle.revision != pin.revision): raise ValueError(f"Installed Bundle differs from its catalog entry: {ref}") self._bundles[pin] = bundle - skill = bundle.metadata.get("composition", {}).get("skill") if skill is not None: - name = skill["name"] + name = metadata["id"] if skill == {"directory_entry": True} else skill["name"] if name in exports or f"skills/{name}/SKILL.md" not in files: raise ValueError(f"Invalid host skill export: {name}") exports[name] = ref diff --git a/src/inferrsi/knowledge/atomic_skill_directory.py b/src/inferrsi/knowledge/atomic_skill_directory.py new file mode 100644 index 000000000..826885867 --- /dev/null +++ b/src/inferrsi/knowledge/atomic_skill_directory.py @@ -0,0 +1,97 @@ +"""Build the pinned sections, relative resources and host export of a self-contained Skill.""" + +from __future__ import annotations + +import re +from io import BytesIO +from pathlib import PurePosixPath + +from ._skill_selection import skill_procedure +from .atomic_composition import AtomPin, select_routes +from .atomic_generation import directory_skill_path, owned_path +from .knowledge_operations import Bundle, _tree, safe_path +from .skill_catalog import _effective, _frontmatter_parts + + +def skill_spans(body: bytes) -> dict: + _, procedure = skill_procedure("SKILL.md", body) + header = re.match(rb"\A---[ \t]*\r?\n.*?^---[ \t]*(?:\r?\n|\Z)", body, re.M | re.S) + if not procedure or not header: + raise ValueError("Skill sections require a complete guide with embedded decision metadata") + navigation_end = procedure["source_byte_ranges"][0][1] + public, _ = _frontmatter_parts(BytesIO(body[:navigation_end] + b"---\n")) + if not all(isinstance(public.get(key), str) and public[key].strip() + for key in ("name", "description")): + raise ValueError("Skill navigation must include its original name and description") + return {"navigation": ("L0", 0, navigation_end), "decision": ("L1", 0, header.end()), + "procedure": ("L2", header.end(), len(body))} + + +def _verify_directory_routes(declaration, bindings, guide, source, material): + sections = skill_spans(guide) + if any(any(route.get(key) for key in ("when", "optional", "supersedes", "conflicts")) + for route in declaration["routes"].values()): + raise ValueError("Directory routes must preserve their unconditional delivery") + nodes = declaration["nodes"] + originals = {AtomPin(nodes[name]["ref"], nodes[name]["revision"]) for name in bindings.values()} + for layer, names in (("L0", ["navigation"]), ("L1", ["decision"]), + ("L2", ["decision", "procedure"]), ("L3", [])): + selected = select_routes(declaration, layer=layer, context={}, case=None, finding=None) + pins = {use.pin for use in selected.required} + if layer == "L3": + if pins != originals: + raise ValueError("Skill L3 must deliver the complete original directory") + continue + actual = set() + for pin in pins: + if pin not in material: + raise ValueError(f"Missing pinned Skill section: {pin.ref}") + origin = material[pin][1] + if origin["source"] != source: + raise ValueError(f"Skill {layer} must deliver its own pinned guide sections") + actual.add((origin["layer"], *origin["source_byte_range"])) + if actual != {sections[name] for name in names}: + raise ValueError(f"Skill {layer} must deliver its own pinned guide sections") + + +def directory_content(metadata, bindings, content, origins, material, roots) -> dict[str, bytes]: + """Keep all the original names and bytes of a self-contained checkout Skill directory.""" + entry = PurePosixPath(safe_path(metadata["entrypoint"])) + if (not isinstance(bindings, dict) or entry.as_posix() not in bindings + or entry.name != "SKILL.md" or entry.parent.name != metadata["id"]): + raise ValueError("Skill directory must bind its original SKILL.md and identity") + source = origins[entry.as_posix()] + original = PurePosixPath(source["path"]) + if (source != metadata["sources"][0] or original.parts[-len(entry.parts):] != entry.parts + or not roots or source.get("commit") not in roots): + raise ValueError("Skill directory requires its pinned source root") + for name, origin in origins.items(): + if (not PurePosixPath(name).is_relative_to(entry.parent) + or source.get("repo") != origin.get("repo") + or source["commit"] != origin.get("commit") + or original.parent / PurePosixPath(name).relative_to(entry.parent) + != PurePosixPath(origin["path"])): + raise ValueError(f"Skill resource differs from its original relative source: {name}") + root = roots[source["commit"]] + directory = owned_path(root, original.parent.as_posix()) + if _effective(directory).get("references"): + raise ValueError("Self-contained directory cannot omit declared Skill references") + released = _tree(directory, entry.parent.as_posix(), root=root) + if content != released or metadata["required_resources"] != sorted(released): + raise ValueError("Skill directory bindings must cover the complete original directory") + _verify_directory_routes(metadata["composition"], bindings, content[entry.as_posix()], + source, material) + return content + + +def export_directory_skill(bundle: Bundle) -> tuple[str, dict[str, bytes]]: + name = bundle.metadata["id"] + entry = PurePosixPath(bundle.metadata["entrypoint"]) + header, _ = _frontmatter_parts(BytesIO(bundle.content[entry.as_posix()])) + description = header.get("description") + if (len(name) > 64 or not re.fullmatch(r"[a-z0-9]+(?:-[a-z0-9]+)*", name) + or header.get("name") != name or not isinstance(description, str) + or not 1 <= len(description.strip()) <= 1024): + raise ValueError("Directory Skill must have a valid matching host name and description") + return name, {directory_skill_path(bundle.metadata, path): raw + for path, raw in bundle.content.items()} diff --git a/src/inferrsi/knowledge/atoms/ascend-optimization-casebook.original.json b/src/inferrsi/knowledge/atoms/ascend-optimization-casebook.original.json new file mode 100644 index 000000000..4dca77a65 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/ascend-optimization-casebook.original.json @@ -0,0 +1,95 @@ +{ + "authority": "checkout", + "metadata": { + "id": "ascend-optimization-casebook.original", + "kind": "knowledge", + "entrypoint": "guide.md", + "title": "Casebook of NPU optimization cases for Ascend inference systems: symptom → diagnosis → action → evidence records for memory-bound, compute-bound, communication-exposed, graph-compilation, and AI-CPU-fallback bottleneck classes. Use when a bottleneck has been classified and you need prior art for what to try next. Complement to inference-optimization-casebook (which covers the casebook *pattern*; this carries the actual NPU cases).\n", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/ascend/ascend-optimization-casebook/SKILL.md", + "sha256": "b1ffddd0784743840606c151e7cf23f6eb5466e90f93f6d91214fded73c0be4a" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Find source-derived prior cases for an already classified Ascend inference bottleneck, including fallback, memory traffic, exposed communication, graph startup and host scheduling gaps.", + "prerequisites": "A bottleneck classification from profiling and a check of the selected case preconditions/mechanism before applying it.", + "input_contract": "Bottleneck symptoms and matching profiler evidence, model/hardware/CANN/configuration context and, for a new case, measured before/after metrics.", + "produced_artifact": "A matching prior-art case and evidence requirements for a later measured application; a new case record requires a verified win or clear failure with a metric comparison.", + "refusal_point": "Do not add an INCONCLUSIVE case or one without a measured metric comparison; a subjective direction is insufficient evidence." + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Original typed source inventory is not normalized; retain source identities and limits in the procedure/readsets.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/ascend/ascend-optimization-casebook/SKILL.md", + "byte_range": [ + 0, + 11126 + ], + "sha256": "b1ffddd0784743840606c151e7cf23f6eb5466e90f93f6d91214fded73c0be4a" + } + } + }, + "content": { + "guide.md": { + "path": "casebooks/ascend-optimization-casebook.md" + } + }, + "parts": { + "navigation": { + "skill_section": "navigation", + "layer": "L0", + "byte_range": [ + 0, + 499 + ], + "sha256": "a40dca9d4664aabc8ac011a4f8da6f28bdff5575ce552392f81481d14f3d05b2" + }, + "decision": { + "skill_section": "decision", + "layer": "L1", + "byte_range": [ + 0, + 2457 + ], + "sha256": "f9f82337e195fda49cc797f93adb2ee4cf94870b083e5af133908e38124fd5dd" + }, + "procedure": { + "skill_section": "procedure", + "layer": "L2", + "byte_range": [ + 2457, + 11126 + ], + "sha256": "44defa3c30609f25afe1aa5077c9f81a080cb5f202490f767349853957243a5b" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/casebooks/ascend-optimization-casebook.md b/src/inferrsi/knowledge/atoms/casebooks/ascend-optimization-casebook.md new file mode 100644 index 000000000..6d701cbbc --- /dev/null +++ b/src/inferrsi/knowledge/atoms/casebooks/ascend-optimization-casebook.md @@ -0,0 +1,244 @@ +--- +name: ascend-optimization-casebook +description: 'Casebook of NPU optimization cases for Ascend inference systems: symptom → diagnosis → action → evidence records for memory-bound, compute-bound, communication-exposed, graph-compilation, and AI-CPU-fallback bottleneck classes. Use when a bottleneck has been classified and you need prior art for what to try next. Complement to inference-optimization-casebook (which covers the casebook *pattern*; this carries the actual NPU cases). + + ' +metadata: + inferrsi: | + { + "tags": [ + "ascend", + "npu", + "optimization", + "casebook", + "prior-art" + ], + "status": "candidate", + "profile": "local-skill-v1", + "schema_version": 1, + "kind": "skill", + "origin": [ + "external" + ], + "empirical_validation": "not_run", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Original typed source inventory is not normalized; retain source identities and limits in the procedure/readsets." + ], + "provenance_readsets": [], + "consumption_mode": "packaged", + "applicability": { + "scope": "Find source-derived prior cases for an already classified Ascend inference bottleneck, including fallback, memory traffic, exposed communication, graph startup and host scheduling gaps.", + "prerequisites": "A bottleneck classification from profiling and a check of the selected case preconditions/mechanism before applying it.", + "input_contract": "Bottleneck symptoms and matching profiler evidence, model/hardware/CANN/configuration context and, for a new case, measured before/after metrics.", + "produced_artifact": "A matching prior-art case and evidence requirements for a later measured application; a new case record requires a verified win or clear failure with a metric comparison.", + "refusal_point": "Do not add an INCONCLUSIVE case or one without a measured metric comparison; a subjective direction is insufficient evidence." + }, + "recommendations": [ + "Classify first, then check the matching case preconditions and use its owning procedure to apply and measure the candidate; the casebook itself does not perform profiling.", + "Keep profiler mechanism evidence and same-window end-to-end outcomes together, and retain locally_verified=false until the applied case has actually run." + ] + } +--- + +# Ascend NPU Optimization Casebook + +Status: candidate. Cases grounded in MindIE-SD @ 8481d39b and vllm-ascend +@ bc8115ed source evidence. All cases are source-grounded or inferred from +observed patterns; none have been independently re-run on a local NPU. +Mark each applied case as `locally_verified: false` until you run it. + +## How to use this casebook + +1. Classify the bottleneck first (see `ascend-performance-analysis` skill). + Do not consult this casebook before you have a bottleneck class. +2. Find the matching section below by bottleneck class. +3. Read the case: understand the precondition and mechanism before applying. +4. Apply through the relevant skill or reference, then measure. +5. Record the result as a new case entry when you have a verified win or + a clear failure with evidence. + +The casebook does not run profiling or make decisions — it informs them. + +--- + +## Bottleneck class: AI-CPU fallback + +### Case: op falls back to AI_CPU core + +**Symptom:** `kernel_details.csv` shows `Accelerator Core = AI_CPU` on a +hot-path operator. AI_CPU kernels are orders of magnitude slower than +AI_CORE or AI_VECTOR_CORE equivalents. This is almost always the highest- +priority fix when it appears. + +**Diagnosis:** Sort `kernel_details.csv` by `Duration` descending. Any +`AI_CPU` row in the top-10 is a candidate. Cross-check `Accelerator Core ≡ +Task Type` (they are the same field in different table layouts — verify +value-set equivalence before reporting). + +**Common causes:** +- The PyTorch op has no `torch_npu` equivalent registered. +- The op is registered but the input dtype or shape is outside its + supported range. +- A custom op was not compiled with the AscendC kernel. + +**Action:** +1. Identify the op name from the `Type` (or `OP Type`) column. +2. Check `torch_npu.nn` or the CANN op catalog for a supported equivalent. +3. If an equivalent exists: swap the op; rerun profile; confirm `AI_CPU` + rows disappear from the top-10. +4. If no equivalent: file a support issue or implement a custom AscendC + operator. This is a larger task — see `ascend-operator-profiling` for + the development loop. + +**Evidence required for a PASS verdict:** before/after `kernel_details.csv` +showing the target op has moved from `AI_CPU` to `AI_CORE` or `AI_VECTOR_CORE`, +and a same-window A/B comparison showing E2E latency improvement. + +**Source:** MindIE-SD `profiling-analyze` + `dit-perf-opt` @ 8481d39b. + +--- + +## Bottleneck class: memory-bound + +### Case: high mte2_ratio, low mac_ratio — DRAM bandwidth saturated + +**Symptom:** `op_summary*.csv` shows `mte2_ratio / max(mac_ratio, vec_ratio) +> 1` (the derived `memory_bound` heuristic). The kernel is spending more time +moving data than computing. + +**Diagnosis:** Confirm by cross-referencing `step_trace_time.csv` to ensure +`Computing` fraction is below expected. Then identify the memory-traffic +source: weight reads? activation reads? KV cache reads? + +**Actions (in escalating cost order):** +1. **Kernel fusion:** if two adjacent ops both read the same activation tensor, + fuse them so the tensor is read once. Look for elementwise + norm + + activation chains. Check `fusion-scope-analyze` references for fusion + boundary rules before attempting. +2. **Quantization:** reduce bytes-per-element (FP16 → INT8/FP8). For FP8 on + Ascend: dequantize at loading time (see `ascend-model-adaptation` skill); + verify AI Core utilization before and after — if mac_ratio does not improve, + the gain is not materializing at the hardware level. +3. **Tiling / blocking:** increase data reuse by processing in blocks that fit + in the AI Core local buffer (UB). This is an operator-level change requiring + a custom kernel. + +**Evidence required:** same-window A/B comparison of `mte2_ratio` and E2E +latency. A decrease in `mte2_ratio` without E2E improvement suggests the +memory-bound op was not on the critical path. + +**Source:** MindIE-SD `profiling-analyze` @ 8481d39b; `dit-perf-opt` feature +interaction matrix. + +--- + +## Bottleneck class: communication-exposed + +### Case: AllReduce / AllGather blocking compute forward pass + +**Symptom:** `step_trace_time.csv` shows `effective_comm = Communication - +Overlapped` is large relative to `Computing`. The communication is not being +masked by concurrent compute. + +**Diagnosis:** +1. Confirm with `communication.json`: identify which collective dominates. +2. Check `Overlapped` fraction. If `Overlapped` is near 0, the collective + is not pipelined with compute at all. +3. Verify the card group uses intra-domain topology (`npu-smi info -t topo`). + Cross-domain collectives have inherently lower bandwidth ceiling. + +**Actions:** +1. **Communication masking (comm-stream masking):** route the collective to a + separate HCCL stream that runs concurrently with compute kernels. The upper + bound of achievable masking is `1 - 1/n` (where n = TP/SP degree), but only + when compute time ≥ communication time in the same step. If compute is + shorter than communication, masking cannot fully hide the collective even + in theory. +2. **Parallelism strategy change:** if AllReduce dominates, consider moving to + Ulysses Sequence Parallelism (USP/AllToAll) which has lower collective size + for sequence-parallel attention. See `ascend-distributed-parallel` skill. +3. **Topology-aware card selection:** confirm the card group is intra-domain + (UB/HCCS). Switching to an intra-domain group can double effective bandwidth. + +**Evidence required:** `step_trace_time.csv` four-tuple before and after, plus +E2E latency. Specifically: `effective_comm` should decrease; `Overlapped` +fraction should increase if masking was applied. + +**Source:** MindIE-SD `profiling-analyze` Layer 4, `perf-gate`, and +`dit-parallel-opt` @ 8481d39b. + +--- + +## Bottleneck class: graph compilation overhead + +### Case: slow startup with npugraph_ex enabled + +**Symptom:** inference startup takes many minutes with graph mode enabled. +Once serving begins, per-request latency is normal. This is expected behavior, +not a failure. + +**Diagnosis:** startup cost = compile warmup + graph capture rounds + +multimodal encoder profiling. It scales with the number of graph shapes +captured. Excess recapture happens when the serving code presents variable +shapes to a graph configured for fixed shapes. + +**Actions:** +1. Do not treat slow startup as failure unless hard errors appear in the log. + Look for `Replaying aclgraph` — its presence confirms capture succeeded. +2. If startup time is unacceptable, reduce the number of distinct shapes by + padding inputs to fixed sizes, or enable fewer graph features (e.g., disable + static kernel compilation if it is not needed in this deployment). +3. Set `config.aclgraph_config.capture_limit` to bound recapture attempts. + +**Evidence required:** startup timing before and after config change. Confirm +`Replaying aclgraph` still appears in the log after reducing capture scope. + +**Source:** MindIE-SD `ascend-model-adaptation` references and awesome-ascend- +skills `ascend-graph-mode` @ 75ec89ce. + +--- + +## Bottleneck class: scheduling / idle gaps + +### Case: large `Free` fraction in step-trace + +**Symptom:** `step_trace_time.csv` shows `Free` is a significant fraction of +step time (e.g., > 15%). The NPU is idle between compute bursts. + +**Diagnosis:** look at `trace_view.json` for the host-side activity during the +`Free` period. Common causes: Python GIL contention, request batching delay, +or synchronization points in the framework that block the next kernel launch. + +**Action:** this is a host-overhead problem, not an NPU problem. See the +`host-overhead-profiling` and `host-overhead-optimization` skills (RAM/Host +row) for the diagnostic and fix workflow. + +**Source:** MindIE-SD `profiling-analyze` @ 8481d39b; TRT-LLM `perf-host- +analysis` @ f33e0e5f. + +--- + +## Adding a new case + +When you find a verified NPU optimization win, record it here with: + +```yaml +case_id: +bottleneck_class: [memory-bound | compute-bound | comm-exposed | graph-compile | scheduling | ai-cpu-fallback] +symptom: +precondition: +action: +mechanism: +evidence: + run_id: + metric_before: + metric_after: + verdict: [PASS | FAIL | INCONCLUSIVE] + locally_verified: false +generalizes_to: +does_not_apply_when: +``` + +Do not add a case for an INCONCLUSIVE result. Do not add a case without a +measured metric comparison. A direction ("it seemed faster") is not evidence. diff --git a/src/inferrsi/knowledge/atoms/casebooks/inference-optimization-casebook.md b/src/inferrsi/knowledge/atoms/casebooks/inference-optimization-casebook.md new file mode 100644 index 000000000..d67d1a861 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/casebooks/inference-optimization-casebook.md @@ -0,0 +1,190 @@ +--- +name: inference-optimization-casebook +description: 'How to structure and use a casebook of past optimization decisions as a decision-support tool. Extracts the casebook pattern from TensorRT-LLM''s perf-optimization-casebook skill. Use when building a record of optimization experiments or when deciding which optimization to try next based on prior art. + + ' +metadata: + inferrsi: | + { + "tags": [ + "optimization", + "casebook", + "prior-art", + "decision-support" + ], + "status": "candidate", + "profile": "local-skill-v1", + "schema_version": 1, + "kind": "skill", + "origin": [ + "external" + ], + "empirical_validation": "not_run", + "applicability": { + "scope": "Structuring and querying a casebook of past optimization decisions as decision support, when recording optimization experiments or choosing the next optimization from prior art; the casebook is reference material and neither runs profiling nor makes decisions", + "prerequisites": "Whole-body text access to the case files for free-text search; applying a case first requires reading the nearest checked-in config and the model's deployment guide", + "input_contract": "For a query: natural search terms such as model name, knob, mechanism word or deployment feature, plus the current model and hardware. For a new case: mechanism, applies-when and does-not-apply conditions, procedure, expected effect, accuracy risk, verification, rollback and a real measurement trail with run ID, verdict, exact hardware SKU, model revision, workload and before/after result", + "produced_artifact": "Ranked matching cases read as precedents and diagnostic options, or a new or deprecated case record in the template; a precedent's procedure and expected direction of effect, not a guaranteed configuration or a measured result", + "failure_modes": [ + "The query is pre-translated into canonical vocabulary or bounded by structured fields, so synonyms in the body text are missed", + "A case's specific values, such as batch size, tensor-parallel degree or kernel parameters, are copied instead of re-derived for the current model and hardware", + "The precedent's expected direction of effect stands in for measurement after the change is applied", + "A rejected direction is read as a permanent blacklist, or one discarded implementation as ruling out its mechanism", + "A confounded run, a missing experiment and a failed gate are recorded as the same evidence state", + "Cross-system cases are bootstrapped without re-verifying that the mechanism holds on the target hardware" + ], + "refusal_point": "Adds no case for an INCONCLUSIVE optimization-effect claim, a single-configuration result without plausible generalization, or a result without a real measurement trail, except a scoped diagnostic observation that keeps its verdict and configuration boundary; manufactures no PASS, and reading the records does not reopen a paused campaign" + }, + "recommendations": [ + "Search the full case bodies with free text first, then rank the hits by bottleneck class and signals.", + "Before retrying a rejected direction, state which condition changed or which uncertainty a bounded check resolves, run an unchanged control and choose the least expensive discriminating check.", + "Mark bootstrapped cases source_grounded or author_reported until a local measurement confirms or refutes them.", + "When a case's conditions no longer hold, mark it deprecated with the reason instead of deleting it." + ], + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Original typed source inventory is not normalized; retain source identities and limits in the procedure/readsets." + ], + "provenance_readsets": [], + "consumption_mode": "packaged" + } +--- + +# Inference Optimization Casebook Pattern + +Status: candidate. Source-grounded from TensorRT-LLM @ f33e0e5f, +`perf-optimization-casebook/SKILL.md`. + +## What a casebook is + +A casebook is a queryable record of past optimization decisions: what worked, +what failed, under what conditions, at what cost, and with what evidence. +It is reference material, not a coordinator. It does not run profiling or +make decisions — it informs them. + +The casebook pattern is valuable because: +- Optimization search is expensive; prior art prevents re-exploring dead ends. +- Successful patterns generalize across models and hardware generations. +- Failure modes generalize too: knowing that a technique fails under certain + conditions is as valuable as knowing when it succeeds. + +## Case structure + +Each case record should contain: + +```yaml +name: +bottleneck_class: [compute | memory | launch | communication | sync | host] +signals: # conditions that suggest this case applies + - model_arch: + - hardware: + - symptom: + - config: 1, sequence length > 4096"> +mechanism: | # what the optimization does at the hardware/algorithm level +applies_when: | # specific conditions required for the optimization to help +does_not_apply: | # conditions where this case is known to fail or be neutral +how_to_apply: | # step-by-step procedure to apply the optimization +expected_effect: | # direction and rough magnitude of expected improvement +accuracy_risk: # what quality/correctness guarantees may be affected +verification: | # how to confirm the optimization worked +rollback: | # how to undo the change safely +evidence: # what real measurement evidence supports this case + - run_id: + verdict: [PASS | FAIL | INCONCLUSIVE] + hardware: + model: + workload: + result: +``` + +Source: TRT-LLM casebook case-template.md @ f33e0e5f. + +## Query protocol + +**Always use free-text grep first.** The casebook search is recall-complete via +grep over the full case body text. Do not pre-translate the query into canonical +vocabulary before searching — that narrows recall. Search for natural terms: +model name, knob, mechanism word, deployment feature. + +```bash +# Good: natural query, whole-body search +grep -ril "quantization" cases/ +grep -ril "sequence parallel" cases/ +grep -ril "vae decode" cases/ + +# Then rank by frontmatter signals if multiple hits +grep -ril "mte2_ratio" cases/ | xargs grep -l "memory-bound" +``` + +Structured fields (bottleneck_class, signals) are for ranking among hits, +not for bounding the search. A synonym or colloquial term in the body text +would be missed by a structured-field-only query. +Source: perf-optimization-casebook @ f33e0e5f, §how-to-use. + +## Recorded diagnostic options + +Current owner-local records retain rejected directions alongside their limits: + +- [Qwen B300](cases/qwen-b300-rejected-directions.md): full-image rejection, + graph/copy overhead, unintegrated leads and confounded trials. +- [Qwen Ascend](cases/qwen-ascend-rejected-directions.md): reported OOM, + attention/cache alternatives and missing gain on one 910B1 cohort. +- [Drama3 B300](cases/drama3-rejected-directions.md): invalid controls, + correct kernels without service gain, prefix reuse and analytical rejection. + +Each `.json` sibling owns identity, origin, source pins and limitations; the +Markdown owns the observation and suggested revisit check. Read them as +diagnostic options, not a permanent blacklist. A discarded implementation does +not rule out another implementation of the same mechanism. A confounded run, +missing experiment and failed gate are different evidence states. + +Before retrying, state which condition changed or which uncertainty a bounded +check will resolve. Preserve the original result, run an unchanged control and +choose the least expensive discriminating check. Only new complete evidence can +qualify a new scope; reading these records does not reopen a paused campaign. + +## Adapt, do not copy + +A case is a precedent, not a guaranteed config. The procedure and expected +direction are reusable; the specific values (batch size, tensor parallelism +degree, kernel parameters) must be re-derived for the current model and hardware. +Before applying: read the nearest checked-in config and the model's deployment +guide. After applying: measure. The precedent's expected direction of effect +does not substitute for measurement. + +## When to add a new case + +Add a case when: +- A change produced a verified win or a clear, reproducible failure. +- The mechanism generalizes to other models or hardware. +- The prior-art record would have prevented wasted work. + +Do NOT add a case for: +- INCONCLUSIVE optimization-effect claims (not enough evidence to characterize + the effect). Keep the original campaign verdict and do not manufacture a + PASS; a scoped diagnostic observation may still be recorded with its + INCONCLUSIVE verdict and stated configuration boundary. +- Results that only apply to one specific configuration with no plausible + generalization, unless they are scoped diagnostic observations that state + their configuration boundary. +- Results without a real measurement evidence trail. + +## Maintaining the casebook + +The casebook is only valuable if it stays accurate. When a case's conditions +no longer hold (hardware generation changed, the op was fused away, the +optimization was upstreamed), mark the case as deprecated with the reason. +Do not delete deprecated cases — they remain as negative evidence for future +searches. + +## Starting a casebook for a new system + +For a new inference system (e.g., a new NPU inference engine), bootstrap the +casebook from: +1. Existing profiling evidence in the repository (`evidence/` tree). +2. Known bottleneck patterns from vendor documentation. +3. Cross-system cases from TRT-LLM, vLLM, SGLang that have plausible NPU analogs + (re-verify the mechanism holds on the target hardware before including). + +Mark each bootstrapped case's evidence as `source_grounded` or `author_reported` +until a local measurement confirms or refutes it. diff --git a/src/inferrsi/knowledge/atoms/inference-optimization-casebook.original.json b/src/inferrsi/knowledge/atoms/inference-optimization-casebook.original.json new file mode 100644 index 000000000..878fc38a1 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/inference-optimization-casebook.original.json @@ -0,0 +1,103 @@ +{ + "authority": "checkout", + "metadata": { + "id": "inference-optimization-casebook.original", + "kind": "knowledge", + "entrypoint": "guide.md", + "title": "How to structure and use a casebook of past optimization decisions as a decision-support tool. Extracts the casebook pattern from TensorRT-LLM's perf-optimization-casebook skill. Use when building a record of optimization experiments or when deciding which optimization to try next based on prior art.\n", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/SKILL.md", + "sha256": "cec75f3a721dd13e6913b597d5373833a14c39d9048951a30c4864dd2c49aac8" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Structuring and querying a casebook of past optimization decisions as decision support, when recording optimization experiments or choosing the next optimization from prior art; the casebook is reference material and neither runs profiling nor makes decisions", + "prerequisites": "Whole-body text access to the case files for free-text search; applying a case first requires reading the nearest checked-in config and the model's deployment guide", + "input_contract": "For a query: natural search terms such as model name, knob, mechanism word or deployment feature, plus the current model and hardware. For a new case: mechanism, applies-when and does-not-apply conditions, procedure, expected effect, accuracy risk, verification, rollback and a real measurement trail with run ID, verdict, exact hardware SKU, model revision, workload and before/after result", + "produced_artifact": "Ranked matching cases read as precedents and diagnostic options, or a new or deprecated case record in the template; a precedent's procedure and expected direction of effect, not a guaranteed configuration or a measured result", + "failure_modes": [ + "The query is pre-translated into canonical vocabulary or bounded by structured fields, so synonyms in the body text are missed", + "A case's specific values, such as batch size, tensor-parallel degree or kernel parameters, are copied instead of re-derived for the current model and hardware", + "The precedent's expected direction of effect stands in for measurement after the change is applied", + "A rejected direction is read as a permanent blacklist, or one discarded implementation as ruling out its mechanism", + "A confounded run, a missing experiment and a failed gate are recorded as the same evidence state", + "Cross-system cases are bootstrapped without re-verifying that the mechanism holds on the target hardware" + ], + "refusal_point": "Adds no case for an INCONCLUSIVE optimization-effect claim, a single-configuration result without plausible generalization, or a result without a real measurement trail, except a scoped diagnostic observation that keeps its verdict and configuration boundary; manufactures no PASS, and reading the records does not reopen a paused campaign" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Original typed source inventory is not normalized; retain source identities and limits in the procedure/readsets.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/SKILL.md", + "byte_range": [ + 0, + 10247 + ], + "sha256": "cec75f3a721dd13e6913b597d5373833a14c39d9048951a30c4864dd2c49aac8" + } + } + }, + "content": { + "guide.md": { + "path": "casebooks/inference-optimization-casebook.md" + } + }, + "parts": { + "navigation": { + "skill_section": "navigation", + "layer": "L0", + "byte_range": [ + 0, + 364 + ], + "sha256": "d7a39ada4c606e49658bcb344137e712b3c04106cd927edfca56e6547979c944" + }, + "decision": { + "skill_section": "decision", + "layer": "L1", + "byte_range": [ + 0, + 3971 + ], + "sha256": "1304cde8819482a692d848e0bdf14d3c54c901eaed18da0fb90662c9f25c1a05" + }, + "procedure": { + "skill_section": "procedure", + "layer": "L2", + "byte_range": [ + 3971, + 10247 + ], + "sha256": "94211469060abc682da0ce190c47a9f387489671126342a08112fd616407c207" + } + } +} diff --git a/src/inferrsi/knowledge/compositions/ascend-optimization-casebook.json b/src/inferrsi/knowledge/compositions/ascend-optimization-casebook.json new file mode 100644 index 000000000..e48ea6491 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/ascend-optimization-casebook.json @@ -0,0 +1,107 @@ +{ + "authority": "checkout", + "metadata": { + "id": "ascend-optimization-casebook", + "kind": "skill", + "entrypoint": "casebooks/ascend/ascend-optimization-casebook/SKILL.md", + "title": "Casebook of NPU optimization cases for Ascend inference systems: symptom → diagnosis → action → evidence records for memory-bound, compute-bound, communication-exposed, graph-compilation, and AI-CPU-fallback bottleneck classes. Use when a bottleneck has been classified and you need prior art for what to try next. Complement to inference-optimization-casebook (which covers the casebook *pattern*; this carries the actual NPU cases).\n", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/ascend/ascend-optimization-casebook/SKILL.md", + "sha256": "b1ffddd0784743840606c151e7cf23f6eb5466e90f93f6d91214fded73c0be4a" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Find source-derived prior cases for an already classified Ascend inference bottleneck, including fallback, memory traffic, exposed communication, graph startup and host scheduling gaps.", + "prerequisites": "A bottleneck classification from profiling and a check of the selected case preconditions/mechanism before applying it.", + "input_contract": "Bottleneck symptoms and matching profiler evidence, model/hardware/CANN/configuration context and, for a new case, measured before/after metrics.", + "produced_artifact": "A matching prior-art case and evidence requirements for a later measured application; a new case record requires a verified win or clear failure with a metric comparison.", + "refusal_point": "Do not add an INCONCLUSIVE case or one without a measured metric comparison; a subjective direction is insufficient evidence." + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Original typed source inventory is not normalized; retain source identities and limits in the procedure/readsets.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "required_resources": [ + "casebooks/ascend/ascend-optimization-casebook/SKILL.md" + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "checkout:ascend-optimization-casebook.original.navigation", + "revision": "sha256:6d24d9c38c2adffd33c93f5118eae2f94abf436217b587fa29b9994aa7fc5051" + }, + "decision": { + "ref": "checkout:ascend-optimization-casebook.original.decision", + "revision": "sha256:c5857a8c9d43981fd3ebcae3c1016b3773acb7b7f73e98ec985247c218f054fd" + }, + "procedure": { + "ref": "checkout:ascend-optimization-casebook.original.procedure", + "revision": "sha256:26d7227a10243ef3a924ad7ebb95e916ad3cdf2bd1fe5a65bfbed7eb0cda41d7", + "requires": [ + "decision" + ] + }, + "original": { + "ref": "checkout:ascend-optimization-casebook.original", + "revision": "sha256:b65b38493d60535d7329a37e293ccb37b58f657a6dd48141b3c38439c6185432" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "decision" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure" + ] + }, + "originals": { + "layer": "L3", + "required": [ + "original" + ] + } + }, + "skill": { + "directory_entry": true + } + } + }, + "directory_resources": { + "casebooks/ascend/ascend-optimization-casebook/SKILL.md": "original" + } +} diff --git a/src/inferrsi/knowledge/compositions/inference-optimization-casebook.json b/src/inferrsi/knowledge/compositions/inference-optimization-casebook.json new file mode 100644 index 000000000..89697019b --- /dev/null +++ b/src/inferrsi/knowledge/compositions/inference-optimization-casebook.json @@ -0,0 +1,171 @@ +{ + "authority": "checkout", + "metadata": { + "id": "inference-optimization-casebook", + "kind": "skill", + "entrypoint": "casebooks/inference/inference-optimization-casebook/SKILL.md", + "title": "How to structure and use a casebook of past optimization decisions as a decision-support tool. Extracts the casebook pattern from TensorRT-LLM's perf-optimization-casebook skill. Use when building a record of optimization experiments or when deciding which optimization to try next based on prior art.\n", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/casebooks/inference/inference-optimization-casebook/SKILL.md", + "sha256": "cec75f3a721dd13e6913b597d5373833a14c39d9048951a30c4864dd2c49aac8" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Structuring and querying a casebook of past optimization decisions as decision support, when recording optimization experiments or choosing the next optimization from prior art; the casebook is reference material and neither runs profiling nor makes decisions", + "prerequisites": "Whole-body text access to the case files for free-text search; applying a case first requires reading the nearest checked-in config and the model's deployment guide", + "input_contract": "For a query: natural search terms such as model name, knob, mechanism word or deployment feature, plus the current model and hardware. For a new case: mechanism, applies-when and does-not-apply conditions, procedure, expected effect, accuracy risk, verification, rollback and a real measurement trail with run ID, verdict, exact hardware SKU, model revision, workload and before/after result", + "produced_artifact": "Ranked matching cases read as precedents and diagnostic options, or a new or deprecated case record in the template; a precedent's procedure and expected direction of effect, not a guaranteed configuration or a measured result", + "failure_modes": [ + "The query is pre-translated into canonical vocabulary or bounded by structured fields, so synonyms in the body text are missed", + "A case's specific values, such as batch size, tensor-parallel degree or kernel parameters, are copied instead of re-derived for the current model and hardware", + "The precedent's expected direction of effect stands in for measurement after the change is applied", + "A rejected direction is read as a permanent blacklist, or one discarded implementation as ruling out its mechanism", + "A confounded run, a missing experiment and a failed gate are recorded as the same evidence state", + "Cross-system cases are bootstrapped without re-verifying that the mechanism holds on the target hardware" + ], + "refusal_point": "Adds no case for an INCONCLUSIVE optimization-effect claim, a single-configuration result without plausible generalization, or a result without a real measurement trail, except a scoped diagnostic observation that keeps its verdict and configuration boundary; manufactures no PASS, and reading the records does not reopen a paused campaign" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Original typed source inventory is not normalized; retain source identities and limits in the procedure/readsets.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "required_resources": [ + "casebooks/inference/inference-optimization-casebook/SKILL.md", + "casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.json", + "casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.md", + "casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.json", + "casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.md", + "casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.json", + "casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.md", + "casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.json", + "casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.md" + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "checkout:inference-optimization-casebook.original.navigation", + "revision": "sha256:4a810d5c9c647238c6874375c9ce4d851e6b8b92b95a5afd0d8bc4fd2f6bd355" + }, + "decision": { + "ref": "checkout:inference-optimization-casebook.original.decision", + "revision": "sha256:240498b8f7acd30901366329dd6b5b76a13b85c1b3a0cdc9cbfce27eb478d184" + }, + "procedure": { + "ref": "checkout:inference-optimization-casebook.original.procedure", + "revision": "sha256:e7a4a79adaaabe3554901872255f482f21d631100444c77e6131b941365143ae", + "requires": [ + "decision" + ] + }, + "original": { + "ref": "checkout:inference-optimization-casebook.original", + "revision": "sha256:f2251674f515ae4c62eb23493f600f699df00893ada134579da18e21ec34c7f7" + }, + "admission-drain-occupancy-original": { + "ref": "checkout:case.admission-drain-occupancy.original", + "revision": "sha256:2b53c58c066e63a9b86c71be3c0306b6fd3097a3ef0d2baad634d080363893d5" + }, + "admission-drain-occupancy-guide": { + "ref": "checkout:case.admission-drain-occupancy.guide", + "revision": "sha256:e44d3cf8be60a00fd4878283026d001f3b4008639494d2d916ee61d36f89deaa" + }, + "drama3-rejected-directions-original": { + "ref": "checkout:case.drama3-rejected-directions.original", + "revision": "sha256:a1ce299b00d6a0ceef621d1273d525d8ed6a2f3bb7d39b2abb2be4c8ca95bdc3" + }, + "drama3-rejected-directions-guide": { + "ref": "checkout:case.drama3-rejected-directions.guide", + "revision": "sha256:891e949998aebd588e74336d108d520cc43bc8741b7142dc6d161a254779ee72" + }, + "qwen-ascend-rejected-directions-original": { + "ref": "checkout:case.qwen-ascend-rejected-directions.original", + "revision": "sha256:5d73751d8affa1e9e90c064a17dc1d278acde79e607bf627f9e1d12a6306750c" + }, + "qwen-ascend-rejected-directions-guide": { + "ref": "checkout:case.qwen-ascend-rejected-directions.guide", + "revision": "sha256:c6c9d593fa1a2494a8a9c473dda926af563f868afd22e3e99c254f31a170f282" + }, + "qwen-b300-rejected-directions-original": { + "ref": "checkout:case.qwen-b300-rejected-directions.original", + "revision": "sha256:f9118c7f4ba8d539ff87cc4f9cf1890aa250ad20625ed5a79fecd81d155d388a" + }, + "qwen-b300-rejected-directions-guide": { + "ref": "checkout:case.qwen-b300-rejected-directions.guide", + "revision": "sha256:744854a77597c27600f368da02e7098d1a55b402a1abcfe04afc2c9be2a6a528" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "decision" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure" + ] + }, + "originals": { + "layer": "L3", + "required": [ + "original", + "admission-drain-occupancy-original", + "admission-drain-occupancy-guide", + "drama3-rejected-directions-original", + "drama3-rejected-directions-guide", + "qwen-ascend-rejected-directions-original", + "qwen-ascend-rejected-directions-guide", + "qwen-b300-rejected-directions-original", + "qwen-b300-rejected-directions-guide" + ] + } + }, + "skill": { + "directory_entry": true + } + } + }, + "directory_resources": { + "casebooks/inference/inference-optimization-casebook/SKILL.md": "original", + "casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.json": "admission-drain-occupancy-original", + "casebooks/inference/inference-optimization-casebook/cases/admission-drain-occupancy.md": "admission-drain-occupancy-guide", + "casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.json": "drama3-rejected-directions-original", + "casebooks/inference/inference-optimization-casebook/cases/drama3-rejected-directions.md": "drama3-rejected-directions-guide", + "casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.json": "qwen-ascend-rejected-directions-original", + "casebooks/inference/inference-optimization-casebook/cases/qwen-ascend-rejected-directions.md": "qwen-ascend-rejected-directions-guide", + "casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.json": "qwen-b300-rejected-directions-original", + "casebooks/inference/inference-optimization-casebook/cases/qwen-b300-rejected-directions.md": "qwen-b300-rejected-directions-guide" + } +} diff --git a/tests/knowledge/test_atomic_casebook_entries.py b/tests/knowledge/test_atomic_casebook_entries.py index 08ff9a757..2d998e829 100644 --- a/tests/knowledge/test_atomic_casebook_entries.py +++ b/tests/knowledge/test_atomic_casebook_entries.py @@ -1,14 +1,32 @@ """Compare both Casebook guides against the decisions observed from the released wheel.""" +import json +import shutil +from pathlib import PurePosixPath from zipfile import ZipFile import pytest +from inferrsi.knowledge.atomic_build import build_generation +from inferrsi.knowledge.atomic_generation import InstalledGeneration from inferrsi.knowledge.catalog import _skill_search_source from inferrsi.knowledge.decision_cards import DecisionSource -from tests.knowledge.test_atomic_casebooks import BASELINE, FIXTURES, canonical, digest +from tests.knowledge.test_atomic_casebooks import ( + ATOMS, + BASELINE, + FIXTURES, + RELEASE_COMMIT, + assert_empty, + canonical, + case_sources, + digest, + select, +) +from tests.knowledge.test_atomic_generation import write_json +from tests.knowledge.test_atomic_reader import allow GUIDES = {ref: row for ref, row in BASELINE["refs"].items() if "decision" in row} +DIRECTORIES = sorted(ref for ref in GUIDES if ref.startswith("checkout:")) @pytest.mark.parametrize("ref", sorted(GUIDES)) @@ -37,3 +55,156 @@ def test_released_guide_reproduces_each_namespaced_decision(ref): assert card["missing_fields"] == expected["missing_fields"] == ["validation"] short = source.project(max_bytes=budget - 1) assert short["status"] == "over_budget" and "card" not in short + + +@pytest.fixture(scope="module") +def casebook_files(): + with ZipFile(FIXTURES / "casebook-sources-v0.3.4.zip") as archive: + return {name: archive.read(name) for name in archive.namelist()} + + +def directory_sources(root, files): + author, release = case_sources(root, files) + for ref in DIRECTORIES: + name = ref.partition(":")[2] + for directory, filename in (("atoms", f"{name}.original.json"), + ("compositions", f"{name}.json")): + shutil.copyfile(ATOMS.parent / directory / filename, author / directory / filename) + return author, release + + +@pytest.fixture(scope="module") +def installed_directories(tmp_path_factory, casebook_files): + root = tmp_path_factory.mktemp("casebook-entries") + author, release = directory_sources(root, casebook_files) + target = root / "installed" + generation = build_generation(author, target, permits=allow, + source_roots={RELEASE_COMMIT: release}) + return InstalledGeneration(target, expected=generation), target + + +@pytest.mark.parametrize("ref", DIRECTORIES) +def test_directory_replays_all_resources_and_exports_the_original_host_tree( + installed_directories, casebook_files, ref, +): + row = GUIDES[ref] + entry = PurePosixPath(row["legacy_entrypoint"]) + released = {path: raw for path, raw in casebook_files.items() + if PurePosixPath(path).is_relative_to(entry.parent)} + installed, target = installed_directories + _, bundle = installed.read_resolved(ref, revision=installed.catalog[ref]["revision"]) + assert not bundle.dependencies and bundle.content == released + assert len(released) == row["resource_count"] == row["required_count"] + assert bundle.metadata["required_resources"] == sorted(released) + assert digest(canonical(bundle.view()["resources"])) == row["resource_set_sha256"] + assert bundle.metadata["origin"] == ["external"] + assert bundle.metadata["state"] == "candidate" + assert bundle.metadata["empirical_validation"] == "not_run" + assert installed.skills[entry.parent.name] == ref + host = target / "skills" / entry.parent.name + assert {path.relative_to(host).as_posix(): path.read_bytes() + for path in host.rglob("*") if path.is_file()} == { + PurePosixPath(path).relative_to(entry.parent).as_posix(): raw + for path, raw in released.items() + } + + +@pytest.mark.parametrize("ref", DIRECTORIES) +def test_directory_read_selection_replays_each_layer_and_refuses_incomplete_groups( + installed_directories, casebook_files, ref, +): + row = GUIDES[ref] + installed, _ = installed_directories + guide = row["entry_source"] + raw = casebook_files[guide] + result = {} + for layer in ("L0", "L1", "L2", "L3"): + delivery = select(installed, ref, layer, 1_000_000) + assert delivery.receipt["status"] == "delivered" + result[layer] = delivery + size = sum(map(len, delivery.bodies)) + assert delivery.receipt["body_bytes"] == size and size > 0 + assert select(installed, ref, layer, size) == delivery + short = select(installed, ref, layer, size - 1) + assert_empty(short, "over_budget") + assert short.receipt["required_bytes"] == size + for item, body in zip(delivery.receipt["delivered"], delivery.bodies, strict=True): + lo, hi = item["source_byte_range"] + path = item["source_path"].split("/skill_library/", 1)[1] + assert item["source"]["commit"] == RELEASE_COMMIT + assert item["source_range_verification"] == "verified_at_build" + assert casebook_files[path][lo:hi] == body and item["source_sha256"] == digest(body) + forbidden = item["ref"] + denied = select(installed, ref, layer, size, + permits=lambda pin, op: pin.ref != forbidden) + assert_empty(denied, "permission_denied") + stale = select(installed, ref, layer, size, revision=row["revision"]) + assert_empty(stale, "unavailable_revision") + assert_empty(select(installed, ref, layer, size, permits=lambda pin, op: pin.ref != ref), + "permission_denied") + (navigation,) = result["L0"].bodies + assert ref.partition(":")[2].encode() in navigation and b"description:" in navigation + assert b"metadata:" not in navigation and raw.startswith(navigation) + (decision,) = result["L1"].bodies + _, fields = _skill_search_source(decision.decode()) + card = DecisionSource(ref, row["revision"], "skill", guide, guide, fields).project()["card"] + expected = row["decision"] + assert len(canonical(card)) == expected["card_bytes"] + assert digest(canonical(card)) == expected["card_sha256"] + assert card["missing_fields"] == ["validation"] and card["status"] == "partial" + assert result["L2"].bodies[0] == decision and b"".join(result["L2"].bodies) == raw + assert result["L3"].bodies == tuple( + casebook_files[name] for name in sorted(casebook_files) + if PurePosixPath(name).parent.is_relative_to(PurePosixPath(guide).parent) + ) + + +@pytest.mark.parametrize(("change", "error"), [ + ("dropped file and declaration", "complete original directory"), + ("wrong alias", "original relative source"), ("excerpt", "complete L3 original"), + ("missing L3 attachment", "L3 must deliver"), ("omitted prerequisite", "L2 must deliver"), + ("another guide decision", "L1 must deliver"), ("wrong section", "source range or layer"), + ("conditional override", "unconditional delivery"), + ("unbound host export", "requires checked"), ("identity", "original SKILL.md and identity"), +]) +def test_cannot_publish_a_partial_or_misbound_directory(tmp_path, casebook_files, change, error): + author, release = directory_sources(tmp_path, casebook_files) + ref = "checkout:inference-optimization-casebook" + name = ref.partition(":")[2] + path = author / "compositions" / (name + ".json") + spec = json.loads(path.read_bytes()) + declaration = spec["metadata"]["composition"] + bindings = spec["directory_resources"] + attachment = next(key for key in bindings if key.endswith(".json")) + if change == "dropped file and declaration": + del bindings[attachment] + spec["metadata"]["required_resources"].remove(attachment) + elif change == "wrong alias": + bindings[attachment] = bindings[attachment.removesuffix(".json") + ".md"] + elif change == "excerpt": + bindings[attachment] = "navigation" + elif change == "missing L3 attachment": + declaration["routes"]["originals"]["required"].remove(bindings[attachment]) + elif change == "omitted prerequisite": + del declaration["nodes"]["procedure"]["requires"] + elif change == "another guide decision": + other = json.loads((path.parent / "ascend-optimization-casebook.json").read_bytes()) + declaration["nodes"]["decision"] = other["metadata"]["composition"]["nodes"]["decision"] + elif change == "conditional override": + declaration["routes"]["alternate"] = { + "layer": "L1", "when": {"backend": ["cpu"]}, "supersedes": ["decision"], + "required": ["navigation"], + } + elif change == "wrong section": + path = author / "atoms" / (name + ".original.json") + spec = json.loads(path.read_bytes()) + spec["parts"]["procedure"]["skill_section"] = "decision" + elif change == "unbound host export": + del spec["directory_resources"] + else: + spec["metadata"]["id"] = "another-directory" + write_json(path, spec) + with pytest.raises(ValueError, match=error): + build_generation(author, tmp_path / "installed", permits=allow, + source_roots={RELEASE_COMMIT: release}) + assert not (tmp_path / "installed").exists() From ed48d04d1fe8d396cc97feb064cc64013fa76f56 Mon Sep 17 00:00:00 2001 From: Dong1017 <55723162+Dong1017@users.noreply.github.com> Date: Fri, 27 Nov 2026 04:04:15 +0800 Subject: [PATCH 08/12] Freeze the released Workflow references, resources and decision cards Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com> --- .../atomic-reader/workflow-domain-v0.3.4.json | 718 ++++++++++++++++++ 1 file changed, 718 insertions(+) create mode 100644 tests/fixtures/atomic-reader/workflow-domain-v0.3.4.json diff --git a/tests/fixtures/atomic-reader/workflow-domain-v0.3.4.json b/tests/fixtures/atomic-reader/workflow-domain-v0.3.4.json new file mode 100644 index 000000000..219c19a38 --- /dev/null +++ b/tests/fixtures/atomic-reader/workflow-domain-v0.3.4.json @@ -0,0 +1,718 @@ +{ + "files": { + "workflows/governance/cite-check-downstream-pr/SKILL.md": { + "bytes": 3534, + "sha256": "68ff74b48de1607297aa35e2e8b2eaea12674d938f8c8167b93e55b1044ba858" + }, + "workflows/governance/claim-contract/SKILL.md": { + "bytes": 3223, + "sha256": "49cf787427e7842fc0b8cbc1e58091fc4b77a5a48c0cb8fb7aaecd91f8715670" + }, + "workflows/governance/draft-acceptance-issue/SKILL.md": { + "bytes": 4373, + "sha256": "2c14533c067c51b9763f80a9df0bf5eb5acd398f4265790c57039fed96d4c497" + }, + "workflows/governance/rsi-evidence/SKILL.md": { + "bytes": 8927, + "sha256": "5edd2bd544da050d2688f37c85ae6e7927eaee24af764e3c96b6cec04982990a" + }, + "workflows/governance/rsi-evidence/references/loopx-goal-governance/LICENSE": { + "bytes": 11358, + "sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30" + }, + "workflows/governance/rsi-evidence/references/loopx-goal-governance/LICENSE-MIT.md": { + "bytes": 1075, + "sha256": "1df1cf519b9e5d8acbbc72820299d7aa95afa1acbfc1f43a15109ad1d59975f3" + }, + "workflows/governance/rsi-evidence/references/loopx-goal-governance/NOTICE.md": { + "bytes": 308, + "sha256": "3c3c36a40e1d65f3a6b20ec3a97319cb753e857f1d120f302cd828e107120f6d" + }, + "workflows/governance/rsi-evidence/references/loopx-goal-governance/README.md": { + "bytes": 4701, + "sha256": "c86eb179cea1b42f346f5c1dc076292ba086be907f20b0beee45c43cf0f8d6fe" + }, + "workflows/governance/rsi-evidence/references/loopx-goal-governance/decision-cases.md": { + "bytes": 7035, + "sha256": "c2c1d3d75c4fcb515dd36ff84d8dc940c25d54c5757a29a80d1af88eb8b66115" + }, + "workflows/governance/rsi-evidence/references/loopx-goal-governance/mechanisms.md": { + "bytes": 16696, + "sha256": "4fa09099d362a8088fdb0e6a767f72aae6218b92fe5fd75b6fb78c2bb2a318fb" + }, + "workflows/governance/rsi-evidence/references/loopx-goal-governance/source-ledger.json": { + "bytes": 20966, + "sha256": "4a0f1f02134af5b7d54a1f13e104b8066372d3d4a1a4a9e717514632fff05893" + }, + "workflows/governance/rsi-evidence/references/omni-experiments.md": { + "bytes": 5380, + "sha256": "8fafc1e05ef21ab60158fc626c73ca1b8c615ada59f90fd23199496daa46ac48" + }, + "workflows/maintenance/npu-skill-factory/SKILL.md": { + "bytes": 11624, + "sha256": "0de28180da76b6cb9d2c9456733011d00d9801f7662afd32959c4c5d2c05a183" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/COMPARISON.md": { + "bytes": 4267, + "sha256": "38587678a96581f5c2dc697d982127343565504bffa191352811dffcc165aa23" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/INTEGRATION_NOTES.md": { + "bytes": 5557, + "sha256": "fbc4a96b6f6c477706eed83eaa4fcc29a14f881637629d6c004601ed049f2523" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/QA.md": { + "bytes": 1853, + "sha256": "3f3785ec39a6938a5d1f2e874e99153fe92c0e666dd3e78a499c8b47d891346a" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/README.md": { + "bytes": 2151, + "sha256": "221785e91c45588f82b3caab6d52f1ea1d102b16139c20a0802921e2789e6d28" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/UNREAD_LEADS.md": { + "bytes": 1038, + "sha256": "6c1d87ebe491d27666703149eb05ad582c7e5aff77f0ac5c11a7b89c946f96ee" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md": { + "bytes": 5213, + "sha256": "f9fc21753ea41eef77ca020d78d031e945e5dd835b5d09c5ff0e53749ceb2ca4" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/knowledge/evidence-routing.md": { + "bytes": 5282, + "sha256": "406d5d74c3fef4c1a23d495492e21a084c3c46495a1a84b385703ed104358874" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md": { + "bytes": 2847, + "sha256": "9c2d1d738e896d05c00f53e6adf14c9df2501ecc3f0020e71b5a1c2192547086" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/protocol-details.md": { + "bytes": 6520, + "sha256": "41298c6bde3a28f0712fa06a18bbc4ac59aea6d17cc9eb1318744f4121e3bab6" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/readset.md": { + "bytes": 7086, + "sha256": "6f953d20d8958c68339c9ceeae348604d0fea3e9c6ccb9b64a63d3b210426a22" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/repo-to-skill.md": { + "bytes": 3151, + "sha256": "5ebdac2a2bbbe6614f9d4096bc9895bd685acdf76414e2c3c1fb7b50d57c738d" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/skillopt.md": { + "bytes": 3040, + "sha256": "148075daa67e19f4b4351710498438d17c279a9bce56b2d01cab26ff3be33e99" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/source-manifest.json": { + "bytes": 2431, + "sha256": "716cd49ed01824ee9f6b6fc55ebf2b24fdd5d5a3e677f6e28e34a472616bbe25" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/trace2skill.md": { + "bytes": 2917, + "sha256": "230d13b77ba819b5e3edee147523e8cad6bfce95afccc140fb4946d6c8747a2e" + }, + "workflows/maintenance/npu-skill-factory/references/papers-20261015/updates/bounded-updates.md": { + "bytes": 7695, + "sha256": "529c363e9c678f33f7c0be0420d26c64d056321f041726362dba69e53e1e375e" + }, + "workflows/maintenance/npu-skill-factory/references/skill-factory-design-20261014.md": { + "bytes": 9435, + "sha256": "0b2e05bb6a4a3b3f6df0b04abc40ec125be60714b87f609a390246ee2a292d2d" + }, + "workflows/maintenance/skill-evolution-playbook/SKILL.md": { + "bytes": 13082, + "sha256": "f988a0569be93fec550da52484d22d970b0a6c31394ea463ad6ee40e0877ede6" + }, + "workflows/research/competitor-scan/SKILL.md": { + "bytes": 3266, + "sha256": "7f2613a1fc8e9fc58c3058c4946b85e8d7d49359143d650f711b88b448307ab6" + }, + "workflows/research/inference-engine-research/SKILL.md": { + "bytes": 5755, + "sha256": "a94102df1790f51d673f2dfe4b047fa6a70b2ead2a12b1a73393ea3765984b6a" + }, + "workflows/research/inference-engine-research/references/cross-repository-mechanisms.md": { + "bytes": 17214, + "sha256": "8eb1b8dd4807cf06df9f6fb1bf88aff9ad6112c408e377631ceada32bc56307a" + }, + "workflows/research/inference-engine-research/references/import.md": { + "bytes": 3463, + "sha256": "c8a57db94768cc6cd4193932def75ba67ec453e56ee0e54f176fb82f1af53091" + }, + "workflows/research/inference-engine-research/references/model-aware-preparation.md": { + "bytes": 9057, + "sha256": "1b117e8f3a35c25dbffc4f7d43bcef1410b2b3f51e98d53933ef3348fb3b070d" + }, + "workflows/research/inference-engine-research/references/overview.md": { + "bytes": 8153, + "sha256": "4e39954ec5cc7ebfe5de1b1041762f75c5c3d381265e3711fd43ee2a7ac3d688" + }, + "workflows/research/inference-engine-research/references/repository-source-scope.md": { + "bytes": 12049, + "sha256": "918e8358b7ef6caa2eb0dea56438c117f0737688d49d06d288ef5bd0cf668b2b" + }, + "workflows/research/inference-engine-research/references/source-manifest.json": { + "bytes": 1613, + "sha256": "0ce1678803d1ede6b485fb6b4b1c88aba909056ee6e3b5af691899ceb2056240" + }, + "workflows/research/repository-evolution-analysis/SKILL.md": { + "bytes": 22892, + "sha256": "0f48cc6a77b3ac861af698048be7c250c3ef5c225dc238b9a0e6d71208cbd93e" + }, + "workflows/research/repository-evolution-analysis/references/capability-presence-audit.md": { + "bytes": 11461, + "sha256": "c21eb4a6aabe811a49a6540a34c54dbcfdcf7efae3052a79b54034c7838026a5" + }, + "workflows/research/repository-evolution-analysis/references/rtk-consumer-path-transition.md": { + "bytes": 13701, + "sha256": "a70b1d128fb5e0ac12292a290d624f218a0831d7581fe8980b62661473e0f2b7" + } + }, + "refs": { + "checkout:cite-check-downstream-pr": { + "atom": { + "kind": "skill", + "resource": "workflows/governance/cite-check-downstream-pr/SKILL.md" + }, + "card_bytes": 4313, + "card_sha256": "751e5d330d748fec767f93830031742604b2561219e4f2f829a0164455b105ae", + "dependencies": {}, + "entry_sha256": "68ff74b48de1607297aa35e2e8b2eaea12674d938f8c8167b93e55b1044ba858", + "entry_source": "workflows/governance/cite-check-downstream-pr/SKILL.md", + "entrypoint": "workflows/governance/cite-check-downstream-pr/SKILL.md", + "guide": "workflows/governance/cite-check-downstream-pr/SKILL.md", + "guide_sha256": "68ff74b48de1607297aa35e2e8b2eaea12674d938f8c8167b93e55b1044ba858", + "kind": "skill", + "missing_fields": [ + "validation" + ], + "relative_guide_links": {}, + "required_count": 1, + "required_resources": { + "workflows/governance/cite-check-downstream-pr/SKILL.md": "68ff74b48de1607297aa35e2e8b2eaea12674d938f8c8167b93e55b1044ba858" + }, + "resource_set": "b5aba57aada8d7639d17963d99845dbb1e67706ed7f91303ef72fa4f106710a7", + "revision": "sha256:61b89c41a00b0f44cde7f933774411c3b85ab9871ef7242456f5cfc04a041cfd", + "status": "partial" + }, + "checkout:claim-contract": { + "atom": { + "kind": "skill", + "resource": "workflows/governance/claim-contract/SKILL.md" + }, + "card_bytes": 4141, + "card_sha256": "7dbff3fb6af82a03416ab65c375f3ecd332e6c91dbca39d42706611fa13ff98c", + "dependencies": {}, + "entry_sha256": "49cf787427e7842fc0b8cbc1e58091fc4b77a5a48c0cb8fb7aaecd91f8715670", + "entry_source": "workflows/governance/claim-contract/SKILL.md", + "entrypoint": "workflows/governance/claim-contract/SKILL.md", + "guide": "workflows/governance/claim-contract/SKILL.md", + "guide_sha256": "49cf787427e7842fc0b8cbc1e58091fc4b77a5a48c0cb8fb7aaecd91f8715670", + "kind": "skill", + "missing_fields": [ + "validation" + ], + "relative_guide_links": {}, + "required_count": 1, + "required_resources": { + "workflows/governance/claim-contract/SKILL.md": "49cf787427e7842fc0b8cbc1e58091fc4b77a5a48c0cb8fb7aaecd91f8715670" + }, + "resource_set": "0ecff74d30b4ec48f040ec680ee186b33832564153c501a75bbf8861a84e9e4d", + "revision": "sha256:8744eb3d57e51d4f42cc22f63086d27e6dc636676630391ad1a52bb72da516bb", + "status": "partial" + }, + "checkout:competitor-scan": { + "atom": { + "kind": "skill", + "resource": "workflows/research/competitor-scan/SKILL.md" + }, + "card_bytes": 3611, + "card_sha256": "e48bcab903640e015c8033d471c3f38337f740f6a5c5c9fe46068de4036cc93d", + "dependencies": {}, + "entry_sha256": "7f2613a1fc8e9fc58c3058c4946b85e8d7d49359143d650f711b88b448307ab6", + "entry_source": "workflows/research/competitor-scan/SKILL.md", + "entrypoint": "workflows/research/competitor-scan/SKILL.md", + "guide": "workflows/research/competitor-scan/SKILL.md", + "guide_sha256": "7f2613a1fc8e9fc58c3058c4946b85e8d7d49359143d650f711b88b448307ab6", + "kind": "skill", + "missing_fields": [ + "validation" + ], + "relative_guide_links": {}, + "required_count": 1, + "required_resources": { + "workflows/research/competitor-scan/SKILL.md": "7f2613a1fc8e9fc58c3058c4946b85e8d7d49359143d650f711b88b448307ab6" + }, + "resource_set": "8cb6cb9061a192bb24e30dc2b83ecccf9184e32f9ea0fe47a0e6cea4cf945c41", + "revision": "sha256:ef21805d22a24ea0d4e0e4ff7e8fb63849905a1db14d16872aacc92d3d4ad8fa", + "status": "partial" + }, + "checkout:draft-acceptance-issue": { + "atom": { + "kind": "skill", + "resource": "workflows/governance/draft-acceptance-issue/SKILL.md" + }, + "card_bytes": 4631, + "card_sha256": "d0e6e4598621b401628a16d808f9e1c4e19f4f2a10704a0cc523c02bf751fb95", + "dependencies": {}, + "entry_sha256": "2c14533c067c51b9763f80a9df0bf5eb5acd398f4265790c57039fed96d4c497", + "entry_source": "workflows/governance/draft-acceptance-issue/SKILL.md", + "entrypoint": "workflows/governance/draft-acceptance-issue/SKILL.md", + "guide": "workflows/governance/draft-acceptance-issue/SKILL.md", + "guide_sha256": "2c14533c067c51b9763f80a9df0bf5eb5acd398f4265790c57039fed96d4c497", + "kind": "skill", + "missing_fields": [ + "validation" + ], + "relative_guide_links": { + "../../../playbooks/measurement/performance-ceiling-analysis/references/acceptance-criteria.md": { + "in_directory": false, + "owner": "playbooks", + "path": "playbooks/measurement/performance-ceiling-analysis/references/acceptance-criteria.md", + "sha256": "e96efc42005af591a87b57dd6f1e9bffa8e351bcd023bd093ac37239a0486638" + } + }, + "required_count": 1, + "required_resources": { + "workflows/governance/draft-acceptance-issue/SKILL.md": "2c14533c067c51b9763f80a9df0bf5eb5acd398f4265790c57039fed96d4c497" + }, + "resource_set": "1c55b8b313e4ff72eedd01443b7a6be2338ab08c95ab339abcd9771b15f1ff1b", + "revision": "sha256:5c15057d1322f9eefeaba649772679e9736191e9984fc77528aeeaf278637ee3", + "status": "partial" + }, + "checkout:npu-skill-factory": { + "atom": { + "kind": "skill", + "resource": "workflows/maintenance/npu-skill-factory/SKILL.md" + }, + "card_bytes": 6028, + "card_sha256": "b8fff644b6f21ac542eb9e727bec630bad0acf1fb2f7e908a52f4ba43f8cfc0c", + "dependencies": {}, + "entry_sha256": "0de28180da76b6cb9d2c9456733011d00d9801f7662afd32959c4c5d2c05a183", + "entry_source": "workflows/maintenance/npu-skill-factory/SKILL.md", + "entrypoint": "workflows/maintenance/npu-skill-factory/SKILL.md", + "guide": "workflows/maintenance/npu-skill-factory/SKILL.md", + "guide_sha256": "0de28180da76b6cb9d2c9456733011d00d9801f7662afd32959c4c5d2c05a183", + "kind": "skill", + "missing_fields": [ + "validation" + ], + "relative_guide_links": { + "references/papers-20261015/COMPARISON.md": { + "in_directory": true, + "owner": "workflows", + "path": "workflows/maintenance/npu-skill-factory/references/papers-20261015/COMPARISON.md", + "sha256": "38587678a96581f5c2dc697d982127343565504bffa191352811dffcc165aa23" + }, + "references/papers-20261015/cases/methodology-counterexamples.md": { + "in_directory": true, + "owner": "workflows", + "path": "workflows/maintenance/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md", + "sha256": "f9fc21753ea41eef77ca020d78d031e945e5dd835b5d09c5ff0e53749ceb2ca4" + }, + "references/papers-20261015/knowledge/evidence-routing.md": { + "in_directory": true, + "owner": "workflows", + "path": "workflows/maintenance/npu-skill-factory/references/papers-20261015/knowledge/evidence-routing.md", + "sha256": "406d5d74c3fef4c1a23d495492e21a084c3c46495a1a84b385703ed104358874" + }, + "references/papers-20261015/references/readset.md": { + "in_directory": true, + "owner": "workflows", + "path": "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/readset.md", + "sha256": "6f953d20d8958c68339c9ceeae348604d0fea3e9c6ccb9b64a63d3b210426a22" + }, + "references/skill-factory-design-20261014.md": { + "in_directory": true, + "owner": "workflows", + "path": "workflows/maintenance/npu-skill-factory/references/skill-factory-design-20261014.md", + "sha256": "0b2e05bb6a4a3b3f6df0b04abc40ec125be60714b87f609a390246ee2a292d2d" + } + }, + "required_count": 17, + "required_resources": { + "workflows/maintenance/npu-skill-factory/SKILL.md": "0de28180da76b6cb9d2c9456733011d00d9801f7662afd32959c4c5d2c05a183", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/COMPARISON.md": "38587678a96581f5c2dc697d982127343565504bffa191352811dffcc165aa23", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/INTEGRATION_NOTES.md": "fbc4a96b6f6c477706eed83eaa4fcc29a14f881637629d6c004601ed049f2523", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/QA.md": "3f3785ec39a6938a5d1f2e874e99153fe92c0e666dd3e78a499c8b47d891346a", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/README.md": "221785e91c45588f82b3caab6d52f1ea1d102b16139c20a0802921e2789e6d28", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/UNREAD_LEADS.md": "6c1d87ebe491d27666703149eb05ad582c7e5aff77f0ac5c11a7b89c946f96ee", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md": "f9fc21753ea41eef77ca020d78d031e945e5dd835b5d09c5ff0e53749ceb2ca4", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/knowledge/evidence-routing.md": "406d5d74c3fef4c1a23d495492e21a084c3c46495a1a84b385703ed104358874", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md": "9c2d1d738e896d05c00f53e6adf14c9df2501ecc3f0020e71b5a1c2192547086", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/protocol-details.md": "41298c6bde3a28f0712fa06a18bbc4ac59aea6d17cc9eb1318744f4121e3bab6", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/readset.md": "6f953d20d8958c68339c9ceeae348604d0fea3e9c6ccb9b64a63d3b210426a22", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/repo-to-skill.md": "5ebdac2a2bbbe6614f9d4096bc9895bd685acdf76414e2c3c1fb7b50d57c738d", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/skillopt.md": "148075daa67e19f4b4351710498438d17c279a9bce56b2d01cab26ff3be33e99", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/source-manifest.json": "716cd49ed01824ee9f6b6fc55ebf2b24fdd5d5a3e677f6e28e34a472616bbe25", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/trace2skill.md": "230d13b77ba819b5e3edee147523e8cad6bfce95afccc140fb4946d6c8747a2e", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/updates/bounded-updates.md": "529c363e9c678f33f7c0be0420d26c64d056321f041726362dba69e53e1e375e", + "workflows/maintenance/npu-skill-factory/references/skill-factory-design-20261014.md": "0b2e05bb6a4a3b3f6df0b04abc40ec125be60714b87f609a390246ee2a292d2d" + }, + "resource_set": "a169e5134b20eb055de33a5281729d6de8e94d2932ccadf781a38201ad34c5ea", + "revision": "sha256:4a32eb345b5c632ddc93c679f67c1bcd7d4071cc86e68060b5a9843ee70d592c", + "status": "partial" + }, + "checkout:repository-evolution-analysis": { + "atom": { + "kind": "skill", + "resource": "workflows/research/repository-evolution-analysis/SKILL.md" + }, + "card_bytes": 3713, + "card_sha256": "740f137f501b0b404e40dd694f2130a5793da8f413008bebd8049fba2787c660", + "dependencies": { + "workflows/research/repository-evolution-analysis/references/rtk-consumer-path-transition.md": "sha256:a70b1d128fb5e0ac12292a290d624f218a0831d7581fe8980b62661473e0f2b7" + }, + "entry_sha256": "0f48cc6a77b3ac861af698048be7c250c3ef5c225dc238b9a0e6d71208cbd93e", + "entry_source": "workflows/research/repository-evolution-analysis/SKILL.md", + "entrypoint": "workflows/research/repository-evolution-analysis/SKILL.md", + "guide": "workflows/research/repository-evolution-analysis/SKILL.md", + "guide_sha256": "0f48cc6a77b3ac861af698048be7c250c3ef5c225dc238b9a0e6d71208cbd93e", + "kind": "skill", + "missing_fields": [ + "recommendation", + "validation" + ], + "relative_guide_links": { + "../../maintenance/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md#e-c2--better-repository-familiarity-can-produce-unnecessary-caution": { + "in_directory": false, + "owner": "workflows", + "path": "workflows/maintenance/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md", + "sha256": "f9fc21753ea41eef77ca020d78d031e945e5dd835b5d09c5ff0e53749ceb2ca4" + }, + "../../maintenance/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md": { + "in_directory": false, + "owner": "workflows", + "path": "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md", + "sha256": "9c2d1d738e896d05c00f53e6adf14c9df2501ecc3f0020e71b5a1c2192547086" + }, + "references/capability-presence-audit.md": { + "in_directory": true, + "owner": "workflows", + "path": "workflows/research/repository-evolution-analysis/references/capability-presence-audit.md", + "sha256": "c21eb4a6aabe811a49a6540a34c54dbcfdcf7efae3052a79b54034c7838026a5" + }, + "references/rtk-consumer-path-transition.md": { + "in_directory": true, + "owner": "workflows", + "path": "workflows/research/repository-evolution-analysis/references/rtk-consumer-path-transition.md", + "sha256": "a70b1d128fb5e0ac12292a290d624f218a0831d7581fe8980b62661473e0f2b7" + } + }, + "required_count": 3, + "required_resources": { + "workflows/research/repository-evolution-analysis/SKILL.md": "0f48cc6a77b3ac861af698048be7c250c3ef5c225dc238b9a0e6d71208cbd93e", + "workflows/research/repository-evolution-analysis/references/capability-presence-audit.md": "c21eb4a6aabe811a49a6540a34c54dbcfdcf7efae3052a79b54034c7838026a5", + "workflows/research/repository-evolution-analysis/references/rtk-consumer-path-transition.md": "a70b1d128fb5e0ac12292a290d624f218a0831d7581fe8980b62661473e0f2b7" + }, + "resource_set": "818062e63a4e0f65bc6340f18c3c5d996f6c88ff33cc4853cddb75199fa721e4", + "revision": "sha256:f10b5d57f2ae31ee7bcad9907d8374b925a821090f8a73a4d8c7567e7d23a491", + "status": "partial" + }, + "checkout:rsi-evidence": { + "atom": { + "kind": "skill", + "resource": "workflows/governance/rsi-evidence/SKILL.md" + }, + "card_bytes": 6332, + "card_sha256": "f197648462507bcd20e86baae8c937068d4b4bda02d903554ed85abed5a7c3f1", + "dependencies": {}, + "entry_sha256": "5edd2bd544da050d2688f37c85ae6e7927eaee24af764e3c96b6cec04982990a", + "entry_source": "workflows/governance/rsi-evidence/SKILL.md", + "entrypoint": "workflows/governance/rsi-evidence/SKILL.md", + "guide": "workflows/governance/rsi-evidence/SKILL.md", + "guide_sha256": "5edd2bd544da050d2688f37c85ae6e7927eaee24af764e3c96b6cec04982990a", + "kind": "skill", + "missing_fields": [ + "validation" + ], + "relative_guide_links": { + "../../../playbooks/measurement/performance-ceiling-analysis/references/acceptance-criteria.md": { + "in_directory": false, + "owner": "playbooks", + "path": "playbooks/measurement/performance-ceiling-analysis/references/acceptance-criteria.md", + "sha256": "e96efc42005af591a87b57dd6f1e9bffa8e351bcd023bd093ac37239a0486638" + }, + "references/loopx-goal-governance/README.md": { + "in_directory": true, + "owner": "workflows", + "path": "workflows/governance/rsi-evidence/references/loopx-goal-governance/README.md", + "sha256": "c86eb179cea1b42f346f5c1dc076292ba086be907f20b0beee45c43cf0f8d6fe" + }, + "references/omni-experiments.md": { + "in_directory": true, + "owner": "workflows", + "path": "workflows/governance/rsi-evidence/references/omni-experiments.md", + "sha256": "8fafc1e05ef21ab60158fc626c73ca1b8c615ada59f90fd23199496daa46ac48" + } + }, + "required_count": 9, + "required_resources": { + "workflows/governance/rsi-evidence/SKILL.md": "5edd2bd544da050d2688f37c85ae6e7927eaee24af764e3c96b6cec04982990a", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/LICENSE": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/LICENSE-MIT.md": "1df1cf519b9e5d8acbbc72820299d7aa95afa1acbfc1f43a15109ad1d59975f3", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/NOTICE.md": "3c3c36a40e1d65f3a6b20ec3a97319cb753e857f1d120f302cd828e107120f6d", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/README.md": "c86eb179cea1b42f346f5c1dc076292ba086be907f20b0beee45c43cf0f8d6fe", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/decision-cases.md": "c2c1d3d75c4fcb515dd36ff84d8dc940c25d54c5757a29a80d1af88eb8b66115", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/mechanisms.md": "4fa09099d362a8088fdb0e6a767f72aae6218b92fe5fd75b6fb78c2bb2a318fb", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/source-ledger.json": "4a0f1f02134af5b7d54a1f13e104b8066372d3d4a1a4a9e717514632fff05893", + "workflows/governance/rsi-evidence/references/omni-experiments.md": "8fafc1e05ef21ab60158fc626c73ca1b8c615ada59f90fd23199496daa46ac48" + }, + "resource_set": "2217ce37c9e8efd08012b9fe6e0111fbe94e35bbed84fa9122be3cb0addfae2b", + "revision": "sha256:959ade47c93ab2b5fbaa43332c597ae672c4e6428c2b53354b37284db87ac9cc", + "status": "partial" + }, + "checkout:skill-evolution-playbook": { + "atom": { + "kind": "skill", + "resource": "workflows/maintenance/skill-evolution-playbook/SKILL.md" + }, + "card_bytes": 7133, + "card_sha256": "7879f6d6b72bb161796834d2acba9f220d90b0c661d1936dc7b97fb053475031", + "dependencies": {}, + "entry_sha256": "f988a0569be93fec550da52484d22d970b0a6c31394ea463ad6ee40e0877ede6", + "entry_source": "workflows/maintenance/skill-evolution-playbook/SKILL.md", + "entrypoint": "workflows/maintenance/skill-evolution-playbook/SKILL.md", + "guide": "workflows/maintenance/skill-evolution-playbook/SKILL.md", + "guide_sha256": "f988a0569be93fec550da52484d22d970b0a6c31394ea463ad6ee40e0877ede6", + "kind": "skill", + "missing_fields": [ + "validation" + ], + "relative_guide_links": { + "../../../playbooks/planning/optimization-search-policy/references/papers-20261015/knowledge/adaptation-interfaces.md": { + "in_directory": false, + "owner": "playbooks", + "path": "playbooks/planning/optimization-search-policy/references/papers-20261015/knowledge/adaptation-interfaces.md", + "sha256": "5e761957cb5ecd93926e6ffc13deee7c830c6e8f0ee3c3846e9dd3b50dc74446" + }, + "../npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md": { + "in_directory": false, + "owner": "workflows", + "path": "workflows/maintenance/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md", + "sha256": "f9fc21753ea41eef77ca020d78d031e945e5dd835b5d09c5ff0e53749ceb2ca4" + }, + "../npu-skill-factory/references/papers-20261015/references/readset.md": { + "in_directory": false, + "owner": "workflows", + "path": "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/readset.md", + "sha256": "6f953d20d8958c68339c9ceeae348604d0fea3e9c6ccb9b64a63d3b210426a22" + }, + "../npu-skill-factory/references/papers-20261015/references/skillopt.md": { + "in_directory": false, + "owner": "workflows", + "path": "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/skillopt.md", + "sha256": "148075daa67e19f4b4351710498438d17c279a9bce56b2d01cab26ff3be33e99" + }, + "../npu-skill-factory/references/papers-20261015/references/trace2skill.md": { + "in_directory": false, + "owner": "workflows", + "path": "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/trace2skill.md", + "sha256": "230d13b77ba819b5e3edee147523e8cad6bfce95afccc140fb4946d6c8747a2e" + } + }, + "required_count": 1, + "required_resources": { + "workflows/maintenance/skill-evolution-playbook/SKILL.md": "f988a0569be93fec550da52484d22d970b0a6c31394ea463ad6ee40e0877ede6" + }, + "resource_set": "1c7ede459144707193731bdb26f22a27f141ed964b4df4bcbf9c2c22d31bcf36", + "revision": "sha256:61ab81a692582f3f577d2ce04b6211e9587a420de2fc4414b95163fedb28570b", + "status": "partial" + }, + "package:inferrsi.common.skills.cite_check_downstream_pr": { + "atom": { + "kind": "skill", + "resource": "data/skill_library/workflows/governance/cite-check-downstream-pr/SKILL.md" + }, + "card_bytes": 4354, + "card_sha256": "857eddcd079df44eee89eb1122de3222c3489aa0f54135d8bf40d5808fad5dee", + "dependencies": { + "data/skill_library": "sha256:502067b90d93cae5a58c6afd65dae5a4cbe183fd29ffb21ea67e8d703e66425d" + }, + "entry_sha256": "70efe85335c137dc6fd720b2a3d96bc3ce622aa88d06f8d313b49159c289770f", + "entry_source": "workflows/governance/cite-check-downstream-pr/SKILL.md", + "entrypoint": "record.json", + "guide": "data/skill_library/workflows/governance/cite-check-downstream-pr/SKILL.md", + "guide_sha256": "68ff74b48de1607297aa35e2e8b2eaea12674d938f8c8167b93e55b1044ba858", + "kind": "knowledge", + "missing_fields": [ + "validation" + ], + "required_count": 716, + "resource_set": "91b2403be64caffb18e5c462f936448a5f7eb0e4e4c96ff715d04a025b930bdb", + "revision": "sha256:6e7cf772c73826fb0f8e57b0c3a20688296769e0d0a3dee8120ac9d35102b970", + "status": "partial" + }, + "package:inferrsi.common.skills.claim_contract": { + "atom": { + "kind": "skill", + "resource": "data/skill_library/workflows/governance/claim-contract/SKILL.md" + }, + "card_bytes": 4182, + "card_sha256": "6c4b4f8a7e3c53163197430d171182310693c3a7e9a5741ffbec29fd42f1f861", + "dependencies": { + "data/skill_library": "sha256:502067b90d93cae5a58c6afd65dae5a4cbe183fd29ffb21ea67e8d703e66425d" + }, + "entry_sha256": "796ec020436a5f84d9973580715c8f4daf34b0edcbc467251ca690045c7c8a62", + "entry_source": "workflows/governance/claim-contract/SKILL.md", + "entrypoint": "record.json", + "guide": "data/skill_library/workflows/governance/claim-contract/SKILL.md", + "guide_sha256": "49cf787427e7842fc0b8cbc1e58091fc4b77a5a48c0cb8fb7aaecd91f8715670", + "kind": "knowledge", + "missing_fields": [ + "validation" + ], + "required_count": 716, + "resource_set": "e2961b60f9c7faba55ee2581ef1384a11fd794e4811e8505518022e28466400e", + "revision": "sha256:117e156791fa1a803904094e8ced6b917f0b9ee4eeccc10a843b19d4cc4c876a", + "status": "partial" + }, + "package:inferrsi.common.skills.competitor_scan": { + "atom": { + "kind": "skill", + "resource": "data/skill_library/workflows/research/competitor-scan/SKILL.md" + }, + "card_bytes": 3652, + "card_sha256": "eadafcd04ff5bf2d1da20c8eb21b7ed8eaf2e080bb68712e5181e9640966d06c", + "dependencies": { + "data/skill_library": "sha256:502067b90d93cae5a58c6afd65dae5a4cbe183fd29ffb21ea67e8d703e66425d" + }, + "entry_sha256": "a9f742bf6e110750a91630ab76eac714ac7220d9e7fe95142817d299b95d4de0", + "entry_source": "workflows/research/competitor-scan/SKILL.md", + "entrypoint": "record.json", + "guide": "data/skill_library/workflows/research/competitor-scan/SKILL.md", + "guide_sha256": "7f2613a1fc8e9fc58c3058c4946b85e8d7d49359143d650f711b88b448307ab6", + "kind": "knowledge", + "missing_fields": [ + "validation" + ], + "required_count": 716, + "resource_set": "7ff695c0d19e72562bc2dcda1b61ecba9ba867c8ff596dba2e4a97ce9db28314", + "revision": "sha256:92548ca5445149b1d122dc724dccd34beba2be7c51f1a323e0a190fe90527485", + "status": "partial" + }, + "package:inferrsi.common.skills.draft_acceptance_issue": { + "atom": { + "kind": "skill", + "resource": "data/skill_library/workflows/governance/draft-acceptance-issue/SKILL.md" + }, + "card_bytes": 4672, + "card_sha256": "46d70f026508eff34a440b2d3e5a0f323aab955830a8c35b1f0ab2e69f84d3ac", + "dependencies": { + "data/skill_library": "sha256:502067b90d93cae5a58c6afd65dae5a4cbe183fd29ffb21ea67e8d703e66425d" + }, + "entry_sha256": "124ce8ca7c36a0df0414e3b6ef7e660291e355a36a92f424af2d25502608d8e5", + "entry_source": "workflows/governance/draft-acceptance-issue/SKILL.md", + "entrypoint": "record.json", + "guide": "data/skill_library/workflows/governance/draft-acceptance-issue/SKILL.md", + "guide_sha256": "2c14533c067c51b9763f80a9df0bf5eb5acd398f4265790c57039fed96d4c497", + "kind": "knowledge", + "missing_fields": [ + "validation" + ], + "required_count": 716, + "resource_set": "d81400223c0546431fccd836de7492d06746e87f2316ea4bbb4267277ecc7920", + "revision": "sha256:1c456ed568651e5af5e7ca922574874b85f0e8fa7798c5facd0beb864c5fde49", + "status": "partial" + }, + "package:inferrsi.common.skills.npu_skill_factory": { + "atom": { + "kind": "skill", + "resource": "data/skill_library/workflows/maintenance/npu-skill-factory/SKILL.md" + }, + "card_bytes": 6069, + "card_sha256": "61eaec8bc6b25041cebaf6cbe2234d094db2afba193176b05cc9b93c6e887570", + "dependencies": { + "data/skill_library": "sha256:502067b90d93cae5a58c6afd65dae5a4cbe183fd29ffb21ea67e8d703e66425d" + }, + "entry_sha256": "efbe58fbf67d9c29eabfff953244b67fb38c49cd3f5653803896dc827ad26c38", + "entry_source": "workflows/maintenance/npu-skill-factory/SKILL.md", + "entrypoint": "record.json", + "guide": "data/skill_library/workflows/maintenance/npu-skill-factory/SKILL.md", + "guide_sha256": "0de28180da76b6cb9d2c9456733011d00d9801f7662afd32959c4c5d2c05a183", + "kind": "knowledge", + "missing_fields": [ + "validation" + ], + "required_count": 716, + "resource_set": "0c78e02a58d7bc90ba6b30608a0efe654409280c660e3b82526b8076b9170a9b", + "revision": "sha256:cd538a07e287d3e78471c80da7fbdae9b9420f365bdc449f7a3b431d0d3ef757", + "status": "partial" + }, + "package:inferrsi.common.skills.repository_evolution_analysis": { + "atom": { + "kind": "skill", + "resource": "data/skill_library/workflows/research/repository-evolution-analysis/SKILL.md" + }, + "card_bytes": 3754, + "card_sha256": "675d09c4a856601cdd2aa0eea782601e0d94c028e69056cad491ae89ec4931a3", + "dependencies": { + "data/skill_library": "sha256:502067b90d93cae5a58c6afd65dae5a4cbe183fd29ffb21ea67e8d703e66425d" + }, + "entry_sha256": "42cd53a6bfcfc0f4f25d81887116c04424e5a243a974566171055b9282ad0568", + "entry_source": "workflows/research/repository-evolution-analysis/SKILL.md", + "entrypoint": "record.json", + "guide": "data/skill_library/workflows/research/repository-evolution-analysis/SKILL.md", + "guide_sha256": "0f48cc6a77b3ac861af698048be7c250c3ef5c225dc238b9a0e6d71208cbd93e", + "kind": "knowledge", + "missing_fields": [ + "recommendation", + "validation" + ], + "required_count": 716, + "resource_set": "cc3ea137a24adc3b092cbb8378e9babacf3e2df3e5518faac8d6904d422864a2", + "revision": "sha256:00e4e4c5753d75f53922dc1e72fa905dc6c29e44bad811cb9211d824f09dff99", + "status": "partial" + }, + "package:inferrsi.common.skills.rsi_evidence": { + "atom": { + "kind": "skill", + "resource": "data/skill_library/workflows/governance/rsi-evidence/SKILL.md" + }, + "card_bytes": 6373, + "card_sha256": "60b71cbba34aeb675bebaae8b455b065b20fa305686a8e1d91d0a07e9f7f2ff0", + "dependencies": { + "data/skill_library": "sha256:502067b90d93cae5a58c6afd65dae5a4cbe183fd29ffb21ea67e8d703e66425d" + }, + "entry_sha256": "524371d0e09ffb0f0b638658a69fb1a060737a32c20f0b63554213aaa4b71796", + "entry_source": "workflows/governance/rsi-evidence/SKILL.md", + "entrypoint": "record.json", + "guide": "data/skill_library/workflows/governance/rsi-evidence/SKILL.md", + "guide_sha256": "5edd2bd544da050d2688f37c85ae6e7927eaee24af764e3c96b6cec04982990a", + "kind": "knowledge", + "missing_fields": [ + "validation" + ], + "required_count": 716, + "resource_set": "8f2a0d523eb0fb9fe4b5a677703c5cdbe308b1c8755077d74876c42295c33f7b", + "revision": "sha256:d2219d7cf339c87caac81db8a19b168eeb178f06174973b58a39facc34b4a39b", + "status": "partial" + }, + "package:inferrsi.common.skills.skill_evolution_playbook": { + "atom": { + "kind": "skill", + "resource": "data/skill_library/workflows/maintenance/skill-evolution-playbook/SKILL.md" + }, + "card_bytes": 7174, + "card_sha256": "1f8629e30a9053fca28d75460b09d0bb739cf9cd3f9c67f9220a0f06500885c6", + "dependencies": { + "data/skill_library": "sha256:502067b90d93cae5a58c6afd65dae5a4cbe183fd29ffb21ea67e8d703e66425d" + }, + "entry_sha256": "34e3e833dd066e24fd1c6e17791aec0241e2e17b6c72069796be1112edef9461", + "entry_source": "workflows/maintenance/skill-evolution-playbook/SKILL.md", + "entrypoint": "record.json", + "guide": "data/skill_library/workflows/maintenance/skill-evolution-playbook/SKILL.md", + "guide_sha256": "f988a0569be93fec550da52484d22d970b0a6c31394ea463ad6ee40e0877ede6", + "kind": "knowledge", + "missing_fields": [ + "validation" + ], + "required_count": 716, + "resource_set": "57f29cb54d0eef9df6c823da22e654c93f286dc7047703a72b87678dc9ea150d", + "revision": "sha256:55e5f119d0121623e4e512b43aaf0e55cbc9fabd645f4d8a1ef70d4e5f8b1fdf", + "status": "partial" + } + }, + "release": "v0.3.4", + "shared_dependency": "sha256:502067b90d93cae5a58c6afd65dae5a4cbe183fd29ffb21ea67e8d703e66425d", + "shared_members": 715, + "source_commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "wheel_sha256": "9a1015f2c1e1347f46d1ca899d2cb8e32c8279a75e88669b9de1a8c8bda5b6c9" +} From 3c415fc5f36c33da9ed85a32cfe75212a6585b14 Mon Sep 17 00:00:00 2001 From: Dong1017 <55723162+Dong1017@users.noreply.github.com> Date: Fri, 27 Nov 2026 04:05:57 +0800 Subject: [PATCH 09/12] Build three source-pinned Workflow Skills from their released guides Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com> --- .gitattributes | 4 + .../cite-check-downstream-pr.original.json | 102 ++++++++++++++ .../atoms/claim-contract.original.json | 101 ++++++++++++++ .../atoms/competitor-scan.original.json | 100 ++++++++++++++ .../workflows/cite-check-downstream-pr.md | 72 ++++++++++ .../atoms/workflows/claim-contract.md | 73 ++++++++++ .../atoms/workflows/competitor-scan.md | 69 ++++++++++ .../cite-check-downstream-pr.json | 114 ++++++++++++++++ .../compositions/claim-contract.json | 113 +++++++++++++++ .../compositions/competitor-scan.json | 112 +++++++++++++++ tests/knowledge/test_atomic_workflows.py | 129 ++++++++++++++++++ 11 files changed, 989 insertions(+) create mode 100644 src/inferrsi/knowledge/atoms/cite-check-downstream-pr.original.json create mode 100644 src/inferrsi/knowledge/atoms/claim-contract.original.json create mode 100644 src/inferrsi/knowledge/atoms/competitor-scan.original.json create mode 100644 src/inferrsi/knowledge/atoms/workflows/cite-check-downstream-pr.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/claim-contract.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/competitor-scan.md create mode 100644 src/inferrsi/knowledge/compositions/cite-check-downstream-pr.json create mode 100644 src/inferrsi/knowledge/compositions/claim-contract.json create mode 100644 src/inferrsi/knowledge/compositions/competitor-scan.json create mode 100644 tests/knowledge/test_atomic_workflows.py diff --git a/.gitattributes b/.gitattributes index 4bdb61b8a..1c59e62d7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,6 +14,10 @@ /evidence/_template/** text eol=lf /src/inferrsi/knowledge/atoms/casebooks/* -text +/src/inferrsi/knowledge/atoms/workflows/** -text +# Two released Markdown guides use trailing spaces for hard line breaks. +/src/inferrsi/knowledge/atoms/workflows/cite-check-downstream-pr.md whitespace=-blank-at-eol +/src/inferrsi/knowledge/atoms/workflows/competitor-scan.md whitespace=-blank-at-eol # Retain this upstream license's original CRLF Git blob bytes. /src/inferrsi/knowledge/data/skill_library/systems/frameworks/torch-npu/torch-npu/references/licenses/op-plugin-LICENSE.txt -text diff --git a/src/inferrsi/knowledge/atoms/cite-check-downstream-pr.original.json b/src/inferrsi/knowledge/atoms/cite-check-downstream-pr.original.json new file mode 100644 index 000000000..8febb760e --- /dev/null +++ b/src/inferrsi/knowledge/atoms/cite-check-downstream-pr.original.json @@ -0,0 +1,102 @@ +{ + "authority": "checkout", + "metadata": { + "id": "cite-check-downstream-pr.original", + "kind": "knowledge", + "entrypoint": "guide.md", + "title": "Review a downstream PR description for correct acceptance issue links, SHA pins, and artifact citations.", + "origin": [ + "first-party" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/cite-check-downstream-pr/SKILL.md", + "sha256": "68ff74b48de1607297aa35e2e8b2eaea12674d938f8c8167b93e55b1044ba858" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Review of a downstream PR description that cites RSI acceptance work for a performance or quality improvement", + "prerequisites": "The PR description, the acceptance issue it cites, and the evidence paths it names; reviewing is read-only and needs no local run", + "input_contract": "One PR description plus the cited acceptance issue and its evidence tree; the reviewer reads claims and citations, not the candidate code", + "produced_artifact": "A per-checklist review result that either accepts the citation or marks the summary unverified, using only PASS/FAIL/INCONCLUSIVE vocabulary", + "failure_modes": [ + "No acceptance issue URL, only a chat thread", + "Branch names instead of full baseline and candidate SHAs", + "Microbenchmark evidence offered for an end-to-end latency claim", + "A threshold restated or invented relative to the acceptance issue", + "Evidence path absent, stale or on a different SHA than the cited candidate" + ], + "refusal_point": "Refuses to restate a performance or quality claim whose artifacts are missing, stale or off-SHA; reports the summary as unverified instead" + }, + "state": "candidate", + "limitations": [ + "Checklist-only procedure; it validates citation discipline, not the measurement behind an artifact.", + "A passing review does not establish that the campaign evidence itself is correct.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/cite-check-downstream-pr/SKILL.md", + "byte_range": [ + 0, + 3534 + ], + "sha256": "68ff74b48de1607297aa35e2e8b2eaea12674d938f8c8167b93e55b1044ba858" + } + } + }, + "content": { + "guide.md": { + "path": "workflows/cite-check-downstream-pr.md" + } + }, + "parts": { + "navigation": { + "skill_section": "navigation", + "layer": "L0", + "byte_range": [ + 0, + 153 + ], + "sha256": "92227c444266d55b1db7bceebc95147cbf7c33276e28defe1f084713697f4a3e" + }, + "decision": { + "skill_section": "decision", + "layer": "L1", + "byte_range": [ + 0, + 2598 + ], + "sha256": "834c46f93a46f3e14ef7ce621237bd50f67ac399408cfa8cacb80de2b2911229" + }, + "procedure": { + "skill_section": "procedure", + "layer": "L2", + "byte_range": [ + 2598, + 3534 + ], + "sha256": "e6f746627c70affd045c6354a24fd704c64a50d6e7d2502ecc753bb77c09b8f3" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/claim-contract.original.json b/src/inferrsi/knowledge/atoms/claim-contract.original.json new file mode 100644 index 000000000..66a631833 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/claim-contract.original.json @@ -0,0 +1,101 @@ +{ + "authority": "checkout", + "metadata": { + "id": "claim-contract.original", + "kind": "knowledge", + "entrypoint": "guide.md", + "title": "Enforce ThinkFlowLab claim contract wording and verdict rules without embedding campaign-specific revision pins.", + "origin": [ + "first-party" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/claim-contract/SKILL.md", + "sha256": "49cf787427e7842fc0b8cbc1e58091fc4b77a5a48c0cb8fb7aaecd91f8715670" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Wording and verdict rules for any public performance or quality claim produced from an RSI campaign", + "prerequisites": "A completed campaign with pinned baseline and candidate SHAs and an evidence tree; the rules themselves carry no numeric threshold", + "input_contract": "A claim draft, the campaign RunSpec and its evidence tree under evidence//", + "produced_artifact": "A claim sentence in the pinned form, or a refusal when the campaign verdict is not PASS", + "failure_modes": [ + "Claim asserted before the campaign reaches PASS with artifacts", + "Baseline or candidate SHA written into a shared template, skill or default CI environment", + "Microbenchmark result presented as end-to-end completion", + "A lesson transferred across an unverified repo x revision x backend x device x model x scenario tuple" + ], + "refusal_point": "Refuses any public claim lacking a PASS verdict and artifacts under evidence/, and refuses numeric thresholds because thresholds belong to the campaign" + }, + "state": "candidate", + "limitations": [ + "States wording and verdict rules only; it selects no numeric gate and validates no measurement.", + "SIAS plane boundaries constrain where a change belongs, not whether it is correct.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/claim-contract/SKILL.md", + "byte_range": [ + 0, + 3223 + ], + "sha256": "49cf787427e7842fc0b8cbc1e58091fc4b77a5a48c0cb8fb7aaecd91f8715670" + } + } + }, + "content": { + "guide.md": { + "path": "workflows/claim-contract.md" + } + }, + "parts": { + "navigation": { + "skill_section": "navigation", + "layer": "L0", + "byte_range": [ + 0, + 151 + ], + "sha256": "46d88fe6273f99a0c272b9e2df6436942163e07f7539d6b0f7a269518605945b" + }, + "decision": { + "skill_section": "decision", + "layer": "L1", + "byte_range": [ + 0, + 2303 + ], + "sha256": "0a376a7e4fe49222414fba569d765ff35086458b8923cc061e0b2e0f81ff8cd6" + }, + "procedure": { + "skill_section": "procedure", + "layer": "L2", + "byte_range": [ + 2303, + 3223 + ], + "sha256": "08294685bbd35070b0a9f1f69c596d347a78591d35a4ff0ef01a6fe9a4b9ce8b" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/competitor-scan.original.json b/src/inferrsi/knowledge/atoms/competitor-scan.original.json new file mode 100644 index 000000000..595d263da --- /dev/null +++ b/src/inferrsi/knowledge/atoms/competitor-scan.original.json @@ -0,0 +1,100 @@ +{ + "authority": "checkout", + "metadata": { + "id": "competitor-scan.original", + "kind": "knowledge", + "entrypoint": "guide.md", + "title": "Structure a lightweight competitive scan without inventing benchmark numbers or campaign verdicts.", + "origin": [ + "first-party" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/research/competitor-scan/SKILL.md", + "sha256": "7f2613a1fc8e9fc58c3058c4946b85e8d7d49359143d650f711b88b448307ab6" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Qualitative positioning of a new RSI repository against other projects before acceptance evidence exists", + "prerequisites": "A selected repository and readable public material from the alternatives; no benchmark run is required", + "input_contract": "A target repository plus whatever the alternatives publish about what they optimize and how they prove it", + "produced_artifact": "A short Markdown note covering problem, alternatives, differentiation, limits and open questions", + "failure_modes": [ + "Numeric comparison written without a PASS campaign in our own evidence tree", + "Third-party figure repeated as if reproduced under our RunSpec", + "Scan presented as a substitute for acceptance evidence" + ], + "refusal_point": "Refuses any numeric comparison not sourced from our own evidence//results/ with a PASS verdict" + }, + "state": "candidate", + "limitations": [ + "Produces positioning material only; it establishes no performance or quality result.", + "Third-party claim contracts are read from public material and may be incomplete.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/research/competitor-scan/SKILL.md", + "byte_range": [ + 0, + 3266 + ], + "sha256": "7f2613a1fc8e9fc58c3058c4946b85e8d7d49359143d650f711b88b448307ab6" + } + } + }, + "content": { + "guide.md": { + "path": "workflows/competitor-scan.md" + } + }, + "parts": { + "navigation": { + "skill_section": "navigation", + "layer": "L0", + "byte_range": [ + 0, + 138 + ], + "sha256": "0e002b5ac5a3f80312a3bd5a3884600f6be83db9eb528b1899c7a1173447a7f9" + }, + "decision": { + "skill_section": "decision", + "layer": "L1", + "byte_range": [ + 0, + 2320 + ], + "sha256": "3d514c6b2cac513aeb11c2e0f46c9e712f60737a9d38d3150632088e587f9f31" + }, + "procedure": { + "skill_section": "procedure", + "layer": "L2", + "byte_range": [ + 2320, + 3266 + ], + "sha256": "593dbe70486408b72174714dc58429e7898bff74df164028081dd3a67381b05b" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/workflows/cite-check-downstream-pr.md b/src/inferrsi/knowledge/atoms/workflows/cite-check-downstream-pr.md new file mode 100644 index 000000000..3a7fd5777 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/cite-check-downstream-pr.md @@ -0,0 +1,72 @@ +--- +name: cite-check-downstream-pr +description: Review a downstream PR description for correct acceptance issue links, SHA pins, and artifact citations. +metadata: + inferrsi: | + { + "schema_version": 1, + "profile": "local-skill-v1", + "kind": "skill", + "status": "candidate", + "origin": [ + "first-party" + ], + "consumption_mode": "packaged", + "tags": [ + "review", + "downstream", + "citation", + "evidence", + "verdict" + ], + "empirical_validation": "not_run", + "applicability": { + "scope": "Review of a downstream PR description that cites RSI acceptance work for a performance or quality improvement", + "prerequisites": "The PR description, the acceptance issue it cites, and the evidence paths it names; reviewing is read-only and needs no local run", + "input_contract": "One PR description plus the cited acceptance issue and its evidence tree; the reviewer reads claims and citations, not the candidate code", + "produced_artifact": "A per-checklist review result that either accepts the citation or marks the summary unverified, using only PASS/FAIL/INCONCLUSIVE vocabulary", + "failure_modes": [ + "No acceptance issue URL, only a chat thread", + "Branch names instead of full baseline and candidate SHAs", + "Microbenchmark evidence offered for an end-to-end latency claim", + "A threshold restated or invented relative to the acceptance issue", + "Evidence path absent, stale or on a different SHA than the cited candidate" + ], + "refusal_point": "Refuses to restate a performance or quality claim whose artifacts are missing, stale or off-SHA; reports the summary as unverified instead" + }, + "recommendations": [ + "Read the cited acceptance issue before the PR description so an invented threshold is visible immediately.", + "Resolve every listed evidence path and compare its SHA with the candidate SHA the PR names.", + "Report an unverifiable claim as unverified rather than repeating its number." + ], + "limitations": [ + "Checklist-only procedure; it validates citation discipline, not the measurement behind an artifact.", + "A passing review does not establish that the campaign evidence itself is correct." + ], + "provenance_readsets": [], + "searchspace_not_applicable": "SKILL.md §§ Checklist and Red flags check acceptance links, revision/artifact citations and claim wording; they provide no hardware-resource mechanism." + } +--- + +# Cite-check a downstream PR + +Use when reviewing external PRs that claim performance or quality improvements tied to RSI acceptance work. + +## Checklist + +- [ ] Links an acceptance issue URL (not only a chat thread) +- [ ] States **baseline SHA** and **candidate SHA** matching that issue +- [ ] Points to `evidence//results/` (or equivalent published mirror) +- [ ] Does **not** invent new thresholds or restate bars differently +- [ ] Marks summaries **unverified** if artifacts are missing, stale, or off-SHA +- [ ] Uses verdict vocabulary only: `PASS` / `FAIL` / `INCONCLUSIVE` + +## Red flags + +- “X% faster” without artifact path +- Branch names instead of full SHAs +- Microbench-only support for e2e latency claims + +## Reference + +[docs/contributing.md#evidence-and-claims](https://github.com/InferMatrixLab/InferRSI/blob/b2f60f913a949f9073686a23476f752e11d709a4/docs/contributing.md#evidence-and-claims) diff --git a/src/inferrsi/knowledge/atoms/workflows/claim-contract.md b/src/inferrsi/knowledge/atoms/workflows/claim-contract.md new file mode 100644 index 000000000..581dd6611 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/claim-contract.md @@ -0,0 +1,73 @@ +--- +name: claim-contract +description: Enforce ThinkFlowLab claim contract wording and verdict rules without embedding campaign-specific revision pins. +metadata: + inferrsi: | + { + "schema_version": 1, + "profile": "local-skill-v1", + "kind": "skill", + "status": "candidate", + "origin": [ + "first-party" + ], + "consumption_mode": "packaged", + "tags": [ + "claim", + "wording", + "verdict", + "evidence", + "portable" + ], + "empirical_validation": "not_run", + "applicability": { + "scope": "Wording and verdict rules for any public performance or quality claim produced from an RSI campaign", + "prerequisites": "A completed campaign with pinned baseline and candidate SHAs and an evidence tree; the rules themselves carry no numeric threshold", + "input_contract": "A claim draft, the campaign RunSpec and its evidence tree under evidence//", + "produced_artifact": "A claim sentence in the pinned form, or a refusal when the campaign verdict is not PASS", + "failure_modes": [ + "Claim asserted before the campaign reaches PASS with artifacts", + "Baseline or candidate SHA written into a shared template, skill or default CI environment", + "Microbenchmark result presented as end-to-end completion", + "A lesson transferred across an unverified repo x revision x backend x device x model x scenario tuple" + ], + "refusal_point": "Refuses any public claim lacking a PASS verdict and artifacts under evidence/, and refuses numeric thresholds because thresholds belong to the campaign" + }, + "recommendations": [ + "Keep campaign SHAs in the acceptance issue; a shared template that carries them will be wrong for the next campaign.", + "Write the verdict from the evidence tree before writing the claim sentence.", + "Treat each repo x revision x backend x device x model x scenario tuple as an independent claim." + ], + "limitations": [ + "States wording and verdict rules only; it selects no numeric gate and validates no measurement.", + "SIAS plane boundaries constrain where a change belongs, not whether it is correct." + ], + "provenance_readsets": [] + } +--- + +# Claim contract (portable) + +## Public claim wording + +Use: “on {repo}@{candidate} vs baseline@{baseline}, under {RunSpec}, we observed …” + +Only after acceptance **`PASS`** with artifacts under `evidence/`. + +## Rules (not numbers) + +| Verdict | When | +| --- | --- | +| PASS | Pinned SHAs, artifact tree on candidate tip, gates satisfied | +| FAIL | Gates failed with complete evidence | +| INCONCLUSIVE | Cannot defend comparison (env, partial run, missing validator freeze) | + +## What not to do + +- Do not bake baseline/candidate SHAs into shared repo templates, skills, or default CI env. +- Do not treat microbench alone as e2e campaign completion. +- Do not auto-transfer lessons across unverified repo × revision × backend × device × model × scenario tuples. + +## SIAS + +Respect plane boundaries: `harness/` orchestrates, `model/` defines quality, `infra/` supplies execution. Cross-plane deps belong in RunSpec. diff --git a/src/inferrsi/knowledge/atoms/workflows/competitor-scan.md b/src/inferrsi/knowledge/atoms/workflows/competitor-scan.md new file mode 100644 index 000000000..92376ead4 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/competitor-scan.md @@ -0,0 +1,69 @@ +--- +name: competitor-scan +description: Structure a lightweight competitive scan without inventing benchmark numbers or campaign verdicts. +metadata: + inferrsi: | + { + "schema_version": 1, + "profile": "local-skill-v1", + "kind": "skill", + "status": "candidate", + "origin": [ + "first-party" + ], + "consumption_mode": "packaged", + "tags": [ + "competitive-analysis", + "positioning", + "claim", + "unverified" + ], + "empirical_validation": "not_run", + "applicability": { + "scope": "Qualitative positioning of a new RSI repository against other projects before acceptance evidence exists", + "prerequisites": "A selected repository and readable public material from the alternatives; no benchmark run is required", + "input_contract": "A target repository plus whatever the alternatives publish about what they optimize and how they prove it", + "produced_artifact": "A short Markdown note covering problem, alternatives, differentiation, limits and open questions", + "failure_modes": [ + "Numeric comparison written without a PASS campaign in our own evidence tree", + "Third-party figure repeated as if reproduced under our RunSpec", + "Scan presented as a substitute for acceptance evidence" + ], + "refusal_point": "Refuses any numeric comparison not sourced from our own evidence//results/ with a PASS verdict" + }, + "recommendations": [ + "Answer the four framing questions qualitatively first; the absence of a published claim contract is itself a finding.", + "Label every third-party number unverified unless it was reproduced under our RunSpec.", + "Close the note with open questions rather than a conclusion the evidence cannot support." + ], + "limitations": [ + "Produces positioning material only; it establishes no performance or quality result.", + "Third-party claim contracts are read from public material and may be incomplete." + ], + "provenance_readsets": [], + "searchspace_not_applicable": "SKILL.md §§ Frame, Rules and Deliverable produce a qualitative competitive comparison with evidence limits, not a hardware-resource decision or implementation mechanism." + } +--- + +# Competitor scan (generic) + +Use when positioning a new RSI repo—not to replace acceptance evidence. + +## Frame + +| Question | Answer (qualitative) | +| --- | --- | +| What do others optimize? | _throughput, latency, cost, quality, …_ | +| How do they publish proof? | _blogs, papers, dashboards, none_ | +| Claim contract? | _pinned revisions + reproducible artifacts? often missing_ | +| Our wedge | _smallest proof that unlocks the next bet_ | + +## Rules + +- No numeric comparisons unless sourced from **our** `evidence/.../results/` with `PASS`. +- Label third-party numbers **unverified** if not reproduced under our RunSpec. +- Use the [evidence and claim rules](https://github.com/InferMatrixLab/InferRSI/blob/b2f60f913a949f9073686a23476f752e11d709a4/docs/contributing.md#evidence-and-claims) when writing a comparison. + +## Deliverable + +Short markdown: problem, alternatives, differentiation (claim contract + SIAS), limits, open questions. diff --git a/src/inferrsi/knowledge/compositions/cite-check-downstream-pr.json b/src/inferrsi/knowledge/compositions/cite-check-downstream-pr.json new file mode 100644 index 000000000..251cdc9c9 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/cite-check-downstream-pr.json @@ -0,0 +1,114 @@ +{ + "authority": "checkout", + "metadata": { + "id": "cite-check-downstream-pr", + "kind": "skill", + "entrypoint": "workflows/governance/cite-check-downstream-pr/SKILL.md", + "title": "Review a downstream PR description for correct acceptance issue links, SHA pins, and artifact citations.", + "origin": [ + "first-party" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/cite-check-downstream-pr/SKILL.md", + "sha256": "68ff74b48de1607297aa35e2e8b2eaea12674d938f8c8167b93e55b1044ba858" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Review of a downstream PR description that cites RSI acceptance work for a performance or quality improvement", + "prerequisites": "The PR description, the acceptance issue it cites, and the evidence paths it names; reviewing is read-only and needs no local run", + "input_contract": "One PR description plus the cited acceptance issue and its evidence tree; the reviewer reads claims and citations, not the candidate code", + "produced_artifact": "A per-checklist review result that either accepts the citation or marks the summary unverified, using only PASS/FAIL/INCONCLUSIVE vocabulary", + "failure_modes": [ + "No acceptance issue URL, only a chat thread", + "Branch names instead of full baseline and candidate SHAs", + "Microbenchmark evidence offered for an end-to-end latency claim", + "A threshold restated or invented relative to the acceptance issue", + "Evidence path absent, stale or on a different SHA than the cited candidate" + ], + "refusal_point": "Refuses to restate a performance or quality claim whose artifacts are missing, stale or off-SHA; reports the summary as unverified instead" + }, + "state": "candidate", + "limitations": [ + "Checklist-only procedure; it validates citation discipline, not the measurement behind an artifact.", + "A passing review does not establish that the campaign evidence itself is correct.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "required_resources": [ + "workflows/governance/cite-check-downstream-pr/SKILL.md" + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "checkout:cite-check-downstream-pr.original.navigation", + "revision": "sha256:2e1b7afde428c8679def94df4361adc67374602042e7fbf8307634c4903d0374" + }, + "decision": { + "ref": "checkout:cite-check-downstream-pr.original.decision", + "revision": "sha256:0709396dc852cacb02e0f190b515cdffd6f6fd93cbc382c413dbb7b510ada418" + }, + "procedure": { + "ref": "checkout:cite-check-downstream-pr.original.procedure", + "revision": "sha256:479e1711fe473c49f52399e631329e7f98f355364454788d38ccad10fcd74577", + "requires": [ + "decision" + ] + }, + "original": { + "ref": "checkout:cite-check-downstream-pr.original", + "revision": "sha256:de434b2220183c8abc3f76d990ee5e6dd7accca534be128f6f3edd7608b52fd2" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "decision" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure" + ] + }, + "original": { + "layer": "L3", + "required": [ + "original" + ] + } + }, + "skill": { + "directory_entry": true + } + } + }, + "directory_resources": { + "workflows/governance/cite-check-downstream-pr/SKILL.md": "original" + } +} diff --git a/src/inferrsi/knowledge/compositions/claim-contract.json b/src/inferrsi/knowledge/compositions/claim-contract.json new file mode 100644 index 000000000..d92513676 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/claim-contract.json @@ -0,0 +1,113 @@ +{ + "authority": "checkout", + "metadata": { + "id": "claim-contract", + "kind": "skill", + "entrypoint": "workflows/governance/claim-contract/SKILL.md", + "title": "Enforce ThinkFlowLab claim contract wording and verdict rules without embedding campaign-specific revision pins.", + "origin": [ + "first-party" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/claim-contract/SKILL.md", + "sha256": "49cf787427e7842fc0b8cbc1e58091fc4b77a5a48c0cb8fb7aaecd91f8715670" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Wording and verdict rules for any public performance or quality claim produced from an RSI campaign", + "prerequisites": "A completed campaign with pinned baseline and candidate SHAs and an evidence tree; the rules themselves carry no numeric threshold", + "input_contract": "A claim draft, the campaign RunSpec and its evidence tree under evidence//", + "produced_artifact": "A claim sentence in the pinned form, or a refusal when the campaign verdict is not PASS", + "failure_modes": [ + "Claim asserted before the campaign reaches PASS with artifacts", + "Baseline or candidate SHA written into a shared template, skill or default CI environment", + "Microbenchmark result presented as end-to-end completion", + "A lesson transferred across an unverified repo x revision x backend x device x model x scenario tuple" + ], + "refusal_point": "Refuses any public claim lacking a PASS verdict and artifacts under evidence/, and refuses numeric thresholds because thresholds belong to the campaign" + }, + "state": "candidate", + "limitations": [ + "States wording and verdict rules only; it selects no numeric gate and validates no measurement.", + "SIAS plane boundaries constrain where a change belongs, not whether it is correct.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "required_resources": [ + "workflows/governance/claim-contract/SKILL.md" + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "checkout:claim-contract.original.navigation", + "revision": "sha256:d2f6c70f089f343d7c171908d246a9dcc77d779cc11986fe889427d862714751" + }, + "decision": { + "ref": "checkout:claim-contract.original.decision", + "revision": "sha256:337562c8059d2a81b1d848e8436418561ee6958a9d6811b586a5264e1b378f45" + }, + "procedure": { + "ref": "checkout:claim-contract.original.procedure", + "revision": "sha256:cb40386d2f1e23802aa5c49aec8996cfa1208a8653b0d5e9bcc4bf0e218b7b8a", + "requires": [ + "decision" + ] + }, + "original": { + "ref": "checkout:claim-contract.original", + "revision": "sha256:48a0083d0536885a3b9f95e616dc59fbc2259bd896bf8909d5847608bf3d8d61" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "decision" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure" + ] + }, + "original": { + "layer": "L3", + "required": [ + "original" + ] + } + }, + "skill": { + "directory_entry": true + } + } + }, + "directory_resources": { + "workflows/governance/claim-contract/SKILL.md": "original" + } +} diff --git a/src/inferrsi/knowledge/compositions/competitor-scan.json b/src/inferrsi/knowledge/compositions/competitor-scan.json new file mode 100644 index 000000000..1f2a73e11 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/competitor-scan.json @@ -0,0 +1,112 @@ +{ + "authority": "checkout", + "metadata": { + "id": "competitor-scan", + "kind": "skill", + "entrypoint": "workflows/research/competitor-scan/SKILL.md", + "title": "Structure a lightweight competitive scan without inventing benchmark numbers or campaign verdicts.", + "origin": [ + "first-party" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/research/competitor-scan/SKILL.md", + "sha256": "7f2613a1fc8e9fc58c3058c4946b85e8d7d49359143d650f711b88b448307ab6" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Qualitative positioning of a new RSI repository against other projects before acceptance evidence exists", + "prerequisites": "A selected repository and readable public material from the alternatives; no benchmark run is required", + "input_contract": "A target repository plus whatever the alternatives publish about what they optimize and how they prove it", + "produced_artifact": "A short Markdown note covering problem, alternatives, differentiation, limits and open questions", + "failure_modes": [ + "Numeric comparison written without a PASS campaign in our own evidence tree", + "Third-party figure repeated as if reproduced under our RunSpec", + "Scan presented as a substitute for acceptance evidence" + ], + "refusal_point": "Refuses any numeric comparison not sourced from our own evidence//results/ with a PASS verdict" + }, + "state": "candidate", + "limitations": [ + "Produces positioning material only; it establishes no performance or quality result.", + "Third-party claim contracts are read from public material and may be incomplete.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "required_resources": [ + "workflows/research/competitor-scan/SKILL.md" + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "checkout:competitor-scan.original.navigation", + "revision": "sha256:c46ae5cb4cf5f037b6146958acee5900aec243db006ee22fd7da4f06f7c470d3" + }, + "decision": { + "ref": "checkout:competitor-scan.original.decision", + "revision": "sha256:713da9406604deda0a7591caec86abc3e822b6b4384c82cfb80b3339a1c6b69f" + }, + "procedure": { + "ref": "checkout:competitor-scan.original.procedure", + "revision": "sha256:67a1f0929b2d6ddec7b391cced8d315ccdd221af7a946bd0e86d7754eda936dd", + "requires": [ + "decision" + ] + }, + "original": { + "ref": "checkout:competitor-scan.original", + "revision": "sha256:d5e7b6d2f6cd46d171143ce6196ec851b06e2c9a35724a93f2203023569ba188" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "decision" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure" + ] + }, + "original": { + "layer": "L3", + "required": [ + "original" + ] + } + }, + "skill": { + "directory_entry": true + } + } + }, + "directory_resources": { + "workflows/research/competitor-scan/SKILL.md": "original" + } +} diff --git a/tests/knowledge/test_atomic_workflows.py b/tests/knowledge/test_atomic_workflows.py new file mode 100644 index 000000000..b3f9b4a7d --- /dev/null +++ b/tests/knowledge/test_atomic_workflows.py @@ -0,0 +1,129 @@ +"""Replay the v0.3.4 public Workflow contracts on an independently sealed installation.""" + +import json +import shutil +from pathlib import Path + +import pytest + +from inferrsi.knowledge.atomic_build import build_generation +from inferrsi.knowledge.atomic_generation import InstalledGeneration +from inferrsi.knowledge.catalog import _skill_search_source +from inferrsi.knowledge.decision_cards import DecisionSource +from tests.knowledge.test_atomic_casebooks import assert_empty, canonical, digest, select +from tests.knowledge.test_atomic_generation import RELEASE_ROOT, make_author_root +from tests.knowledge.test_atomic_reader import allow + +FIXTURE = Path(__file__).resolve().parents[1] / "fixtures/atomic-reader/workflow-domain-v0.3.4.json" +RELEASE = json.loads(FIXTURE.read_bytes()) +KNOWLEDGE = FIXTURE.parents[3] / "src/inferrsi/knowledge" +GUIDES = ("cite-check-downstream-pr", "claim-contract", "competitor-scan") + + +@pytest.fixture(scope="module") +def workflow_installation(tmp_path_factory): + root = tmp_path_factory.mktemp("workflows") + author = make_author_root(root) + pinned = root / "release" + shutil.copytree(RELEASE_ROOT, pinned) + (author / "atoms/workflows").mkdir() + for name in GUIDES: + row = RELEASE["refs"]["checkout:" + name] + atom = f"atoms/{name}.original.json" + descriptor = json.loads((KNOWLEDGE / atom).read_bytes()) + body = "atoms/" + descriptor["content"]["guide.md"]["path"] + for relative in (atom, body, f"compositions/{name}.json"): + shutil.copyfile(KNOWLEDGE / relative, author / relative) + data = (author / body).read_bytes() + assert RELEASE["files"][row["entry_source"]] == {"sha256": digest(data), "bytes": len(data)} + assert row["required_resources"] == {row["entry_source"]: digest(data)} + assert row["dependencies"] == {} and row["relative_guide_links"] == {} + original = pinned / descriptor["metadata"]["sources"][0]["path"] + original.parent.mkdir(parents=True, exist_ok=True) + original.write_bytes(data) + target = root / "installed" + generation = build_generation(author, target, permits=allow, + source_roots={RELEASE["source_commit"]: pinned}) + return InstalledGeneration(target, expected=generation), target + + +@pytest.mark.parametrize("name", GUIDES) +def test_checkout_host_and_layered_selection_preserve_workflow_guide(workflow_installation, name): + installed, target = workflow_installation + ref = "checkout:" + name + row = RELEASE["refs"][ref] + guide = row["entry_source"] + assert installed.skills[name] == ref + revision = installed.catalog[ref]["revision"] + _, bundle = installed.read_resolved(ref, revision=revision) + host = target / "skills" / name + raw = (host / "SKILL.md").read_bytes() + assert sorted(p.name for p in host.iterdir()) == ["SKILL.md"] + assert bundle.content == {guide: raw} and bundle.dependencies == {} + assert bundle.metadata["required_resources"] == [guide] + assert digest(raw) == row["entry_sha256"] == row["guide_sha256"] + assert digest(canonical(bundle.view()["resources"])) == row["resource_set"] + assert bundle.metadata["state"] == "candidate" and bundle.metadata["origin"] == ["first-party"] + results = {} + for layer in ("L0", "L1", "L2", "L3"): + selected = select(installed, ref, layer, len(raw)) + assert selected.receipt["status"] == "delivered" + size = sum(map(len, selected.bodies)) + assert size == selected.receipt["body_bytes"] + assert select(installed, ref, layer, size) == selected + short = select(installed, ref, layer, size - 1) + assert_empty(short, "over_budget") + assert short.receipt["required_bytes"] == size + stale = select(installed, ref, layer, size, revision=row["revision"]) + assert_empty(stale, "unavailable_revision") + for item, body in zip(selected.receipt["delivered"], selected.bodies, strict=True): + lo, hi = item["source_byte_range"] + assert item["source"]["commit"] == RELEASE["source_commit"] + assert item["source_path"] == "src/inferrsi/knowledge/data/skill_library/" + guide + assert item["source_range_verification"] == "verified_at_build" + assert body == raw[lo:hi] and digest(body) == item["source_sha256"] + for denied in [ref, *(item["ref"] for item in selected.receipt["delivered"])]: + result = select(installed, ref, layer, size, permits=lambda pin, op: pin.ref != denied) + assert_empty(result, "permission_denied") + results[layer] = selected.bodies + (navigation,) = results["L0"] + assert raw.startswith(navigation) and name.encode() in navigation + assert b"description:" in navigation + assert b"metadata:" not in navigation + (decision,) = results["L1"] + _, fields = _skill_search_source(decision.decode()) + assert fields["empirical_validation"] == bundle.metadata["empirical_validation"] == "not_run" + projected = DecisionSource(ref, revision, "skill", guide, guide, fields).project()["card"] + assert projected["revision"] == revision + compared = {**projected, "revision": row["revision"]} + assert digest(canonical(compared)) == row["card_sha256"] + assert len(canonical(compared)) == row["card_bytes"] + assert compared["status"] == row["status"] == "partial" + assert compared["missing_fields"] == row["missing_fields"] == ["validation"] + assert results["L2"][0] == decision and b"".join(results["L2"]) == raw + assert results["L3"] == (raw,) + + +@pytest.mark.parametrize("name", GUIDES) +def test_package_baseline_has_its_own_card_and_shared_dependency(workflow_installation, name): + _, target = workflow_installation + checkout = RELEASE["refs"]["checkout:" + name] + (ref, row), = [ + (key, value) for key, value in RELEASE["refs"].items() + if key.startswith("package:") and value["entry_source"] == checkout["entry_source"] + ] + assert row["entrypoint"] == "record.json" and row["entry_sha256"] != checkout["entry_sha256"] + assert row["guide_sha256"] == checkout["guide_sha256"] + assert row["revision"] != checkout["revision"] + assert row["required_count"] == 1 + RELEASE["shared_members"] == 716 + assert row["dependencies"] == {"data/skill_library": RELEASE["shared_dependency"]} + guide = row["guide"] + assert guide == "data/skill_library/" + checkout["guide"] + body = (target / "skills" / name / "SKILL.md").read_text(encoding="utf-8") + _, fields = _skill_search_source(body) + old = DecisionSource(ref, row["revision"], "skill", guide, guide, fields) + exact = old.project(max_bytes=row["card_bytes"]) + assert digest(canonical(exact["card"])) == row["card_sha256"] + assert row["card_sha256"] != checkout["card_sha256"] + short = old.project(max_bytes=row["card_bytes"] - 1) + assert short["status"] == "over_budget" and "card" not in short From c2c4c9754aa340502d6897cd99fb1603000ffd35 Mon Sep 17 00:00:00 2001 From: Dong1017 <55723162+Dong1017@users.noreply.github.com> Date: Fri, 27 Nov 2026 04:25:52 +0800 Subject: [PATCH 10/12] Reject directory Skill routes that reorder the original guide Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com> --- src/inferrsi/knowledge/atomic_skill_directory.py | 10 +++++----- tests/knowledge/test_atomic_casebook_entries.py | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/inferrsi/knowledge/atomic_skill_directory.py b/src/inferrsi/knowledge/atomic_skill_directory.py index 826885867..3a61e7c90 100644 --- a/src/inferrsi/knowledge/atomic_skill_directory.py +++ b/src/inferrsi/knowledge/atomic_skill_directory.py @@ -37,20 +37,20 @@ def _verify_directory_routes(declaration, bindings, guide, source, material): for layer, names in (("L0", ["navigation"]), ("L1", ["decision"]), ("L2", ["decision", "procedure"]), ("L3", [])): selected = select_routes(declaration, layer=layer, context={}, case=None, finding=None) - pins = {use.pin for use in selected.required} + pins = dict.fromkeys(use.pin for use in selected.required) if layer == "L3": - if pins != originals: + if pins.keys() != originals: raise ValueError("Skill L3 must deliver the complete original directory") continue - actual = set() + actual = [] for pin in pins: if pin not in material: raise ValueError(f"Missing pinned Skill section: {pin.ref}") origin = material[pin][1] if origin["source"] != source: raise ValueError(f"Skill {layer} must deliver its own pinned guide sections") - actual.add((origin["layer"], *origin["source_byte_range"])) - if actual != {sections[name] for name in names}: + actual.append((origin["layer"], *origin["source_byte_range"])) + if actual != [sections[name] for name in names]: raise ValueError(f"Skill {layer} must deliver its own pinned guide sections") diff --git a/tests/knowledge/test_atomic_casebook_entries.py b/tests/knowledge/test_atomic_casebook_entries.py index 2d998e829..fd8deaf5a 100644 --- a/tests/knowledge/test_atomic_casebook_entries.py +++ b/tests/knowledge/test_atomic_casebook_entries.py @@ -163,6 +163,7 @@ def test_directory_read_selection_replays_each_layer_and_refuses_incomplete_grou ("dropped file and declaration", "complete original directory"), ("wrong alias", "original relative source"), ("excerpt", "complete L3 original"), ("missing L3 attachment", "L3 must deliver"), ("omitted prerequisite", "L2 must deliver"), + ("reversed guide sections", "L2 must deliver"), ("another guide decision", "L1 must deliver"), ("wrong section", "source range or layer"), ("conditional override", "unconditional delivery"), ("unbound host export", "requires checked"), ("identity", "original SKILL.md and identity"), @@ -187,6 +188,9 @@ def test_cannot_publish_a_partial_or_misbound_directory(tmp_path, casebook_files declaration["routes"]["originals"]["required"].remove(bindings[attachment]) elif change == "omitted prerequisite": del declaration["nodes"]["procedure"]["requires"] + elif change == "reversed guide sections": + del declaration["nodes"]["procedure"]["requires"] + declaration["routes"]["procedure"]["required"] = ["procedure", "decision"] elif change == "another guide decision": other = json.loads((path.parent / "ascend-optimization-casebook.json").read_bytes()) declaration["nodes"]["decision"] = other["metadata"]["composition"]["nodes"]["decision"] From 74cd2059f4c1c287b76b0ae90170f0b5d8d9cf06 Mon Sep 17 00:00:00 2001 From: Dong1017 <55723162+Dong1017@users.noreply.github.com> Date: Fri, 27 Nov 2026 04:42:26 +0800 Subject: [PATCH 11/12] Migrate the NPU skill factory reference directory Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com> --- .../npu-skill-factory.bounded-updates.json | 96 ++++++ .../atoms/npu-skill-factory.comparison.json | 96 ++++++ .../npu-skill-factory.evidence-routing.json | 96 ++++++ .../npu-skill-factory.integration_notes.json | 96 ++++++ .../npu-skill-factory.learning-to-commit.json | 96 ++++++ ...l-factory.methodology-counterexamples.json | 96 ++++++ .../atoms/npu-skill-factory.original.json | 177 ++++++++++ .../npu-skill-factory.protocol-details.json | 96 ++++++ .../knowledge/atoms/npu-skill-factory.qa.json | 96 ++++++ .../atoms/npu-skill-factory.readme.json | 96 ++++++ .../atoms/npu-skill-factory.readset.json | 96 ++++++ .../npu-skill-factory.repo-to-skill.json | 96 ++++++ ...factory.skill-factory-design-20261014.json | 96 ++++++ .../atoms/npu-skill-factory.skillopt.json | 96 ++++++ .../npu-skill-factory.source-manifest.json | 96 ++++++ .../atoms/npu-skill-factory.trace2skill.json | 96 ++++++ .../atoms/npu-skill-factory.unread_leads.json | 96 ++++++ .../atoms/workflows/npu-skill-factory.md | 221 +++++++++++++ .../references/papers-20261015/COMPARISON.md | 28 ++ .../papers-20261015/INTEGRATION_NOTES.md | 51 +++ .../references/papers-20261015/QA.md | 18 ++ .../references/papers-20261015/README.md | 24 ++ .../papers-20261015/UNREAD_LEADS.md | 7 + .../cases/methodology-counterexamples.md | 51 +++ .../knowledge/evidence-routing.md | 51 +++ .../references/learning-to-commit.md | 32 ++ .../references/protocol-details.md | 49 +++ .../papers-20261015/references/readset.md | 65 ++++ .../references/repo-to-skill.md | 28 ++ .../papers-20261015/references/skillopt.md | 33 ++ .../references/source-manifest.json | 74 +++++ .../papers-20261015/references/trace2skill.md | 32 ++ .../updates/bounded-updates.md | 69 ++++ .../skill-factory-design-20261014.md | 187 +++++++++++ .../compositions/npu-skill-factory.json | 301 ++++++++++++++++++ tests/knowledge/test_atomic_workflows.py | 87 +++-- 36 files changed, 3098 insertions(+), 23 deletions(-) create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.bounded-updates.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.comparison.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.evidence-routing.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.integration_notes.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.learning-to-commit.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.methodology-counterexamples.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.original.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.protocol-details.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.qa.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.readme.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.readset.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.repo-to-skill.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.skill-factory-design-20261014.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.skillopt.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.source-manifest.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.trace2skill.json create mode 100644 src/inferrsi/knowledge/atoms/npu-skill-factory.unread_leads.json create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/COMPARISON.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/INTEGRATION_NOTES.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/QA.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/README.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/UNREAD_LEADS.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/knowledge/evidence-routing.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/protocol-details.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/readset.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/repo-to-skill.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/skillopt.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/source-manifest.json create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/trace2skill.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/updates/bounded-updates.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/skill-factory-design-20261014.md create mode 100644 src/inferrsi/knowledge/compositions/npu-skill-factory.json diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.bounded-updates.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.bounded-updates.json new file mode 100644 index 000000000..50cd2995f --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.bounded-updates.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Bounded amendments to existing methodology artifacts", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/updates/bounded-updates.md", + "sha256": "529c363e9c678f33f7c0be0420d26c64d056321f041726362dba69e53e1e375e" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.bounded-updates", + "kind": "knowledge", + "entrypoint": "bounded-updates.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/updates/bounded-updates.md", + "byte_range": [ + 0, + 7695 + ], + "sha256": "529c363e9c678f33f7c0be0420d26c64d056321f041726362dba69e53e1e375e" + } + } + }, + "content": { + "bounded-updates.md": { + "path": "workflows/npu-skill-factory/references/papers-20261015/updates/bounded-updates.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.comparison.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.comparison.json new file mode 100644 index 000000000..d089ced43 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.comparison.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Comparison: choose the artifact before choosing the learning method", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/COMPARISON.md", + "sha256": "38587678a96581f5c2dc697d982127343565504bffa191352811dffcc165aa23" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.comparison", + "kind": "knowledge", + "entrypoint": "COMPARISON.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/COMPARISON.md", + "byte_range": [ + 0, + 4267 + ], + "sha256": "38587678a96581f5c2dc697d982127343565504bffa191352811dffcc165aa23" + } + } + }, + "content": { + "COMPARISON.md": { + "path": "workflows/npu-skill-factory/references/papers-20261015/COMPARISON.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.evidence-routing.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.evidence-routing.json new file mode 100644 index 000000000..1b59a11c8 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.evidence-routing.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Candidate knowledge: evidence-to-artifact admission", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/knowledge/evidence-routing.md", + "sha256": "406d5d74c3fef4c1a23d495492e21a084c3c46495a1a84b385703ed104358874" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.evidence-routing", + "kind": "knowledge", + "entrypoint": "evidence-routing.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/knowledge/evidence-routing.md", + "byte_range": [ + 0, + 5282 + ], + "sha256": "406d5d74c3fef4c1a23d495492e21a084c3c46495a1a84b385703ed104358874" + } + } + }, + "content": { + "evidence-routing.md": { + "path": "workflows/npu-skill-factory/references/papers-20261015/knowledge/evidence-routing.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.integration_notes.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.integration_notes.json new file mode 100644 index 000000000..686570630 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.integration_notes.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Pack E integration notes", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/INTEGRATION_NOTES.md", + "sha256": "fbc4a96b6f6c477706eed83eaa4fcc29a14f881637629d6c004601ed049f2523" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.integration_notes", + "kind": "knowledge", + "entrypoint": "INTEGRATION_NOTES.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/INTEGRATION_NOTES.md", + "byte_range": [ + 0, + 5557 + ], + "sha256": "fbc4a96b6f6c477706eed83eaa4fcc29a14f881637629d6c004601ed049f2523" + } + } + }, + "content": { + "INTEGRATION_NOTES.md": { + "path": "workflows/npu-skill-factory/references/papers-20261015/INTEGRATION_NOTES.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.learning-to-commit.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.learning-to-commit.json new file mode 100644 index 000000000..b34c129e9 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.learning-to-commit.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Learning to Commit evidence ledger", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md", + "sha256": "9c2d1d738e896d05c00f53e6adf14c9df2501ecc3f0020e71b5a1c2192547086" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.learning-to-commit", + "kind": "knowledge", + "entrypoint": "learning-to-commit.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md", + "byte_range": [ + 0, + 2847 + ], + "sha256": "9c2d1d738e896d05c00f53e6adf14c9df2501ecc3f0020e71b5a1c2192547086" + } + } + }, + "content": { + "learning-to-commit.md": { + "path": "workflows/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.methodology-counterexamples.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.methodology-counterexamples.json new file mode 100644 index 000000000..5150ce1c1 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.methodology-counterexamples.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Candidate cases: where seemingly useful rules fail", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md", + "sha256": "f9fc21753ea41eef77ca020d78d031e945e5dd835b5d09c5ff0e53749ceb2ca4" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.methodology-counterexamples", + "kind": "knowledge", + "entrypoint": "methodology-counterexamples.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md", + "byte_range": [ + 0, + 5213 + ], + "sha256": "f9fc21753ea41eef77ca020d78d031e945e5dd835b5d09c5ff0e53749ceb2ca4" + } + } + }, + "content": { + "methodology-counterexamples.md": { + "path": "workflows/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.original.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.original.json new file mode 100644 index 000000000..dc58eda75 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.original.json @@ -0,0 +1,177 @@ +{ + "authority": "checkout", + "metadata": { + "id": "npu-skill-factory.original", + "kind": "knowledge", + "entrypoint": "guide.md", + "title": "Design and operation of the InferRSI NPU skill factory: artifact lifecycle, skill evaluation contract, corpus selection, hide-and-re-distill procedure, and skill evolution cycle. Use when deciding where new skill artifacts belong, how to distill a candidate skill, or how to run the No-Skill vs Human-Skill vs Distilled-Skill comparison.\n", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/SKILL.md", + "sha256": "0de28180da76b6cb9d2c9456733011d00d9801f7662afd32959c4c5d2c05a183" + }, + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "prerequisites": "Current candidate inventory and source/evaluation evidence; historical sibling execution interfaces are not required for read-only artifact admission", + "input_contract": "A candidate inventory plus the source and evaluation evidence for each candidate skill; read-only artifact admission needs no historical sibling execution interface", + "produced_artifact": "An admitted or refused skill candidate with its source, evidence and limitation record, and its stable id and owning path", + "failure_modes": [ + "A candidate admitted on an inventory line without source or evaluation evidence", + "A stable id or path assigned twice across owners", + "Indexing or admission reported as validation or promotion", + "Paper-to-code equivalence asserted without a pinned readset" + ], + "refusal_point": "Refuses admission when a candidate has neither source evidence nor a declared evaluation state, and records the refusal instead of leaving the field blank" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/SKILL.md", + "byte_range": [ + 0, + 11624 + ], + "sha256": "0de28180da76b6cb9d2c9456733011d00d9801f7662afd32959c4c5d2c05a183" + } + } + }, + "content": { + "guide.md": { + "path": "workflows/npu-skill-factory.md" + } + }, + "parts": { + "navigation": { + "skill_section": "navigation", + "layer": "L0", + "byte_range": [ + 0, + 385 + ], + "sha256": "df91dcc575a6ec332c874761c80dc3725ff531ed9ac338ab41c2dad19faa8953" + }, + "decision": { + "skill_section": "decision", + "layer": "L1", + "byte_range": [ + 0, + 5501 + ], + "sha256": "a4cb3276728abb08b2b1aac66c7a353809ce824bf93cb38d8a621d5e46a2bcfc" + }, + "procedure": { + "skill_section": "procedure", + "layer": "L2", + "byte_range": [ + 5501, + 11624 + ], + "sha256": "e69b99de5ee65ed9d6289811b3993913961968184c4d8ee234def2bf4364db9a" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.protocol-details.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.protocol-details.json new file mode 100644 index 000000000..f1b74f43e --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.protocol-details.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Protocol details and unreported quantities", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/references/protocol-details.md", + "sha256": "41298c6bde3a28f0712fa06a18bbc4ac59aea6d17cc9eb1318744f4121e3bab6" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.protocol-details", + "kind": "knowledge", + "entrypoint": "protocol-details.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/references/protocol-details.md", + "byte_range": [ + 0, + 6520 + ], + "sha256": "41298c6bde3a28f0712fa06a18bbc4ac59aea6d17cc9eb1318744f4121e3bab6" + } + } + }, + "content": { + "protocol-details.md": { + "path": "workflows/npu-skill-factory/references/papers-20261015/references/protocol-details.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.qa.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.qa.json new file mode 100644 index 000000000..0cb9f0e7e --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.qa.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Pack E delivery QA", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/QA.md", + "sha256": "3f3785ec39a6938a5d1f2e874e99153fe92c0e666dd3e78a499c8b47d891346a" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.qa", + "kind": "knowledge", + "entrypoint": "QA.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/QA.md", + "byte_range": [ + 0, + 1853 + ], + "sha256": "3f3785ec39a6938a5d1f2e874e99153fe92c0e666dd3e78a499c8b47d891346a" + } + } + }, + "content": { + "QA.md": { + "path": "workflows/npu-skill-factory/references/papers-20261015/QA.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.readme.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.readme.json new file mode 100644 index 000000000..b83861994 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.readme.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Pack E — Evidence into repository memory and bounded skills", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/README.md", + "sha256": "221785e91c45588f82b3caab6d52f1ea1d102b16139c20a0802921e2789e6d28" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.readme", + "kind": "knowledge", + "entrypoint": "README.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/README.md", + "byte_range": [ + 0, + 2151 + ], + "sha256": "221785e91c45588f82b3caab6d52f1ea1d102b16139c20a0802921e2789e6d28" + } + } + }, + "content": { + "README.md": { + "path": "workflows/npu-skill-factory/references/papers-20261015/README.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.readset.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.readset.json new file mode 100644 index 000000000..4b2a1aef7 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.readset.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Exact readset and availability", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/references/readset.md", + "sha256": "6f953d20d8958c68339c9ceeae348604d0fea3e9c6ccb9b64a63d3b210426a22" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.readset", + "kind": "knowledge", + "entrypoint": "readset.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/references/readset.md", + "byte_range": [ + 0, + 7086 + ], + "sha256": "6f953d20d8958c68339c9ceeae348604d0fea3e9c6ccb9b64a63d3b210426a22" + } + } + }, + "content": { + "readset.md": { + "path": "workflows/npu-skill-factory/references/papers-20261015/references/readset.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.repo-to-skill.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.repo-to-skill.json new file mode 100644 index 000000000..06f1302b5 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.repo-to-skill.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Repo-To-Skill evidence ledger", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/references/repo-to-skill.md", + "sha256": "5ebdac2a2bbbe6614f9d4096bc9895bd685acdf76414e2c3c1fb7b50d57c738d" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.repo-to-skill", + "kind": "knowledge", + "entrypoint": "repo-to-skill.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/references/repo-to-skill.md", + "byte_range": [ + 0, + 3151 + ], + "sha256": "5ebdac2a2bbbe6614f9d4096bc9895bd685acdf76414e2c3c1fb7b50d57c738d" + } + } + }, + "content": { + "repo-to-skill.md": { + "path": "workflows/npu-skill-factory/references/papers-20261015/references/repo-to-skill.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.skill-factory-design-20261014.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.skill-factory-design-20261014.json new file mode 100644 index 000000000..475209496 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.skill-factory-design-20261014.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Skill factory design detail (historical, 2026-10-14/15)", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/skill-factory-design-20261014.md", + "sha256": "0b2e05bb6a4a3b3f6df0b04abc40ec125be60714b87f609a390246ee2a292d2d" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.skill-factory-design-20261014", + "kind": "knowledge", + "entrypoint": "skill-factory-design-20261014.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/skill-factory-design-20261014.md", + "byte_range": [ + 0, + 9435 + ], + "sha256": "0b2e05bb6a4a3b3f6df0b04abc40ec125be60714b87f609a390246ee2a292d2d" + } + } + }, + "content": { + "skill-factory-design-20261014.md": { + "path": "workflows/npu-skill-factory/references/skill-factory-design-20261014.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.skillopt.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.skillopt.json new file mode 100644 index 000000000..ba72a590d --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.skillopt.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "SkillOpt evidence ledger", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/references/skillopt.md", + "sha256": "148075daa67e19f4b4351710498438d17c279a9bce56b2d01cab26ff3be33e99" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.skillopt", + "kind": "knowledge", + "entrypoint": "skillopt.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/references/skillopt.md", + "byte_range": [ + 0, + 3040 + ], + "sha256": "148075daa67e19f4b4351710498438d17c279a9bce56b2d01cab26ff3be33e99" + } + } + }, + "content": { + "skillopt.md": { + "path": "workflows/npu-skill-factory/references/papers-20261015/references/skillopt.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.source-manifest.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.source-manifest.json new file mode 100644 index 000000000..3670b8685 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.source-manifest.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Paper and handoff source manifest", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/references/source-manifest.json", + "sha256": "716cd49ed01824ee9f6b6fc55ebf2b24fdd5d5a3e677f6e28e34a472616bbe25" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.source-manifest", + "kind": "knowledge", + "entrypoint": "source-manifest.json", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/references/source-manifest.json", + "byte_range": [ + 0, + 2431 + ], + "sha256": "716cd49ed01824ee9f6b6fc55ebf2b24fdd5d5a3e677f6e28e34a472616bbe25" + } + } + }, + "content": { + "source-manifest.json": { + "path": "workflows/npu-skill-factory/references/papers-20261015/references/source-manifest.json" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.trace2skill.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.trace2skill.json new file mode 100644 index 000000000..38da19d3e --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.trace2skill.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Trace2Skill evidence ledger", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/references/trace2skill.md", + "sha256": "230d13b77ba819b5e3edee147523e8cad6bfce95afccc140fb4946d6c8747a2e" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.trace2skill", + "kind": "knowledge", + "entrypoint": "trace2skill.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/references/trace2skill.md", + "byte_range": [ + 0, + 2917 + ], + "sha256": "230d13b77ba819b5e3edee147523e8cad6bfce95afccc140fb4946d6c8747a2e" + } + } + }, + "content": { + "trace2skill.md": { + "path": "workflows/npu-skill-factory/references/papers-20261015/references/trace2skill.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/npu-skill-factory.unread_leads.json b/src/inferrsi/knowledge/atoms/npu-skill-factory.unread_leads.json new file mode 100644 index 000000000..53a08389b --- /dev/null +++ b/src/inferrsi/knowledge/atoms/npu-skill-factory.unread_leads.json @@ -0,0 +1,96 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Unread literature lead — separate from the approved extraction", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/UNREAD_LEADS.md", + "sha256": "6c1d87ebe491d27666703149eb05ad582c7e5aff77f0ac5c11a7b89c946f96ee" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "workflow": "checkout:npu-skill-factory" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "id": "npu-skill-factory.unread_leads", + "kind": "knowledge", + "entrypoint": "UNREAD_LEADS.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/references/papers-20261015/UNREAD_LEADS.md", + "byte_range": [ + 0, + 1038 + ], + "sha256": "6c1d87ebe491d27666703149eb05ad582c7e5aff77f0ac5c11a7b89c946f96ee" + } + } + }, + "content": { + "UNREAD_LEADS.md": { + "path": "workflows/npu-skill-factory/references/papers-20261015/UNREAD_LEADS.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory.md new file mode 100644 index 000000000..4e99c29f3 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory.md @@ -0,0 +1,221 @@ +--- +name: npu-skill-factory +description: 'Design and operation of the InferRSI NPU skill factory: artifact lifecycle, skill evaluation contract, corpus selection, hide-and-re-distill procedure, and skill evolution cycle. Use when deciding where new skill artifacts belong, how to distill a candidate skill, or how to run the No-Skill vs Human-Skill vs Distilled-Skill comparison. + + ' +metadata: + inferrsi: | + { + "schema_version": 1, + "status": "candidate", + "sources": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "verification": { + "locally_verified": false, + "evidence_level": "source_grounded", + "note": "Historical repository extraction and sibling schema at 82218b4, not a current local factory implementation. Reviewed paper additions and exact versions live in references/papers-20261015/references/readset.md and docs/reference-matrix.md; no efficacy or paper-to-code equivalence established." + }, + "applicability": { + "scope": "InferRSI skill lifecycle management", + "prerequisites": "Current candidate inventory and source/evaluation evidence; historical sibling execution interfaces are not required for read-only artifact admission", + "input_contract": "A candidate inventory plus the source and evaluation evidence for each candidate skill; read-only artifact admission needs no historical sibling execution interface", + "produced_artifact": "An admitted or refused skill candidate with its source, evidence and limitation record, and its stable id and owning path", + "failure_modes": [ + "A candidate admitted on an inventory line without source or evaluation evidence", + "A stable id or path assigned twice across owners", + "Indexing or admission reported as validation or promotion", + "Paper-to-code equivalence asserted without a pinned readset" + ], + "refusal_point": "Refuses admission when a candidate has neither source evidence nor a declared evaluation state, and records the refusal instead of leaving the field blank" + }, + "recommendations": [ + "Read the methodology counterexamples in references/papers-20261015/cases/ before admitting a candidate derived from a paper.", + "Keep the source snapshot revision as research evidence; it is not a campaign default.", + "Record an unvalidated candidate as candidate with not_run rather than omitting the state." + ], + "tags": [ + "skill-factory", + "distillation", + "evaluation", + "npu", + "ascend" + ], + "profile": "local-skill-v1", + "kind": "skill", + "origin": [ + "external" + ], + "empirical_validation": "not_run", + "limitations": [ + "Source-derived candidate; no local efficacy validation." + ], + "provenance_readsets": [ + "references/papers-20261015/cases/methodology-counterexamples.md", + "references/papers-20261015/COMPARISON.md", + "references/papers-20261015/INTEGRATION_NOTES.md", + "references/papers-20261015/knowledge/evidence-routing.md", + "references/papers-20261015/QA.md", + "references/papers-20261015/README.md", + "references/papers-20261015/references/learning-to-commit.md", + "references/papers-20261015/references/protocol-details.md", + "references/papers-20261015/references/readset.md", + "references/papers-20261015/references/repo-to-skill.md", + "references/papers-20261015/references/skillopt.md", + "references/papers-20261015/references/trace2skill.md", + "references/papers-20261015/UNREAD_LEADS.md", + "references/papers-20261015/updates/bounded-updates.md" + ], + "consumption_mode": "packaged", + "searchspace_not_applicable": "SKILL.md §§ Choose the evidence product, Artifact lifecycle, and What this skill does not do define skill-distillation/evaluation methodology; NPU task tiers are evaluation prerequisites, not a hardware-resource mechanism." + } +--- + +# NPU Skill Factory Design + +Status: candidate. A Tier A pilot was reported by the sibling workstream on +2026-10-14; it was not integrated or rerun here. This skill supplies methodology, +not an implemented factory or automatic promotion pipeline. + +## Choose the evidence product + +Choose a case, reusable knowledge, bounded amendment or new skill according to +scope and workflow ownership. A new source need not create a new skill; a distinct +trigger, procedure and output can justify one. The +[evidence-routing note](references/papers-20261015/knowledge/evidence-routing.md), +[comparison](references/papers-20261015/COMPARISON.md), +[counterexamples](references/papers-20261015/cases/methodology-counterexamples.md) +and [exact paper readset](references/papers-20261015/references/readset.md) +retain the approved paper-level reasoning alongside the older repository pins. + +Keep source fidelity, static usability, execution correctness, behavioral efficacy +and transfer evidence separate. Construction, selection, deployment-context and +downstream costs need distinct denominators; a library entry or upstream score +is not local promotion. Source limitations and unrun checks remain explicit. + +Current candidate bundles live under `src/inferrsi/knowledge/data/skill_library///`, +with linked references and cases under their owning skill. The library's +`skill-index.json` maps stable skill names to those category paths. Exactly two primary matrices record provenance +and coverage. Do not invent a paper Git SHA or force these notes into a repository +knowledge-record schema that requires implementation fields they cannot supply. +The CLI explicitly reads metadata, instructions and resources; it implements no +factory, automatic routing or updater. Manual integration is not an AREX/DisCo run. + +## Artifact lifecycle + +The following lifecycle and schema are historical design references from the +sibling workstream and PR #9, not current implemented repository contracts. +Use the current candidate layout above for integration; historical evaluation +examples neither launch work nor set universal promotion thresholds. + +``` +1. Raw/preflight evidence + ↓ (exploration, repo cloning, index extraction — read-only) +2. Imported / distilled source material + ↓ (knowledge JSON records in repo_packs/, skill_library/ entries) +3. Candidate skill (SKILL.md + schema-validated bundle) + ↓ (3-5 candidates from a distillation run; status: candidate) +4. Skill evaluation + ↓ (No-Skill vs Human vs Distilled comparison on held-out tasks) +5. Promoted executable skill (in skills/) + ↓ (only after a passing evaluation campaign with PASS evidence) +6. Evolution (bounded edit → re-evaluation → accept/reject) +``` + +**Promotion rule:** directory placement does not establish promotion. The current +`skill_library/` tree includes explicitly labeled candidates. A candidate without an +authorized evaluation trail remains unvalidated regardless of packaging. + +**Where each artifact belongs:** + +| Artifact | Location | Format | +|----------|----------|--------| +| Knowledge records (experience) | `src/inferrsi/knowledge/data/skill_library/records/.json` | Validated JSON (catalog.py schema) | +| Bilingual skill library | `src/inferrsi/knowledge/data/skill_library/en//` and `zh-CN//` | SKILL.md + references/ + scripts/ | +| Skill bundle (distillation output) | `evidence//plan/agent-source-candidates/` | schema-validated JSON bundle | +| Human reference skill | `evidence//plan/human-/SKILL.md` | SKILL.md + references/ | +| Candidate skill under evaluation | `evidence//plan/agent-source-candidates//` | SKILL.md + references/ | +| Promoted skill | `skills//SKILL.md` (including metadata) | InferRSI skill format | +| Skill evaluation evidence | `evidence//results/` | per InferRSI evidence tree | + +Source: PR #9 `skill_library/` layout (source-grounded, pr/9 @ 4ad551a9); +sibling workstream `evidence/skill-bootstrap-20261014/` (observed @ 82218b4). + +## Design detail (historical, not implemented here) + +The full historical design records — the sibling bundle schema +(`schemas/skill-bundle.json`, not present in this repository), the selected +NPU corpus with license status, the Stage 3.4 hide-and-re-distill procedure +(its `omnirsi.harness.skill_distill` entrypoint is a sibling-workstream +prototype, also not in this repository), the Stage 3.5 three-variant evaluation +contract with its SkillOpt-derived accept criterion, the revision-lineage +layout and the Phase 1 evolution cycle — live in +[skill-factory-design-20261014.md](references/skill-factory-design-20261014.md), +preserved with their sources and the two sibling-prototype entrypoints annotated. + +Boundaries that still hold from that design: + +- The sibling pilot (one Tier A task, all three variants passing) established no + statistical difference; promotion remains INCONCLUSIVE. +- Tier A tasks are CPU/static only; Tier B tasks require an NPU device. +- Do not promote based on token cost alone; record skill build cost separately + from per-task runtime benefit. + +## Where to go next after Phase 1 + +Once the evaluation contract is validated on ≥1 Tier A task with ≥3 tasks and +≥2 repetitions: + +1. Add Tier B tasks (require a real NPU environment — REMOTE). +2. Expand corpus from `raw_npu_repos_metadata_only` in `preflight.json`: + priority order is Ascend/pytorch, then op-plugin, then triton-ascend, then msit. + Do not clone all four at once; state the capability/question first. +3. Implement harvest-from-real-agent-traces (SkillOpt Sleep cycle pattern). +4. Wire the skill router to select skill by detected repository type and task tier. + +## What this skill does not do + +- It does not claim that any distilled skill works on a real NPU — all current + evaluation is Tier A (CPU/static). +- It does not establish statistical significance from the current pilot. +- It does not manage the catalog or automatically route agents to skills. +- It does not provide the skill library management framework — that is PR #9. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/COMPARISON.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/COMPARISON.md new file mode 100644 index 000000000..b6bd3d37c --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/COMPARISON.md @@ -0,0 +1,28 @@ +# Comparison: choose the artifact before choosing the learning method + +All destinations below are P, candidate/not_run. The underlying F records and exact paper locators are in the linked ledgers. + +| Source | Distinct evidence contribution beyond the prior repository summaries | Best-fit artifact decision | Main boundary | +|---|---|---|---| +| [Repo-To-Skill v1](references/repo-to-skill.md) | Distinguishes source-anchored construction from task-conditioned pools; verification and construction cost are separate from downstream score | Existing factory's evidence/admission contract; retain a source-local case when the reusable workflow is not established | The benchmark gains are not a controlled test of the entire public repository library | +| [Learning to Commit v1](references/learning-to-commit.md) | A historical expert patch is a contrastive reference for the agent's own attempted change | Repository-scoped persistent knowledge, or a revision/deprecation of an existing convention | Chronology prevents the specified adaptation leakage, not every possible contamination path; accepted code is not necessarily the unique correct solution | +| [Trace2Skill v5](references/trace2skill.md) | Separates causally investigated errors from successful procedures; studies interactions among patches | Consolidated procedural knowledge and a candidate update to an existing skill | Faster parallel construction is not proof of lower aggregate compute or reliable routing to the skill | +| [SkillOpt v2](references/skillopt.md) | Separates proposed edits, accepted skill state, rejected-edit history, and optimizer-only memory | A bounded change proposal with an independent acceptance decision | Selection improvement is neither a formal generalization guarantee nor a permission to deploy | + +## P — Artifact selection rule + +- **Case:** preserve a bounded observation when the source is singular, applicability is uncertain, the explanation is unverified, or a negative example is most informative. Store the original outcome and alternatives; do not silently turn it into a universal instruction. +- **Persistent knowledge:** retain a stable source contract or a supported reusable relationship. State repository/model/harness/version scope and evidence strength. A procedural claim can remain knowledge until a reliable trigger and validation contract exist. +- **Bounded update:** choose this when a current skill already owns the workflow and the evidence supports a specific correction. Identify the exact incumbent version, target passage, expected behavioral change, possible regressions, and rollback. No current body means no literal patch application. +- **New skill:** choose this only for a separately triggerable, materially distinct workflow with inputs, procedure, constraints, outputs, and checks. A new paper, repository, or failure does not by itself justify a new skill. +- **No promotion:** keep the item as a case or knowledge record when causality, scope, source integrity, or the evaluation signal is insufficient. + +## P — Reconciliation rather than a universal winner + +Broad offline consolidation and cautious incremental editing solve different problems. Use consolidation to assemble a coherent candidate from an independent evidence pool. Use bounded updates to preserve an incumbent whose value is already known. The combination is a proposal here; none of these four papers establishes that this combined policy is optimal for InferRSI. + +A historical merge, static documentation check, execution correctness check, held-out behavioral win, and cross-model transfer result answer different questions. Keep separate fields for each rather than a single “verified” flag. Make source availability and empirical validity independent of whether an artifact has been extracted. + +## P — Cost decision + +Record construction cost, candidate-selection cost, deployment context cost, and downstream task cost separately. Amortization is a workload hypothesis: benefit across future uses must exceed one-time construction plus repeated context/selection cost. Faster wall time, a small exported file, or fewer accepted edits alone does not establish that inequality. This pack does not select an optimizer, compute budget, or hardware target. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/INTEGRATION_NOTES.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/INTEGRATION_NOTES.md new file mode 100644 index 000000000..da20f6109 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/INTEGRATION_NOTES.md @@ -0,0 +1,51 @@ +> Supplier integration proposal, preserved as historical source context (2026-10-15). The local owner review and current two matrices govern acceptance; suggested follow-ups and permission statements below do not authorize work or describe the current inventory. + +# Pack E integration notes + +Status: **candidate / not_run**. Independent paper-first deliverable, not a repository change. + +## What is incremental + +The prior work already names repository-memory construction, repo-to-skill lifecycle, Trace2Skill consolidation and bounded skill evolution. This pack adds original-paper evidence about what those mechanisms actually establish, their costs, their counterexamples, and the boundary between a case, knowledge, candidate construction and accepted update. It does not restate source-file pipeline maps or declare them absent. + +## Proposed integration destinations + +| Deliverable | Existing artifact target | Decision | +|---|---|---| +| [Evidence-routing knowledge](knowledge/evidence-routing.md) | `npu-skill-factory` references; link from `skill-evolution-playbook` | Reconcile as shared methodology knowledge, not a new factory/tool | +| [E-C1 and E-C4](cases/methodology-counterexamples.md) | Existing factory/evolution case references | Preserve task-condition and output-contract exceptions | +| [E-C2](cases/methodology-counterexamples.md#e-c2--better-repository-familiarity-can-produce-unnecessary-caution) | `repository-evolution-analysis` references | Repository-scoped convention-expiry case | +| [E-C3](cases/methodology-counterexamples.md#e-c3--fixing-targeted-failures-can-break-unrelated-successes) | `skill-evolution-playbook` references | Interaction/regression case | +| [E-U1–E-U5](updates/bounded-updates.md) | Existing skills identified per proposal | Compare latest bodies, retain only missing amendments; do not apply these as blind patches | +| [Four paper ledgers](COMPARISON.md) and [readset](references/readset.md) | `docs/reference-matrix.md` **§2 Methodology and corpus references** | Add paper versions/read scope as evidence alongside the prior repository pins | + +The existing target paths above are handoff-indexed. Their current bodies and verified public URLs were unavailable; no fabricated remote artifact link is supplied. The linked files in this pack are complete incremental artifacts. Preserve that availability distinction during integration. + +The only other primary matrix remains `docs/searchspace-matrix.md`. No methodology rows are forced into Accelerator/RAM/SSD/Communication/OS coverage. This handoff table is not a third primary matrix. The older independent bundle's `docs/repo-source-matrix.md` spelling is superseded by the uploaded Reference Matrix's authorized `docs/reference-matrix.md` path. + +## Interface with separate Pack F + +Pack F is a separate artifact supplied by the parent workstream, not a source mined here. Its adaptation-unit semantics can answer *what changes* (for example, a policy/search configuration or other bounded state). Pack E's admission decision answers *what evidence product to retain* and *what can justify altering an incumbent*. Match those two decisions before integration; do not turn a search candidate into a skill merely because it is persistent. Use the artifact names `Pack F` and `Pack E` across separate archives rather than relative file links that will break. Pack E makes no independent claims about Pack F's papers or results. + +## Non-negotiable evidence boundaries + +- Every local artifact remains candidate/not_run; author results remain author-reported. +- This pack proposes bounded updates rather than new skills because the known artifact ownership overlaps; GLM should reconcile current bodies before applying. This is a pack-specific choice, not a general gate against candidate-skill growth. +- No replay, installation, task execution, generated optimizer, framework, CLI change, matrix edit, promotion, commit or PR occurred. +- No AREX/DisCo execution claim. Prior manual repo-to-skill-inspired work is not an AREX run. +- No new claimed NPU capability or hardware coverage follows from these methodology papers. +- Full source copies and parsing scratch files are outside this delivery tree. + +## Integration follow-ups, not queued work + +1. Obtain the current bodies and hashes of the existing methodology skills and named pipeline indexes; only then convert a missing semantic amendment into a literal diff. +2. If a concrete reproducibility decision later requires it, reconcile the paper versions with the four already-known repository pins and author run artifacts. Do not clone or re-audit everything by default. +3. Resolve SkillOpt's split and cost-denominator discrepancies using author artifacts only if cost/protocol choice depends on them. +4. Request an authorized evaluation scope if behavioral efficacy, transfer to another model/harness, or promotion becomes the actual task. Define a task contract and suitable held-out/regression evidence then; this pack does not launch or prescribe a reproduction campaign. +5. Inspect other papers or additional frameworks only under a later gate. None is adopted as extra evidence in Pack E. + +A separately labeled [unread literature lead](UNREAD_LEADS.md) is provided without adding it to the extracted evidence. + +## Delivery QA + +Static editorial review covers paths, status labels, source versions, F/P separation, and correspondence between proposed amendments and inspected paper evidence. It does not establish runtime behavior or skill efficacy. See [QA.md](QA.md) for the final check result. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/QA.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/QA.md new file mode 100644 index 000000000..98b62603f --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/QA.md @@ -0,0 +1,18 @@ +> Supplier delivery snapshot, 2026-10-15. Packaging checks and inventory below refer to the original pack, not to this relocated integration. Empirical validation remains not_run. + +# Pack E delivery QA + +Status: candidate. Behavioral/runtime validation: not_run. + +Completed 2026-10-15: +- Original arXiv titles, version histories and exact version URLs checked for all four approved papers. +- Methods, experimental controls, resource costs, negative results and reporting inconsistencies inspected against original full text; no author result presented as a local result. +- Source hashes recorded; full texts and parsing scratch files excluded from the deliverable. +- Existing uploaded readsets distinguished from unavailable indexed skill/pipeline bodies. +- All local file-link targets verified after this QA file was created. Original-paper HTML fragment links checked against downloaded HTML IDs. +- Candidate/not_run scope, F/P distinction and no-execution boundary reviewed. +- Known artifact ownership overlaps preserved as bounded amendments; no forced new skill count. +- Methodology routing limited to `docs/reference-matrix.md` §2; `docs/searchspace-matrix.md` remains the only other primary matrix. +- Separate unread literature lead labeled as not opened/not mined; integration follow-ups labeled separately. + +Not performed: repository/source-version reconciliation, method installation or execution, hardware workloads, A/B evaluation, code tests, runtime skill validation, promotion, InferRSI/matrix edits or publication. This QA is editorial and structural, not independent empirical verification. Independent review corrected the MLE running-budget unit to GPU-hours per task and required explicit PassNet metric denominators/tolerance; both corrections are incorporated. Further parent-workstream review may add corrections before delivery. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/README.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/README.md new file mode 100644 index 000000000..5ea25660f --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/README.md @@ -0,0 +1,24 @@ +> Supplier delivery snapshot, 2026-10-15. Packaging checks and inventory below refer to the original pack, not to this relocated integration. Empirical validation remains not_run. + +# Pack E — Evidence into repository memory and bounded skills + +Status: **candidate**. Validation: **not_run**. Paper-first extraction, 2026-10-15. + +**Recommendation:** use the evidence's generality and validation status to choose a case, persistent knowledge, a bounded update, or a new skill. These are different products, not successive mandatory stages. This pack proposes additions to existing methodology artifacts rather than another skill-factory framework. + +Read in order: +1. [Comparison and decision](COMPARISON.md) +2. [Exact readset and prior-work availability](references/readset.md) +3. [Evidence-routing knowledge](knowledge/evidence-routing.md) +4. [Counterexample cases](cases/methodology-counterexamples.md) +5. [Bounded update proposals](updates/bounded-updates.md) +6. [Integration notes](INTEGRATION_NOTES.md) +7. [Separate unread literature lead](UNREAD_LEADS.md) + +[Protocol details and retained baselines](references/protocol-details.md) complement the compact ledgers. + +Paper ledgers: [Repo-To-Skill](references/repo-to-skill.md), [Learning to Commit](references/learning-to-commit.md), [Trace2Skill](references/trace2skill.md), [SkillOpt](references/skillopt.md). + +F identifies directly inspected source statements or author-reported measurements. P identifies this pack's proposed operational rules, interpretation, or verification requirements. An author's successful run is not local validation. Proposal acceptance is not execution permission. + +No repository implementation was re-mined; no AREX/DisCo, LearningToCommit, Trace2Skill, or SkillOpt execution occurred. No installation, evaluation run, reproducibility package, framework, runtime tool, InferRSI edit, matrix edit, commit, or PR is included. Source copies stay outside this deliverable. A new standalone SKILL.md is deliberately not emitted: the existing artifact names already cover these workflows, and their current full bodies were unavailable for a defensible duplication check. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/UNREAD_LEADS.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/UNREAD_LEADS.md new file mode 100644 index 000000000..5f797ae50 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/UNREAD_LEADS.md @@ -0,0 +1,7 @@ +# Unread literature lead — separate from the approved extraction + +This lead is not evidence for Pack E. Its original paper was not opened, its latest version was not checked, and no implementation was inspected. Following it requires a later scope decision. + +- **SkillsBench: Benchmarking How Well Agent Skills Work Across Diverse Tasks**, arXiv **2602.12670**. The title and identifier are listed in [Trace2Skill v5's bibliography](https://arxiv.org/html/2603.25158v5#bib.bib2), which links the [original-paper landing page](https://arxiv.org/abs/2602.12670). Potential next question: which task, agent and skill conditions make a candidate useful or harmful, and what evidence would justify its validation contract? This is a complementary evaluation lead, not a basis for claiming any benchmark result here. + +Integration follow-ups (current skill bodies, repository-version reconciliation and unresolved denominators) are listed separately in [INTEGRATION_NOTES.md](INTEGRATION_NOTES.md). They are not additional literature sources. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md new file mode 100644 index 000000000..ffe6265b3 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md @@ -0,0 +1,51 @@ +# Candidate cases: where seemingly useful rules fail + +Status: candidate. Local validation: not_run. These are paper-reported historical cases, not InferRSI executions. P sections are proposed interpretations and boundaries. + +## E-C1 — A useful default becomes an unjustified ban + +**F locator:** Repo-To-Skill [Appendix A.2.4, paired verification and refinement](https://arxiv.org/html/2609.02749v1#A1.SS2.SSS4.Px3), Table 6. + +**F case:** PassNet refinement encountered a special convolution structure that could undermine a blanket preference for vendor operators. The authors changed an absolute prohibition into an exception-sensitive prior. Construction-stage arithmetic mean fell (.9566→.7492) while geometric mean (.5352→.6941), median (.7340→.7941), match failures (10→1 of 50), and solve time (40→22 minutes) improved. These construction trials used DeepSeek v4 pro/Claude Code, unlike the final GPT-5.5/Codex evaluation. + +**P mechanism:** a generally sensible precaution suppresses exploration after direct structural evidence suggests an exception. Preserve the precaution's conditions and the counterexample rather than deleting either. + +**P proposed action:** revise only the implicated prohibition, retain a correct baseline, require task-specific correctness and outcome evidence before choosing the exception. Do not import the convolution optimization into an NPU skill from this narrative alone. The exact specialized implementation was not inspected here. + +**P acceptance question:** does the narrower rule recover legitimate exceptions without encouraging unsupported rewrites elsewhere? This requires new evidence; the answer is not_run. + +## E-C2 — Better repository familiarity can produce unnecessary caution + +**F locator:** Learning to Commit [§4.3 case study](https://arxiv.org/html/2603.26664v1#S4.SS3.SSS0.Px3), Tables 2–4. + +**F case:** the paper contrasts successful localization of a shared-RNG issue with a training-step fix where skill-guided work retained a redundant guard. The quantitative seq-bycat condition also has worse line deviation and weak judge preference in the [ledger](../references/learning-to-commit.md). + +**P mechanism:** a historical defensive pattern can be activated beyond its original preconditions. Repository memory is most useful when it retains the reason and boundary for the rule, not only the coding pattern. + +**P proposed action:** keep the historical change as a case until the invariant can be stated precisely. Scope a new convention to the subsystem and condition actually supported. Do not equate a smaller oracle-like patch with functional correctness, and do not infer the private repository's exact code from the narrative. + +**P acceptance question:** are there both positive examples and cases where applying the rule adds needless behavior? Use both before a broad memory update. + +## E-C3 — Fixing targeted failures can break unrelated successes + +**F locator:** Trace2Skill [§4.3](https://arxiv.org/html/2603.25158v5#S4.SS3), [Appendix C.2](https://arxiv.org/html/2603.25158v5#A3.SS2), Appendix E. + +**F case:** the greedy patch study reports bidirectional task flips, including 57 failure-to-pass against 21 pass-to-failure at one step and 26 against 46 at another. Recurring patch themes also overlap semantically. Individually selected edits did not match whole-pool consolidation in that study. + +**P mechanism:** patch effects interact; a narrowly successful fix can redirect broader agent behavior. Duplicate guidance can change emphasis without adding capability. + +**P proposed action:** evaluate the combined candidate and retain an unrelated-success regression sample. Review semantic overlap and contradictory instructions before writing. Do not infer from this case that all patches should always be merged or that greedy selection is universally inferior. + +**P acceptance question:** what improved, what regressed, and which changes are attributable to the edited instruction rather than stochastic execution? No such test was run in this pack. + +## E-C4 — A scorer-compatible procedure can violate a deployment contract + +**F locator:** SkillOpt [§4.5 spreadsheet case](https://arxiv.org/html/2605.23904v2#S4.SS5), [Fig.4](https://arxiv.org/html/2605.23904v2#S4.F4); Trace2Skill [Appendix I.3 examples](https://arxiv.org/html/2603.25158v5#A9.SS3). + +**F case:** learned spreadsheet guidance includes static-value fallbacks and automation preferences conditioned on benchmark behavior. These examples are reported skill text, not independent proof of suitability for every spreadsheet request. + +**P mechanism:** optimizing the available evaluator can reward a shortcut that is valid for the benchmark but conflicts with a real request for reusable formulas or a particular automation format. + +**P proposed action:** preserve the user's output contract above any learned heuristic. Record the evaluator's view of success and flag dimensions it cannot test. A candidate update must not silently change the requested artifact type. + +**P acceptance question:** would the output still satisfy the user if evaluated outside the benchmark? Treat this as an explicit transfer boundary rather than generic skill quality. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/knowledge/evidence-routing.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/knowledge/evidence-routing.md new file mode 100644 index 000000000..e31628f4e --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/knowledge/evidence-routing.md @@ -0,0 +1,51 @@ +# Candidate knowledge: evidence-to-artifact admission + +Status: candidate. Validation: not_run. All rules in this file are P, proposed for reconciliation with existing methodology artifacts. The four [paper ledgers](../COMPARISON.md) provide the F basis; this is a synthesis, not an implementation reproduced from one author. + +## Objective and assumptions + +Retain evidence at the narrowest useful abstraction without losing counterexamples, increasing instruction conflicts, or claiming behavioral improvement that has not been measured. Assume the source identity and its inspected boundary are known. If they are not, retain a lead rather than authoritative knowledge. + +## Decision variables and constraints + +Choose artifact type, scope, owner, applicability trigger, evidence strength, and revision boundary. Constraints are the actual task contract, source version, authorized actions, known counterexamples, and whether the current incumbent can be inspected. Artifact count, repository popularity, and the number of source files are not objectives. + +## Proposed decision procedure + +1. **Identify the evidence unit.** Is it a versioned API/implementation contract, an expert's accepted historical diff, an individual execution, a repeated pattern, or an aggregate controlled evaluation? Do not combine them into an undifferentiated confidence score. +2. **Preserve the case first when necessary.** Capture the input/state, observed behavior, outcome, comparator, and alternatives. Separate direct observation from the proposed cause. A log message alone can identify a lead without establishing the cause. +3. **Determine whether generalization is supported.** A versioned contract may justify scoped knowledge directly. An empirical behavior needs recurrence or an intervention consistent with the proposed cause. A source-local exception can remain a case even when it challenges a general rule. +4. **Check ownership and overlap.** Read the current relevant skill body. If it already owns the trigger and procedure, propose a localized correction or reference. If its body is unavailable, provide a semantic amendment specification and defer literal patching. Do not create a second skill merely to avoid the missing comparison. +5. **Select the smallest durable representation.** Put stable preconditions and decision rules in knowledge; put uncommon examples in cases/references; put broadly reused procedure in an existing skill. Create a new skill only if a distinct workflow remains unowned. +6. **Define acceptance separately.** Static coherence, source fidelity, functional correctness, behavioral improvement, and transfer have separate evidence statuses. A source-derived candidate may be useful before empirical testing, but must keep not_run and unresolved branches visible. +7. **Preserve rejection and expiry.** Record what change was tried, which scope it targeted, why it was rejected, and when the evidence stops applying. Do not generalize “failed here” into a timeless ban. Conflicting newer evidence can narrow, replace, or retire a rule. + +## Required information, not a new schema implementation + +- Source/version and exact evidence locator; read versus inferred status +- Evidence unit and provenance lineage; independent examples versus correlated copies +- Applicable task, repository, model, harness, and environment conditions +- Claimed mechanism and plausible alternative explanation +- Expected benefit plus construction, selection, context, and downstream cost dimensions +- Known negative cases and disallowed extrapolations +- Current artifact owner and proposed operation: retain case, add knowledge, revise, deprecate, or create +- Verification already available versus future checks; outcome stays not_run where appropriate + +These are editorial requirements. This pack does not add a catalog, database, router, evaluator, optimizer, installer, or scheduled update mechanism. + +## Resource benefit and cost + +Potential benefit is less repeated rediscovery and fewer conflicting instructions. Cost includes investigating causes, retaining provenance, deduplicating, and evaluating candidate changes. Selective reading can reduce context burden, but instruction-guided agents may also perform more work. No break-even point is known for InferRSI. + +## Limits and counter-signals + +- More repeated text can reflect shared prompts or duplicated cases rather than independent evidence. +- A maintainer-approved historical patch may encode a temporary compromise rather than a lasting convention. +- A higher aggregate score may hide correctness, task-contract, latency, or subgroup regressions. +- A protected text region helps preserve editing boundaries but can also preserve an outdated rule; it still needs a revision authority and expiry test. +- An edit-count cap does not cap the number of behavioral changes. Inspect the actual replacement and retain a reversible incumbent. +- Test-set separation alone does not prove causal mechanism; matched controls and alternate explanations still matter. + +## Output for this pack + +The justified output is one admission-policy knowledge note, counterexample cases, and bounded update specifications for existing artifacts. No new skill and no empirically promoted update are warranted by the inspected evidence alone. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md new file mode 100644 index 000000000..62c04b3b7 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md @@ -0,0 +1,32 @@ +# Learning to Commit evidence ledger + +F — [Learning to Commit: Generating Organic Pull Requests via Online Repository Memory](https://arxiv.org/abs/2603.26664v1), Li et al.; v1, 2026-03-27, work-in-progress. [Methods](https://arxiv.org/html/2603.26664v1#S3), [experiments](https://arxiv.org/html/2603.26664v1#S4). Prior implementation pin `7e5a1d77` is not independently reconciled with the paper. + +## Mechanism contract + +- **Objective:** repository-aligned future patches. +- **Assumptions:** chronological expert-reviewed commits; parent snapshots; intent-only queries. +- **Variables/constraints:** cutoff, curriculum, memory CRUD; future diffs excluded from onboarding (§3.1–3.4). +- **Mechanism:** attempt historical task before revealing accepted diff; contrast localization/API/style discrepancies; revise or deprecate memory (Eq.1, Fig.1). +- **Resources:** onboarding attempts/reflection plus full memory at solve time; total tokens, time and memory growth unreported. + +## Author-reported evidence + +Claude Opus 4.6; one internal RL repository; 24 learning/7 test tasks (§4.1). Table 2 pairs skill/base: + +| Condition | File IoU % | Tool calls | Line deviation | +|---|---:|---:|---:| +| seq-all | 80/61 | 56.8/71.9 | .69/1.59 | +| par-bycat | 80/68 | 62.7/62.7 | .62/.88 | +| par-all | 81/72 | 67.7/68.3 | .80/1.06 | +| seq-bycat | 71/71 | 75.0/76.4 | 1.22/1.13 | + +Table 3 skill-win % (Claude/Gemini): seq-all 55/58; par-bycat 54/57; par-all 46/54; seq-bycat 26/46. Functional pass rates and explicit API-reuse-rate results are not supplied. + +## P — Interpretation and limits + +The measured outcomes support a limited repository-onboarding hypothesis, not broad reliability or real maintainer acceptance. Oracle similarity can penalize valid alternate solutions; a smaller patch is not automatically correct. Keep tests, localization, bloat, style, and acceptance as separate outcomes. Only two conditions exceed 50% under both judges in Table 3, so do not repeat the broader prose claim as if every dimension agreed. + +Strict temporal separation blocks one known leakage route. Audit synthetic-query generation and benchmark access separately; the cutoff alone does not prove the model never encountered relevant material. Historical conventions also expire. Store when a rule was supported, conflicting later evidence, and a reason to retire it. + +The paper moves from 2,738 raw commits to 386 suitable commits while reporting 77.2% suitability; that percentage is not 386/2,738, and the intermediate denominator is not clear in the inspected report. Do not reuse it as the raw-history yield. The four curricula are comparisons, but neither an oracle-free matched ablation nor a multi-repository generalization result is reported. For InferRSI, propose scoped memory updates rather than treating history mining as validated skill promotion. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/protocol-details.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/protocol-details.md new file mode 100644 index 000000000..147eefd53 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/protocol-details.md @@ -0,0 +1,49 @@ +# Protocol details and unreported quantities + +F entries below are author-reported protocol details, not recommended InferRSI settings. P entries identify what cannot safely be inferred. Local validation: not_run. + +## Repo-To-Skill + +**F — models and separation.** Repository-graph creation uses GPT-5.5/GPT-5.6-sol, xhigh; final controlled downstream comparisons use GPT-5.5/Codex, xhigh. PassNet's 50-task construction study instead uses DeepSeek v4 pro/Claude Code. The public 1,000-repository collection, the 153-paper/636-skill PaperBench collection, the per-competition MLE graphs, and the shared FrontierCS/PassNet graphs are separate construction populations. [§§4–5; Appendix A](https://arxiv.org/html/2609.02749v1#A1). + +**F — constraints.** MLE excludes the original competition site and competition-specific content; PaperBench skill sources exclude the target paper and released target artifacts. FrontierCS freezes its graph before 188 evaluations, each with five hours, two CPUs and 4 GiB agent RAM; task-judge limits vary independently. PassNet evaluation uses A100-SXM4-40GB. Its correctness and Fast_1 metrics use tolerance t = −5; Fast_1 is conditional on numerically correct subgraphs, whereas AS aggregates rectified speedups across tolerance levels. Source/module and graph-construction checks are not the same as downstream trials. [§5.1](https://arxiv.org/html/2609.02749v1#S5.SS1). + +**P — what remains unknown.** No matched total-cost comparison including skill construction is established. The PaperBench running-budget amount is not specified in the inspected protocol, despite the stated matching. Aggregate catalog counts do not establish isolated efficacy for catalog routing, every module, every repo, or every accelerator. + +## Learning to Commit + +**F — variants and judges.** Both solver conditions use Claude Opus 4.6 and identical tools. Sequential versus parallel onboarding is crossed with all-corpus versus category-specific assignment. Two judges are Claude Opus 4.6 and Gemini 3.1 Pro. Curation removes trivial changes and diffs over 180K tokens, constructs seven categories, and synthesizes intent queries while omitting solution details. [§§3.4–4.1](https://arxiv.org/html/2603.26664v1#S3.SS4). + +**F — metric contract.** File IoU is overlap of changed-file sets; line deviation is candidate-minus-oracle diff size divided by oracle size; solve steps count tool calls. Pairwise dimensions concern location, logic, redundancy and style. [§3.5](https://arxiv.org/html/2603.26664v1#S3.SS5). + +**P — what remains unknown.** A low or negative signed line deviation does not certify completeness, and a file-set match does not certify correctness. Neither a practical retention/size bound for the accumulated memory nor lifecycle cost is reported. Do not infer the value of chronological/oracle supervision in isolation from the curriculum comparisons. + +## Trace2Skill + +**F — target/author distinction.** Qwen3.5-122B-A10B and Qwen3.5-35B-A3B serve as both skill authors and users, with cross-pair deployment. Author-side trace generation, diagnosis and merging use the same model. Additional family tests use Gemma-4-31B-it and GPT-5.5-high. ReAct runs use instruct mode; single-call steps use thinking mode; no separate tool-call cap is imposed. [Appendix A](https://arxiv.org/html/2603.25158v5#A1). + +**F — evaluation breadth.** Spreadsheet evaluation has 200 verified test examples, 2,529 Soft/Hard examples after removing evolution items, 2,810 WikiTQ and 1,585 HiTab. Math uses 400 DAPO evolution examples, 100 held-out DAPO examples and AIME 2026 avg@8 over 30 problems. DocVQA uses 50 evolution examples and 5,299 remaining evaluation examples; reported metrics are ANLS and thresholded accuracy. Seeds are 41–43. [§3 and Appendices A–B](https://arxiv.org/html/2603.25158v5#S3). + +**F — subset study.** BO searches at most 15 high-support patches on 32 evolution-set validation examples; empty/full/singleton/random initialization, up to four rounds, eight chosen candidates per round from 500 proposals. Its objective has zero cardinality penalty. [Appendix E](https://arxiv.org/html/2603.25158v5#A5). + +**P — what remains unknown.** The three-minute comparison concerns skill-generation rounds, not a full end-to-end learning-plus-evaluation lifecycle. The total 20,000 GPU-hours is study-wide, not attributable to one method variant or exported skill. Support frequency, faster construction and successful transfer are separate claims; none establishes a universal default selector. + +## SkillOpt + +**F — default controls.** Four epochs; rollout batch 40; reflection batch 8; 16 analyst workers; merge batch 8; edit cap 4 with cosine floor 2; slow comparison over 20 training tasks; up to three reflection refinements. Benchmark overrides include LiveMath's 35 training items and ALFWorld's 39 train/140 selection/134 test environments. Same-model GPT-5.5 target/optimizer is used for component studies. [§4 setup; Appendix C](https://arxiv.org/html/2605.23904v2#A3). + +**F — model and baseline coverage.** Seven targets: GPT-5.5, GPT-5.4, GPT-5.4-mini, GPT-5.4-nano, GPT-5.2, Qwen3.5-4B, Qwen3.6-35B-A3B. Direct-chat comparisons include no skill, human, one-shot LLM, Trace2Skill, TextGrad and GEPA; EvoSkill is the harness-side comparator. The six benchmark families are SearchQA, SpreadsheetBench, OfficeQA, DocVQA, LiveMath and ALFWorld; ALFWorld is not included in Codex/Claude Code rows. [Table 1 and §4](https://arxiv.org/html/2605.23904v2#S3.T1). + +**F — GPT-5.5 direct-chat baseline retention.** Column order: SearchQA / Spreadsheet / OfficeQA / DocVQA / LiveMath / ALFWorld. Values are absolute benchmark scores, not deltas. + +| Method | Scores | +|---|---| +| No skill | 77.7 / 41.8 / 33.1 / 78.8 / 37.6 / 83.6 | +| Human | 81.8 / 72.9 / 66.9 / 90.1 / 38.4 / 91.8 | +| One-shot LLM | 80.9 / 43.2 / 51.7 / 89.6 / 40.0 / 93.3 | +| Trace2Skill | 82.4 / 49.6 / 65.7 / 90.6 / 52.0 / 87.3 | +| TextGrad | 81.4 / 41.1 / 42.0 / 87.2 / 49.2 / 82.8 | +| GEPA | 84.8 / 73.6 / 63.9 / 89.1 / 43.2 / 85.8 | +| SkillOpt | 87.3 / 80.7 / 72.1 / 91.2 / 66.9 / 95.5 | + +**P — what remains unknown.** Matched target/test/scorer does not establish matched total optimization cost across baselines. “No optimizer at deployment” does not mean zero additional skill-context cost. No confidence interval or monetary break-even estimate is supplied. Resolve the split/run inconsistencies in the main ledger before selecting a reproducibility or budget target. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/readset.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/readset.md new file mode 100644 index 000000000..e3fce8c0a --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/readset.md @@ -0,0 +1,65 @@ +# Exact readset and availability + +Read on 2026-10-15. Direct original-paper HTML and arXiv version history were inspected. The source cache is outside the deliverable; source hashes are in [source-manifest.json](source-manifest.json). No complete paper, repository, prompt template, or implementation source is bundled. + +## Existing material inspected first + +| Material | Inspected scope | What is established | +|---|---|---| +| Uploaded `HANDOFF.md`, 90 lines | Entire file; methodology especially §§2,4,5 | Prior repository pins and named pipeline indexes; no inference that the remote Windows workspace is locally mounted | +| Uploaded `reference-matrix.md`, 144 lines, snapshot `4d61d2c` | Entire file; extraction routing from §2 | Current two-matrix contract, methodology targets, prior evidence roles | +| Uploaded `[supplied handoff text; original filename in source archive]`, 238 lines, checkpoint `6ed8162` | Entire file | Earlier candidate-skill inventory and historical work boundaries; not current repository status | +| Prior independent bundle `INTEGRATION_NOTES.md` | Entire file | Existing five runtime candidate bundles, F/P discipline and no AREX execution; its old `docs/repo-source-matrix.md` path is superseded by the uploaded Reference Matrix | + +## Indexed but unavailable in this session + +- `indexes/learning-to-commit-pipeline.md` +- `indexes/arex-pipeline.md` +- `indexes/skillopt-pipeline.md` +- Current bodies/references of `repository-evolution-analysis`, `npu-skill-factory`, `skill-evolution-playbook`, `optimization-search-policy`, `dense-performance-evidence`, and `inference-benchmark-design` +- Any full trajectory/evaluation artifact behind the prior implementation work + +Two bounded Library searches used the named pipeline files and `skill-evolution-playbook` (one exact-quoted pass). Returned hits were the already supplied handoffs/matrices and unrelated or adjacent artifacts; no standalone requested pipeline-note body appeared in the inspected result pages. This is a retrieval limitation, not a claim that the files do not exist. No broad private-history search or assumption of local repository access followed. No upstream implementation clone/read was needed to answer the approved paper-level question. + +## Original-paper readsets + +### Repo-To-Skill, arXiv 2609.02749v1 + +- Identity/version: [abstract and history](https://arxiv.org/abs/2609.02749v1); submitted 2026-09-02, only v1 shown. +- Formalization: [§2](https://arxiv.org/html/2609.02749v1#S2), Eqs.1–4; [§3](https://arxiv.org/html/2609.02749v1#S3), Eqs.5–8, Fig.2. +- Collection versus evaluated pools: [§4](https://arxiv.org/html/2609.02749v1#S4), Fig.3. +- Setup/results: [§5.1–5.5](https://arxiv.org/html/2609.02749v1#S5), Tables 1–4, including metrics, negative tasks and resource columns. +- Implementation-method description: [A.1](https://arxiv.org/html/2609.02749v1#A1.SS1), all scoping/verification/classification/routing subsections. +- Task-specific construction: [A.2.1–A.2.4](https://arxiv.org/html/2609.02749v1#A1.SS2), Eq.9, Tables 5–6; all four benchmark protocols and recovery/counterexample paragraphs. +- Not mined: Appendix B's long repository inventory, bibliography-linked works, author repository implementation. Reading collection counts is not reading the individual repository skills. + +### Learning to Commit, arXiv 2603.26664v1 + +- Identity/version: [abstract/history](https://arxiv.org/abs/2603.26664v1); 2026-03-27, work-in-progress. +- Full main text §§1–5; [§3.1–3.5](https://arxiv.org/html/2603.26664v1#S3), Fig.1, Eq.1; [§4.1–4.3](https://arxiv.org/html/2603.26664v1#S4), Tables 2–4. Table 1 was read as authors' benchmark comparison, not independently verified claims about other projects. +- Not available in paper: exact pilot cutoff date, full private task/diff records, total build cost, functional-pass-rate results, explicit API-reuse-rate results, confidence intervals, a large multi-repository validation. +- Not mined: referenced benchmark papers or the existing repository implementation. + +### Trace2Skill, arXiv 2603.25158v5 + +- Identity/version: [abstract/history](https://arxiv.org/abs/2603.25158v5); v1 2026-03-26, v5 2026-06-04. +- [§2.1–2.4](https://arxiv.org/html/2603.25158v5#S2), Eqs.1–2, Figs.1–2; [§§3–4](https://arxiv.org/html/2603.25158v5#S3), all experiment and analysis prose, Tables 1–6; limits. +- [Appendix A](https://arxiv.org/html/2603.25158v5#A1): exact split sizes, serving, seeds, compute, Table 7 dispersion. +- [Appendix B](https://arxiv.org/html/2603.25158v5#A2): B.1 latency derivation, B.2–B.4 transfer and sequential/retrieval controls, Tables 8–11. +- [Appendices C–E](https://arxiv.org/html/2603.25158v5#A3): qualitative diagnosis/interaction analysis; Table 12; 32-task selection protocol, add/remove interventions, binary subset objective and TPE details. +- [Appendices F–H](https://arxiv.org/html/2603.25158v5#A6): broader domain setup, Table 13, head-to-head adaptation caveats/Fig.7, skill-creator Table 14. +- [Appendix I](https://arxiv.org/html/2603.25158v5#A9): target skill preloading, analyst/merge contracts and intermediate examples, including atomic reference-create/link pairs. +- HTML occasionally groups two printed tables under one container: printed Tables 2/3 use container `S3.T3`, 8/9 use `A2.T9`, and 10/11 use `A2.T11`. Use printed captions plus section when resolving. +- Not mined: author repository implementation, cited external baselines' repositories, per-run logs. Numeric claims in this pack use tables/prose; figures were not independently digitized. + +### SkillOpt, arXiv 2605.23904v2 + +- Identity/version: [abstract/history](https://arxiv.org/abs/2605.23904v2); v1 2026-05-22, v2 2026-05-25. The initially fetched unversioned HTML was byte-equal to the subsequently fetched v2 HTML. +- [§3.1–3.7](https://arxiv.org/html/2605.23904v2#S3), Eqs.1–3, Fig.2; [§4.1–4.5](https://arxiv.org/html/2605.23904v2#S4), all experiment/ablation/transfer/cost prose and Tables 1–6. Numerical extraction focuses on matched controls rather than reproducing every headline as a local claim. +- [Appendix A](https://arxiv.org/html/2605.23904v2#A1), [B limitations](https://arxiv.org/html/2605.23904v2#A2), [C protocol](https://arxiv.org/html/2605.23904v2#A3): Algorithm 1, all eight optimizer prompt contracts, patch safeguards and deployment/meta-memory separation. +- Reported protocol/denominator discrepancies are retained in the [ledger](skillopt.md), not silently resolved using the prior repository version. +- Not mined: SkillOpt/Sleep implementation, author run logs, model-serving documentation or extra frameworks. No claim about Sleep's operation is derived from this paper. + +## Cross-version boundary + +Prior repository pins (`ac3fe1af`, `7e5a1d77`, `3d0b52a`, `343db229`) are provenance from the user's existing work. They are not a tested dependency set and were not proven to implement these exact paper versions. Future reconciliation must inspect only the concrete version-sensitive question; it should not repeat the prior pipeline summaries. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/repo-to-skill.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/repo-to-skill.md new file mode 100644 index 000000000..5190c56fd --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/repo-to-skill.md @@ -0,0 +1,28 @@ +# Repo-To-Skill evidence ledger + +F — [Repo-To-Skill: Distilling GitHub Repositories Into AI4AI Skills](https://arxiv.org/abs/2609.02749v1), Chen et al.; v1, 2026-09-02. Read [§§2–5](https://arxiv.org/html/2609.02749v1#S2), [Appendix A](https://arxiv.org/html/2609.02749v1#A1). Prior implementation pin `ac3fe1af` is carried context, not matched to this paper version. + +## Mechanism contract + +- **Objective:** reusable operational context with unchanged backbone/harness (§2, Eqs.1–4). +- **Assumptions:** inspectable evidence, scoped capabilities, relevant future tasks, trustworthy checks. +- **Variables/constraints:** source/task anchor; capabilities; evidence subset; graph/interfaces; verification record (Eqs.5–8). Skill construction and evaluation are separated. +- **Mechanism:** capability-specific evidence becomes procedures with references, optional wrappers, and explicit unresolved gaps (§3; A.1). Paper modules undergo isolated checks and bounded recovery without reopening the source implementation (A.2.2). +- **Resource trade-off:** construction is paid before reuse; downstream context is selective. Library construction allocation ≈$40/repository; MLE construction ≤24 GPU-hours/task is additional to ≤24 GPU-hours/task for running (Table 5). + +## Author-reported evidence + +| Setting; controlled comparator | Without → with skill | Locator | +|---|---|---| +| GPT-5.5/Codex, MLE 75 tasks; medal % | 31.11±2.22 → 72.89±1.18; three runs, SEM | Table 1 | +| PaperBench 20; replication % | 29.45 → 39.59 | Table 2 | +| FrontierCS 188; score / tokens per task | 70.63 / 2.46M → 77.14 / 4.47M | Table 3 | +| PassNet 200; AS / correctness / Fast_1 | 1.343 / 81.35% / 28.48% → 1.5313 / 90.76% / 26.72% | Table 4 | + +F — PassNet metric denominators (§5.1): at tolerance t = −5, correctness is the fraction of subgraphs matching eager outputs; Fast_1 is the share of numerically correct subgraphs at least as fast as eager. AS aggregates rectified speedups across tolerance levels t ∈ [−10, 4] under the benchmark aggregation protocol; it is not a rate with the Fast_1 denominator. + +## P — Interpretation and limits + +The public repository count and the evaluated task/paper-specific collections must not be conflated. No result here establishes that every generated repository skill improves an agent. Same downstream budget does not mean equal total construction-plus-use cost. FrontierCS's larger token consumption makes an unconditional “skills save compute” rule indefensible. PassNet's aggregate and correctness gains coexist with a worse Fast_1 metric; select a metric contract before deciding which revision is preferable. + +No component-isolating ablation establishes a universal benefit for scripts, graph depth, routing, or verification itself. PaperBench's two negative tasks and the PassNet overconservative-rule case deserve preserved counterexamples, not deletion from a positive summary. The proposed factory change is to preserve verification type, scope and cost, with source-local exceptions and a fallback when guidance is poorly matched. These are proposed safeguards, not local results. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/skillopt.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/skillopt.md new file mode 100644 index 000000000..d34caf2b1 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/skillopt.md @@ -0,0 +1,33 @@ +# SkillOpt evidence ledger + +F — [SkillOpt: Executive Strategy for Self-Evolving Agent Skills](https://arxiv.org/abs/2605.23904v2), Yang et al.; v2, 2026-05-25 (v1 2026-05-22). [§3](https://arxiv.org/html/2605.23904v2#S3), [§4](https://arxiv.org/html/2605.23904v2#S4), Appendices A–C, Algorithm 1. Prior `343db229` is not independently reconciled. + +## Mechanism contract + +- **Objective:** select a compact skill on selection data; report untouched-test performance (Eqs.1–3). +- **Assumptions:** reliable scalar feedback; frozen target/harness; independent splits. +- **Variables/constraints:** edit budget/schedule, rollout/reflection batches, current/best skill, rejected buffer, protected slow region, optimizer-only memory. +- **Mechanism:** ranked localized edits; strict selection improvement, ties rejected; epoch-level comparisons separately gated (§3.2–3.6). + +## Author-reported evidence + +| Measurement | Values | Locator | +|---|---|---| +| GPT-5.5 Spreadsheet, no-skill / strongest baseline / SkillOpt | 41.8 / 73.6 GEPA / 80.7 | Table 1 | +| Default / no edit budget; SearchQA, Spreadsheet, LiveMath | 87.1,77.5,61.3 / 84.6,75.7,57.3 | Table 3 | +| No rejected buffer | 85.5,72.9,58.9 | Table 3 | +| No meta or slow update | 86.3,55.0,59.7 | Table 3 | + +Table 6: 379–1,995 final tokens; 1–4 accepted updates. Training tokens: SearchQA 213.8M; Spreadsheet 21.4M; OfficeQA 20.8M; DocVQA 188.2M; LiveMath 23.2M; ALFWorld 59.3M. No optimizer calls at deployment. + +## P — Interpretation and limits + +A strict scalar gate controls acceptance; it does not prove that every important behavior is preserved. Add an explicit regression set and task contract before translating that gate into an operational policy. A single append operation can add a large instruction block, so counting edits is not a semantic or token-distance bound. Keep proposal size and changed behavior inspectable too. The optimizer's private learning history should not automatically become instructions for the deployed agent. + +Preserve these reporting uncertainties: +- Table 2(a) states a 4:1:5 train/selection/test split; Appendix C's ablation paragraph states 2:1:7. Do not silently select one. +- Table 6 cost/point values (37.9M, .6M, 1.1M, 46.4M, 3.6M, 15.9M) do not directly reproduce Table 1 no-skill gains from their total tokens. Treat the gain denominator/run identity as unresolved. +- Table 2's learning-rate sweep and Table 3's default row differ. The headline results are not all a single default-config run. +- No matched numerical gate-off row or repeated-seed uncertainty is supplied in the inspected result tables. A strong narrative claim about gating is not that missing ablation. + +The native verifiers and scorer-specific adaptations are useful only within their task contract. For example, a benchmark favoring static spreadsheet values does not authorize replacing formulas when a real user requires them. Training cost may be unattractive for one-off work. These are limits on transfer, not evidence that the method fails generally. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/source-manifest.json b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/source-manifest.json new file mode 100644 index 000000000..a55407c85 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/source-manifest.json @@ -0,0 +1,74 @@ +[ + { + "source": "arXiv original paper", + "arxiv_version": "2609.02749v1", + "url": "https://arxiv.org/html/2609.02749v1", + "sha256": "69c75a6059a4ccf341ceb358149342e2055572218d4ad3a37a0f107eeb833210", + "bytes": 1415606, + "accessed": "2026-10-15", + "local_validation": "not_run", + "source_copy_in_deliverable": false + }, + { + "source": "arXiv original paper", + "arxiv_version": "2603.26664v1", + "url": "https://arxiv.org/html/2603.26664v1", + "sha256": "7a4b1fb93c8578e70fe3c2c64e2e0c4e26b10fadafa56e5d0e5b3bfe3862b767", + "bytes": 122076, + "accessed": "2026-10-15", + "local_validation": "not_run", + "source_copy_in_deliverable": false + }, + { + "source": "arXiv original paper", + "arxiv_version": "2603.25158v5", + "url": "https://arxiv.org/html/2603.25158v5", + "sha256": "e8847c7eccfd066869ef5b61fe208a8b8de251365150c62add9c4d313373623b", + "bytes": 692897, + "accessed": "2026-10-15", + "local_validation": "not_run", + "source_copy_in_deliverable": false + }, + { + "source": "arXiv original paper", + "arxiv_version": "2605.23904v2", + "url": "https://arxiv.org/html/2605.23904v2", + "sha256": "cf20e8e33038ff9f198d98beeb01e736ee4219eb1d7e2a71133d918a9b577e41", + "bytes": 571780, + "accessed": "2026-10-15", + "local_validation": "not_run", + "source_copy_in_deliverable": false + }, + { + "source": "existing supplied handoff", + "name": "HANDOFF.md", + "sha256": "a52b9584580f1b42210071e91d67a3cf3f46bddf68e734d46e54c2c9690009f8", + "bytes": 9812, + "scope": "entire file", + "source_copy_in_deliverable": false + }, + { + "source": "existing supplied handoff", + "name": "reference-matrix.md", + "sha256": "56d5115f4570fe1946d369ca61eecac361f2ff1c996709918b5ac3b508f3dd51", + "bytes": 21344, + "scope": "entire file", + "source_copy_in_deliverable": false + }, + { + "source": "existing supplied handoff", + "name": "[supplied handoff text; original filename in source archive]", + "sha256": "9fc4e217034d88fee1da947f5f305f574258b078a0a6f5036be1ff7d347167cd", + "bytes": 15447, + "scope": "entire file", + "source_copy_in_deliverable": false + }, + { + "source": "existing supplied handoff", + "name": "INTEGRATION_NOTES.md", + "sha256": "3ec7b0e0f7e30f13442e586c04cb218ef8d01938802d9e8bbf982e5fb57462dd", + "bytes": 6249, + "scope": "entire file", + "source_copy_in_deliverable": false + } +] diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/trace2skill.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/trace2skill.md new file mode 100644 index 000000000..05319d099 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/references/trace2skill.md @@ -0,0 +1,32 @@ +# Trace2Skill evidence ledger + +F — [Trace2Skill: Distill Trajectory-Local Lessons into Transferable Agent Skills](https://arxiv.org/abs/2603.25158v5), Ni et al.; v5, 2026-06-04 (v1 2026-03-26). [§2](https://arxiv.org/html/2603.25158v5#S2), [§§3–4](https://arxiv.org/html/2603.25158v5#S3), Appendices A–I. Prior `3d0b52a` is not a verified paper-version match. + +## Mechanism contract + +- **Objective:** frozen-agent test improvement from disjoint evolution evidence (Eq.1). +- **Assumptions:** labeled traces, inspectable artifacts, reusable target procedure. +- **Variables/constraints:** seed skill, error/success pools, merge breadth, edit applicability. Unexplained failures are excluded (§2.3). +- **Mechanism:** independent diagnoses become hierarchical consolidated edits; reject missing-file and conflicting-range edits (§2.4, Eq.2). +- **Resources:** 128 analysts, merge batch 32; same eight-A100 node; full study ≈20,000 GPU-hours (A; B.1), not per-skill cost. + +## Author-reported evidence + +| Controlled comparison | Result | Locator | +|---|---|---| +| Spreadsheet parallel / seq-1 / seq-4 | 122B Vrf 65.83/61.83/59.00; ≈3/60/15 min | Table 4 | +| Consolidated / ReasoningBank top-1 | 122B Vrf 69.83/56.00 | Table 5 | +| All-error / BO-selected | Vrf 65.83/69.83; HiTab 43.45/43.38 | Table 6 | +| Human skill / none, 35B | Vrf 9.67/19.00 | Table 1 | + +Main spreadsheets: 200 evolution/200 verified test; three seeds. +57.65 WikiTQ points is a specific 35B-author→122B-user creation/error result, not an average. + +## P — Interpretation and limits + +This is evidence for candidate consolidation, not an unconditional publish-all rule. The default aggregation avoids repeated subset evaluation, but the paper itself shows gains from selection and an unfavorable counter-metric. Independent diagnosis can still share correlated model errors; support counts should trace back to distinct tasks and sources, not merely the number of generated patches. + +The latency result is wall time with large concurrency, not token-normalized or dollar-normalized efficiency. Seq-1 remains higher on 35B Soft/Hard in Table 4. Top-1 retrieval is one particular retrieval comparator, and OOD retrieval results were excluded; do not conclude that consolidated skills dominate every retrieval strategy. + +The study preloads the known target SKILL.md (I.1). It therefore does not validate catalog discovery, routing, or autonomous skill selection. Treat the human skill's small-model regression as evidence for model/harness-specific suitability checks. The agentic analyst's benefit is also not universal: 122B creation's Avg is 26.02 versus 26.60 for log-only analysis (Table 12), despite better in-distribution scores. + +BO uses only 32 validation tasks and at most 15 high-coverage patches (Appendix E). Its search must remain separated from final test claims. No local trajectory was generated or diagnosed in this pack. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/updates/bounded-updates.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/updates/bounded-updates.md new file mode 100644 index 000000000..6c642767d --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/papers-20261015/updates/bounded-updates.md @@ -0,0 +1,69 @@ +> Historical supplier amendment proposal, 2026-10-15. This is editing context, not a deployed task procedure or an execution grant. The owning SKILL.md records the reconciled amendment. + +# Bounded amendments to existing methodology artifacts + +All entries: **P; candidate; not_run; not applied**. These are reviewable semantic amendments, not literal diffs. The current full skill bodies and their hashes are unavailable. The existing targets below are identified in the uploaded Reference Matrix §2 and prior handoff, not asserted to exist at a currently accessible remote URL. Before integration, compare the latest body, reuse matching language, and add only missing material. + +## E-U1 — Repository memory needs scope, contradiction, and expiration + +**Target:** `src/inferrsi/data/skill_library/workflows/research/repository-evolution-analysis/SKILL.md` and its existing evidence references. + +**Increment:** extend the already-covered temporal split with a distinction between accepted historical implementation and durable invariant. Use the [Learning to Commit ledger](../references/learning-to-commit.md) and [E-C2](../cases/methodology-counterexamples.md#e-c2--better-repository-familiarity-can-produce-unnecessary-caution). + +**Proposed insertion, if absent:** + +> For each historical lesson, record the parent snapshot, task intent, accepted change, evidence of the agent's specific discrepancy, and the narrow condition under which the lesson applies. Separate file-local habit, subsystem invariant, and repository-wide convention. Revise or retire a lesson when later accepted evidence contradicts it. Freeze adaptation inputs before future-task evaluation; audit issue synthesis and source access separately. Report correctness, localization, patch size, style and resource use separately. + +**Expected effect:** fewer invented repository-wide rules and less obsolete defensive behavior. **Regression risk:** overly narrow rules may miss useful transfer. **Acceptance evidence needed:** exact incumbent/version, a reviewed historical evidence pair, a counterexample/expiry condition, and a held-out future check if efficacy is claimed. No new history replay or benchmark is authorized here. + +## E-U2 — Factory output and verification are independent choices + +**Target:** `src/inferrsi/data/skill_library/workflows/maintenance/npu-skill-factory/SKILL.md` and its source/admission notes. + +**Increment:** add the [artifact decision](../knowledge/evidence-routing.md), not a second lifecycle or another factory implementation. + +**Proposed insertion, if absent:** + +> Choose case, knowledge, bounded amendment or new skill according to evidence generality and workflow ownership. A new source does not mandate a new skill. Keep source-fidelity, static usability, execution correctness, behavioral efficacy and transfer evidence distinct. Record construction cost separately from downstream cost. Mark unresolved checks and unrun checks explicitly; neither a curated library entry nor an upstream score promotes this local candidate. + +**Expected effect:** better admission discipline without expanding runtime machinery. **Regression risk:** excessive checking can consume more than a one-off task warrants. **Acceptance evidence needed:** latest factory body, duplicate-content review, explicit source constraints and known negative cases. Keep author construction modes descriptive; do not activate AREX/DisCo or inherit its installation/check permissions. + +## E-U3 — Consolidation proposes; validation decides + +**Target:** `src/inferrsi/data/skill_library/workflows/maintenance/skill-evolution-playbook/SKILL.md` and existing evolution references. + +**Increment:** distinguish evidence-pool consolidation from incumbent replacement using [Trace2Skill](../references/trace2skill.md), [SkillOpt](../references/skillopt.md), and [E-C3](../cases/methodology-counterexamples.md#e-c3--fixing-targeted-failures-can-break-unrelated-successes). + +**Proposed insertion, if absent:** + +> Diagnose the causal failure before proposing a corrective rule. Keep successful behaviors that a correction must preserve. Consolidate overlapping evidence into one coherent candidate, but do not treat consensus as an acceptance test. Bound the target passage and behavioral scope of each amendment, inspect its actual size, and retain the incumbent for rollback. Evaluate combined effects and unrelated-success regressions; keep the final test partition outside selection. A tie or uncertain result must not be reported as improvement. + +**Expected effect:** less anecdotal rule growth and fewer unobserved interactions. **Regression risk:** narrow edits may fail to realize complementary changes. **Acceptance evidence needed:** full incumbent, evidence lineage, candidate diff, independent evaluation contract, regression observations and rollback state. No automatic thresholds, worker counts, optimizer schedule, or software changes are adopted from the papers. + +## E-U4 — Negative feedback belongs to a versioned editing context + +**Target:** the same `skill-evolution-playbook` update/provenance section; optionally a reference linked by `npu-skill-factory`, rather than a separate skill. + +**Increment:** preserve a useful distinction in SkillOpt between target-facing guidance and optimizer-only learning history. + +**Proposed insertion, if absent:** + +> Record a rejected edit with the incumbent/candidate identifiers, target conditions, observed outcome and suspected reason. Treat rejection as evidence about that comparison, not a universal ban. Keep advice about how to edit skills outside the deployed task procedure unless it independently belongs there. Long-lived protected guidance remains subject to explicit revision when its evidence expires. + +**Expected effect:** avoid repeating harmful changes without leaking editing bureaucracy into task instructions. **Regression risk:** stale rejection records may suppress valid later changes. **Acceptance evidence needed:** scoped rejection example and a retirement condition. The pack does not create a persistent optimizer memory store. + +## E-U5 — Report costs and gains on comparable denominators + +**Target:** existing `src/inferrsi/data/skill_library/playbooks/measurement/dense-performance-evidence/SKILL.md` or `src/inferrsi/data/skill_library/playbooks/measurement/inference-benchmark-design/SKILL.md`, whichever already owns agent-methodology cost accounting; link from evolution notes instead if outside their current purpose. + +**Increment:** one narrowly placed metric-contract note, using the four ledgers rather than forcing methodology into hardware coverage. + +**Proposed insertion, if absent:** + +> Separate build, selection, deployment-context and downstream-task costs. State whether metrics are absolute points, relative gains, geometric means, or rates with conditional denominators. Retain worse metrics and per-task regressions. Flag unresolved protocol or denominator mismatches rather than repairing them by assumption. A shared task budget does not establish equal total cost. + +**Expected effect:** prevent false economics or promotion claims. **Regression risk:** misplaced content could bloat a hardware-specific skill; use a reference instead when appropriate. **Acceptance evidence needed:** ownership check in the current artifact. This entry is optional after deduplication, not a request to expand that skill's scope. + +## Stopping rule + +Stop after the evidence notes and amendment specifications. Literal edits, test campaigns, optimizer implementation, deployment, or publication require a later authorized task and current artifact access. No amendment here is a claim that the existing skill lacks this material. diff --git a/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/skill-factory-design-20261014.md b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/skill-factory-design-20261014.md new file mode 100644 index 000000000..88d1d21e0 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/npu-skill-factory/references/skill-factory-design-20261014.md @@ -0,0 +1,187 @@ +# Skill factory design detail (historical, 2026-10-14/15) + +Historical design references from the sibling workstream and PR #9, moved from +the entry `SKILL.md` with the two sibling-prototype entrypoints annotated as +not present in this repository. They record methodology and observed pilot +material, **not** implemented InferRSI functionality: `schemas/skill-bundle.json` +and `python -m omnirsi.harness.skill_distill` below belonged to the sibling +`codex/skill-eval-bootstrap` workstream (observed @ 82218b4) and are **not +present in this repository**. Two sources that section cites: +PR #9 `skill_library/` layout (source-grounded, pr/9 @ 4ad551a9) and sibling +workstream `evidence/skill-bootstrap-20261014/` (observed @ 82218b4). + +## Skill bundle schema + +Each distillation produces a bundle validated against `schemas/skill-bundle.json`. +A bundle must have: + +- `status`: `"candidates_generated"` or `"blocked"` (not a placeholder). +- `capability_graph.nodes`: each node has `id`, `label`, and `source_paths` + pointing to files actually present in the source snapshot. +- `skills`: 3-5 candidates, each with: + - `name`: lowercase, no spaces, ≤63 chars. + - `capability`, `applicability`, `preconditions`, `inputs`, `outputs`, + `procedure`, `knowledge_sources`, `code_evidence`, `docs_evidence`, + `tools`, `scripts`, `validation` (≥1 item), `failure_modes`. + - `provenance.source_repo`, `provenance.source_revision`, + `provenance.source_paths` (all paths must be in the snapshot). + - `revision.version` and `revision.parent`. + +Source: `schemas/skill-bundle.json` (observed @ 82218b4). + +## Existing corpus: selected NPU performance skills + +These four skills are the starting corpus for hide-and-re-distill and the +A/B/C comparison: + +| Skill | Repo | Path | Purpose | Perf-relevant | +|-------|------|------|---------|---------------| +| profiling-analyze | MindIE-SD @ 8481d39b | `.agents/skills/profiling-analyze/` | 5-layer CANN profiling analysis from CSV/JSON | Yes | +| dit-perf-opt | MindIE-SD | `.agents/skills/dit-perf-opt/` | DiT bottleneck → feature selection → A/B | Yes | +| perf-gate | MindIE-SD | `.agents/skills/perf-gate/` | Same-window A/B protocol & noise floor | Yes | +| ops-profiling | awesome-ascend-skills @ 75ec89ce | `external/cannbot/ops/ops-profiling/` | Operator profiling → roofline | Yes | + +The two `vllm-ascend` skills in the sparse clone are framework-integration and +CI/CD skills, not performance skills. They are not used in this corpus. +Source: `w3b-ascend-corpus-evidence.md` (2026-10-14). + +**License status:** MindIE-SD is Apache-2.0. `awesome-ascend-skills` synced from +GitCode; license is UNKNOWN — flag this before any external publication. + +## Stage 3.4 — Hide-and-re-distill procedure + +Best candidate: `profiling-analyze` from MindIE-SD. + +**Why this candidate:** +- The skill encodes NPU-specific knowledge that is only partially recoverable from + public documentation: CANN CSV field aliasing proof (value-set matching, not + header name matching), silent failure patterns ("export succeeded" ≠ file + exists), and empirical utilization rules (call counts stable across devices, + single-kernel ms varies ±10%, single collective latency varies ~2×). +- Source material available before the skill's cutoff: CANN 24.7+ public CSV + spec, `torch_npu.profiler` API, reference materials in `.agents/skills/profiling-analyze/references/`. +- The distilled version can be compared at the same length budget (~295 lines, + ~1287 words). + +**Temporal cutoff (REMOTE verification required):** +Run `git -C log --follow -- .agents/skills/profiling-analyze/SKILL.md` +on the MindIE-SD clone at revision 8481d39b to find creation and last +substantive change dates. Reported by corpus agent as 6-12 months pre-cutoff, +but the exact dates are INSUFFICIENT_EVIDENCE locally. + +**Procedure:** +1. Archive source snapshot at `cutoff_commit` (the commit just before the skill + was last substantially changed). Remove `.agents/skills/profiling-analyze/` + from the archive (this is the "hidden" material). +2. Keep: CANN public docs, `torch_npu.profiler` API, any referenced source files + that predate the cutoff, the `analyze_trace.py` and `compare_traces.py` + scripts that ship with the skill. +3. Run the sibling workstream's distillation prototype (its entrypoint was + `python -m omnirsi.harness.skill_distill`; that module is not in this + repository) with the distillation config pointing to the archived snapshot, + producing 3-5 candidates. +4. Validate the bundle against the sibling `schemas/skill-bundle.json` (also not + in this repository). +5. Render candidate SKILL.md files from the bundle. +6. Proceed to Stage 3.5 evaluation. + +Source: sibling workstream `skill_distill.py` (observed @ 82218b4), which +implements this exact procedure for the `retire-mlapo-env` task. + +## Stage 3.5 — Skill evaluation contract + +**Three variants:** + +| Variant | What the agent receives | +|---------|------------------------| +| no_skill | Task only; no skill document | +| human | Task + frozen human SKILL.md from `plan/human-/` | +| distilled | Task + rendered candidate SKILL.md from bundle | + +Fix across all variants: same model, same harness, same tools, same task, +same base commit, same budgets. + +**Evaluation measures:** + +| Measure | Type | Notes | +|---------|------|-------| +| Task success | Primary | Frozen validator exit code: 0 = success, 1 = fail, other = inconclusive | +| Correctness | Primary | Does the patch actually pass the verification contract? | +| Regression | Primary | Does the validator's regression check pass? | +| Files inspected | Secondary | From agent trace `tool_calls` count | +| Tool calls | Secondary | From agent trace | +| Failed attempts | Secondary | `failed_commands` from trace | +| Input tokens | Cost | From `turn.completed` events | +| Wall time | Cost | Elapsed seconds per variant | +| Patch minimality | Quality | Lines added/removed relative to oracle diff | +| Repo convention adherence | Quality | Requires human review | + +Tier A tasks: CPU/static correctness only. Tier B tasks: require NPU device. + +**Accept criterion (SkillOpt-derived, adapted for InferRSI):** +The distilled skill is accepted for promotion when, on a held-out task set: +``` +task_success(distilled) > task_success(no_skill) +``` +with no regression relative to `human` on correctness or Tier A validation. +A single pilot result (1 task × 1 repetition each) is not sufficient for +promotion. The accept criterion requires: ≥3 tasks, ≥2 repetitions per variant, +`inconclusive` trials excluded from the success-rate estimate, and a campaign +evidence tree under `evidence//`. + +Do not promote based on token cost alone. Lower input tokens does not imply +better task success. + +Source: sibling workstream pilot result (one Tier A task, all three variants +pass, no statistical difference established — consistent with the criterion +above: INCONCLUSIVE for promotion). +`evidence/skill-bootstrap-20261014/results/pilot-01-summary.json` (observed @ 82218b4). + +**Skill build cost vs per-task runtime benefit:** +Record `build-cost.json` separately from task execution costs. The distillation +run's usage (model calls, elapsed time) is a one-time cost amortized over all +tasks the skill is used for. Do not include distillation cost in per-task ROI. + +## Skill revision lineage + +When an accepted skill is subsequently evolved, preserve the revision chain: + +``` +skills// + SKILL.md (current version, including revision.version and revision.parent) + history/ + v0/SKILL.md (initial promoted version) + v1/SKILL.md (first accepted evolution) + ... +``` + +`revision.parent` points to the previous version's SHA or version string. +Rejected candidates are stored in the evidence tree of the evolution campaign +under `evidence//plan/rejected-candidates/`. +Source: skill bundle schema `revision` field (observed @ 82218b4); skill history +layout is a design decision — no prior implementation exists in this branch. + +## Skill evolution cycle (minimum viable, Phase 1) + +One evolution cycle: + +1. **Select trigger:** a task where the current skill (v0) produced FAIL or + INCONCLUSIVE, or where the human skill outperformed the distilled one by a + measurable margin (not within noise). +2. **Bounded edit:** propose a revision that changes only the `procedure`, + `failure_modes`, or `knowledge_sources` sections, not the `capability` or + `applicability` contract. Length budget: ±20% of current skill length. + Do not replace the entire skill. +3. **Independent evaluation:** use development/selection evidence to choose the + candidate; keep final-test tasks outside adaptive edit selection. Check combined + behavior and unrelated successes, not only the triggering failure. +4. **Accept/reject gate:** apply the frozen task-specific contract. A tie or noisy + result is not an improvement. Preserve the incumbent and report regressions or + inconclusive outcomes without excluding them silently from success estimates. +5. **Revision lineage:** on accept, copy the current `SKILL.md` to `history/v0/` + and write the accepted edit as the new `SKILL.md`. Update its frontmatter + with the new `revision.version`. + +This cycle does not require automatic trace harvesting in Phase 1. The trigger +comes from observed evaluation failures. Harvest-from-real-traces (SkillOpt +Sleep cycle) is deferred to Phase 2. diff --git a/src/inferrsi/knowledge/compositions/npu-skill-factory.json b/src/inferrsi/knowledge/compositions/npu-skill-factory.json new file mode 100644 index 000000000..ae17931f9 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/npu-skill-factory.json @@ -0,0 +1,301 @@ +{ + "authority": "checkout", + "metadata": { + "id": "npu-skill-factory", + "kind": "skill", + "entrypoint": "workflows/maintenance/npu-skill-factory/SKILL.md", + "title": "Design and operation of the InferRSI NPU skill factory: artifact lifecycle, skill evaluation contract, corpus selection, hide-and-re-distill procedure, and skill evolution cycle. Use when deciding where new skill artifacts belong, how to distill a candidate skill, or how to run the No-Skill vs Human-Skill vs Distilled-Skill comparison.\n", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/npu-skill-factory/SKILL.md", + "sha256": "0de28180da76b6cb9d2c9456733011d00d9801f7662afd32959c4c5d2c05a183" + }, + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "applicability": { + "scope": "InferRSI skill lifecycle management", + "prerequisites": "Current candidate inventory and source/evaluation evidence; historical sibling execution interfaces are not required for read-only artifact admission", + "input_contract": "A candidate inventory plus the source and evaluation evidence for each candidate skill; read-only artifact admission needs no historical sibling execution interface", + "produced_artifact": "An admitted or refused skill candidate with its source, evidence and limitation record, and its stable id and owning path", + "failure_modes": [ + "A candidate admitted on an inventory line without source or evaluation evidence", + "A stable id or path assigned twice across owners", + "Indexing or admission reported as validation or promotion", + "Paper-to-code equivalence asserted without a pinned readset" + ], + "refusal_point": "Refuses admission when a candidate has neither source evidence nor a declared evaluation state, and records the refusal instead of leaving the field blank" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [ + { + "url": "https://github.com/VectorSpaceLab/AREX-Skill", + "commit": "ac3fe1af", + "paths": [ + "docs/disco-meta-skills.md", + "docs/disco-workflows.md", + "src/disco/skills/create-paper-module-skill/SKILL.md", + "src/disco/skills/create-paper-module-skill/scripts/create_skill_skeleton.py", + "src/disco/skills/create-paper-module-skill/scripts/validate_skill_tree.py", + "src/disco/modes/skill-policy.ts", + "src/core/repo-skills-library-manager.ts" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/SkillOpt/SkillOpt", + "commit": "343db229", + "paths": [ + "skillopt/evaluation/gate.py", + "skillopt/optimizer/skill.py", + "skillopt/optimizer/clip.py", + "skillopt_sleep/cycle.py", + "skillopt_sleep/harvest_sources.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/WillowMindIE/MindIE-SD", + "commit": "8481d39b", + "paths": [ + ".agents/skills/profiling-analyze/SKILL.md", + ".agents/skills/dit-perf-opt/SKILL.md", + ".agents/skills/perf-gate/SKILL.md", + ".agents/skills/dit-parallel-opt/SKILL.md" + ], + "type": "git", + "revision_precision": "prefix" + } + ], + "empirical_validation": "not_run", + "required_resources": [ + "workflows/maintenance/npu-skill-factory/SKILL.md", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/COMPARISON.md", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/INTEGRATION_NOTES.md", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/QA.md", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/README.md", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/UNREAD_LEADS.md", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/knowledge/evidence-routing.md", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/protocol-details.md", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/readset.md", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/repo-to-skill.md", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/skillopt.md", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/source-manifest.json", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/trace2skill.md", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/updates/bounded-updates.md", + "workflows/maintenance/npu-skill-factory/references/skill-factory-design-20261014.md" + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "checkout:npu-skill-factory.original.navigation", + "revision": "sha256:709ed82e542e2f134c2d27e449fb32152a48270408d90ce74c1c4ee6b20cbce7" + }, + "decision": { + "ref": "checkout:npu-skill-factory.original.decision", + "revision": "sha256:a310dd98b685ca94561470c9320dc174b9fdd70045f15d3c79bda0ded11429b1" + }, + "procedure": { + "ref": "checkout:npu-skill-factory.original.procedure", + "revision": "sha256:12cd2a842d3119592858739ea8cb8a8f6cba14d101d07e555ef5f2793b5f753e", + "requires": [ + "decision" + ] + }, + "original": { + "ref": "checkout:npu-skill-factory.original", + "revision": "sha256:9881e63c945bd4297dfe697e543ab084c13e032df18c46955abb31f3658211a3" + }, + "comparison": { + "ref": "checkout:npu-skill-factory.comparison", + "revision": "sha256:e4ca9448d9dc10eaaf15547bdba0decc59fe8fd1a6a5b2af2a9aa7c9e78a76b5" + }, + "integration_notes": { + "ref": "checkout:npu-skill-factory.integration_notes", + "revision": "sha256:c719f99c6bce7db23cdbf3b9d426b2920770986e600029ae7ded16dd02ffe3a4" + }, + "qa": { + "ref": "checkout:npu-skill-factory.qa", + "revision": "sha256:48afe1626a9eaf6e128b159aae26f051b7bcd1a59c596c19d5c69e47327c4904" + }, + "readme": { + "ref": "checkout:npu-skill-factory.readme", + "revision": "sha256:28874ef5f612e4cbe61568b92496fe7a836536fa80e78b6f9f3cb784be9f4bf1" + }, + "unread_leads": { + "ref": "checkout:npu-skill-factory.unread_leads", + "revision": "sha256:145ee3449f74655fcc181aaf1a956daef6429dede9d7032a6b37edbd548070e6" + }, + "methodology-counterexamples": { + "ref": "checkout:npu-skill-factory.methodology-counterexamples", + "revision": "sha256:7ac7f2203943180cab5a3a9015fad3efada043017fc8890ebe5d550356fa594e" + }, + "evidence-routing": { + "ref": "checkout:npu-skill-factory.evidence-routing", + "revision": "sha256:f161e29b72176d359a1a9ea252eed2205858875e9e74d6dd7c193f8a2d655f05" + }, + "learning-to-commit": { + "ref": "checkout:npu-skill-factory.learning-to-commit", + "revision": "sha256:8e6ec85047234d0f7c5a057a3ac5bf6c6e5e1f294219ab436343d2a8e8e24639" + }, + "protocol-details": { + "ref": "checkout:npu-skill-factory.protocol-details", + "revision": "sha256:72e778d1998ec4797d9dac462472d51d538871d7accfa5bddca79a55d361ff84" + }, + "readset": { + "ref": "checkout:npu-skill-factory.readset", + "revision": "sha256:86d4a00872b1ae983e37aa64dee5f5b34a077a5de0466bd26a92fc1c9a04ee67" + }, + "repo-to-skill": { + "ref": "checkout:npu-skill-factory.repo-to-skill", + "revision": "sha256:1761b1c7442557a52a960562ddcc3df553e9e612d3b17dfcc336068cedd5a948" + }, + "skillopt": { + "ref": "checkout:npu-skill-factory.skillopt", + "revision": "sha256:20314f010eef7d18cc4e514b8cdebd0c93321a84c2abd37d4faa687b8b162cde" + }, + "source-manifest": { + "ref": "checkout:npu-skill-factory.source-manifest", + "revision": "sha256:67186a8326dcc1f522772ddd94323c5c3fcfcd82c1e5ce56933d1443e7e51bde" + }, + "trace2skill": { + "ref": "checkout:npu-skill-factory.trace2skill", + "revision": "sha256:1292d3b5e931dc9bec5068c13d087fd8dfbab09ef4df231d13c300e5d07f0895" + }, + "bounded-updates": { + "ref": "checkout:npu-skill-factory.bounded-updates", + "revision": "sha256:90f88bfdc2a49046223a3eec7947983a598e4f28adc6dfabb4f337027a2b300f" + }, + "skill-factory-design-20261014": { + "ref": "checkout:npu-skill-factory.skill-factory-design-20261014", + "revision": "sha256:6e1e59a9eeee0128e0013636bb7a684ac4db92412c50e3ea974191c9a9689027" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "decision" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure" + ] + }, + "originals": { + "layer": "L3", + "required": [ + "original", + "comparison", + "integration_notes", + "qa", + "readme", + "unread_leads", + "methodology-counterexamples", + "evidence-routing", + "learning-to-commit", + "protocol-details", + "readset", + "repo-to-skill", + "skillopt", + "source-manifest", + "trace2skill", + "bounded-updates", + "skill-factory-design-20261014" + ] + } + }, + "skill": { + "directory_entry": true + } + } + }, + "directory_resources": { + "workflows/maintenance/npu-skill-factory/SKILL.md": "original", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/COMPARISON.md": "comparison", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/INTEGRATION_NOTES.md": "integration_notes", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/QA.md": "qa", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/README.md": "readme", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/UNREAD_LEADS.md": "unread_leads", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md": "methodology-counterexamples", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/knowledge/evidence-routing.md": "evidence-routing", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md": "learning-to-commit", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/protocol-details.md": "protocol-details", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/readset.md": "readset", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/repo-to-skill.md": "repo-to-skill", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/skillopt.md": "skillopt", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/source-manifest.json": "source-manifest", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/references/trace2skill.md": "trace2skill", + "workflows/maintenance/npu-skill-factory/references/papers-20261015/updates/bounded-updates.md": "bounded-updates", + "workflows/maintenance/npu-skill-factory/references/skill-factory-design-20261014.md": "skill-factory-design-20261014" + } +} diff --git a/tests/knowledge/test_atomic_workflows.py b/tests/knowledge/test_atomic_workflows.py index b3f9b4a7d..7420cdd7b 100644 --- a/tests/knowledge/test_atomic_workflows.py +++ b/tests/knowledge/test_atomic_workflows.py @@ -2,7 +2,7 @@ import json import shutil -from pathlib import Path +from pathlib import Path, PurePosixPath import pytest @@ -17,7 +17,8 @@ FIXTURE = Path(__file__).resolve().parents[1] / "fixtures/atomic-reader/workflow-domain-v0.3.4.json" RELEASE = json.loads(FIXTURE.read_bytes()) KNOWLEDGE = FIXTURE.parents[3] / "src/inferrsi/knowledge" -GUIDES = ("cite-check-downstream-pr", "claim-contract", "competitor-scan") +GUIDES = ("cite-check-downstream-pr", "claim-contract", "competitor-scan", "npu-skill-factory") +LIBRARY = "src/inferrsi/knowledge/data/skill_library/" @pytest.fixture(scope="module") @@ -26,21 +27,29 @@ def workflow_installation(tmp_path_factory): author = make_author_root(root) pinned = root / "release" shutil.copytree(RELEASE_ROOT, pinned) - (author / "atoms/workflows").mkdir() for name in GUIDES: row = RELEASE["refs"]["checkout:" + name] - atom = f"atoms/{name}.original.json" - descriptor = json.loads((KNOWLEDGE / atom).read_bytes()) - body = "atoms/" + descriptor["content"]["guide.md"]["path"] - for relative in (atom, body, f"compositions/{name}.json"): - shutil.copyfile(KNOWLEDGE / relative, author / relative) - data = (author / body).read_bytes() - assert RELEASE["files"][row["entry_source"]] == {"sha256": digest(data), "bytes": len(data)} - assert row["required_resources"] == {row["entry_source"]: digest(data)} - assert row["dependencies"] == {} and row["relative_guide_links"] == {} - original = pinned / descriptor["metadata"]["sources"][0]["path"] - original.parent.mkdir(parents=True, exist_ok=True) - original.write_bytes(data) + composition = Path("compositions", name + ".json") + shutil.copyfile(KNOWLEDGE / composition, author / composition) + declaration = json.loads((author / composition).read_bytes()) + bindings = declaration["directory_resources"] + assert bindings.keys() == row["required_resources"].keys() + nodes = declaration["metadata"]["composition"]["nodes"] + for path, key in bindings.items(): + identity = nodes[key]["ref"].removeprefix("checkout:") + atom = Path("atoms", identity + ".json") + shutil.copyfile(KNOWLEDGE / atom, author / atom) + descriptor = json.loads((author / atom).read_bytes()) + (resource,) = descriptor["content"].values() + body = Path("atoms", resource["path"]) + (author / body).parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(KNOWLEDGE / body, author / body) + data = (author / body).read_bytes() + assert RELEASE["files"][path] == {"sha256": digest(data), "bytes": len(data)} + assert row["required_resources"][path] == digest(data) + original = pinned / (LIBRARY + path) + original.parent.mkdir(parents=True, exist_ok=True) + original.write_bytes(data) target = root / "installed" generation = build_generation(author, target, permits=allow, source_roots={RELEASE["source_commit"]: pinned}) @@ -58,15 +67,18 @@ def test_checkout_host_and_layered_selection_preserve_workflow_guide(workflow_in _, bundle = installed.read_resolved(ref, revision=revision) host = target / "skills" / name raw = (host / "SKILL.md").read_bytes() - assert sorted(p.name for p in host.iterdir()) == ["SKILL.md"] - assert bundle.content == {guide: raw} and bundle.dependencies == {} - assert bundle.metadata["required_resources"] == [guide] + directory = PurePosixPath(guide).parent + files = {(directory / p.relative_to(host).as_posix()).as_posix(): p.read_bytes() + for p in host.rglob("*") if p.is_file()} + assert {path: digest(data) for path, data in files.items()} == row["required_resources"] + assert bundle.content == files and bundle.dependencies == row["dependencies"] == {} + assert bundle.metadata["required_resources"] == sorted(files) assert digest(raw) == row["entry_sha256"] == row["guide_sha256"] assert digest(canonical(bundle.view()["resources"])) == row["resource_set"] - assert bundle.metadata["state"] == "candidate" and bundle.metadata["origin"] == ["first-party"] + assert bundle.metadata["state"] == "candidate" results = {} for layer in ("L0", "L1", "L2", "L3"): - selected = select(installed, ref, layer, len(raw)) + selected = select(installed, ref, layer, sum(map(len, files.values()))) assert selected.receipt["status"] == "delivered" size = sum(map(len, selected.bodies)) assert size == selected.receipt["body_bytes"] @@ -79,9 +91,12 @@ def test_checkout_host_and_layered_selection_preserve_workflow_guide(workflow_in for item, body in zip(selected.receipt["delivered"], selected.bodies, strict=True): lo, hi = item["source_byte_range"] assert item["source"]["commit"] == RELEASE["source_commit"] - assert item["source_path"] == "src/inferrsi/knowledge/data/skill_library/" + guide + path = item["source_path"].removeprefix(LIBRARY) + assert item["source_path"] == LIBRARY + path + if layer != "L3": + assert path == guide assert item["source_range_verification"] == "verified_at_build" - assert body == raw[lo:hi] and digest(body) == item["source_sha256"] + assert body == files[path][lo:hi] and digest(body) == item["source_sha256"] for denied in [ref, *(item["ref"] for item in selected.receipt["delivered"])]: result = select(installed, ref, layer, size, permits=lambda pin, op: pin.ref != denied) assert_empty(result, "permission_denied") @@ -92,6 +107,7 @@ def test_checkout_host_and_layered_selection_preserve_workflow_guide(workflow_in assert b"metadata:" not in navigation (decision,) = results["L1"] _, fields = _skill_search_source(decision.decode()) + assert fields["origin"] == bundle.metadata["origin"] assert fields["empirical_validation"] == bundle.metadata["empirical_validation"] == "not_run" projected = DecisionSource(ref, revision, "skill", guide, guide, fields).project()["card"] assert projected["revision"] == revision @@ -101,7 +117,32 @@ def test_checkout_host_and_layered_selection_preserve_workflow_guide(workflow_in assert compared["status"] == row["status"] == "partial" assert compared["missing_fields"] == row["missing_fields"] == ["validation"] assert results["L2"][0] == decision and b"".join(results["L2"]) == raw - assert results["L3"] == (raw,) + assert results["L3"] == tuple(files[path] for path in sorted(files)) + + +def test_factory_exports_linked_notes_and_preserves_source_attribution(workflow_installation): + installed, target = workflow_installation + name = "npu-skill-factory" + ref = "checkout:" + name + row = RELEASE["refs"][ref] + _, bundle = installed.read_resolved(ref, revision=installed.catalog[ref]["revision"]) + host = target / "skills" / name + _, fields = _skill_search_source((host / "SKILL.md").read_text(encoding="utf-8")) + assert bundle.metadata["origin"] == ["external"] + assert bundle.metadata["attribution"] == bundle.metadata["sources"][1:] == fields["sources"] + assert len(fields["sources"]) == 3 + assert len(row["relative_guide_links"]) == 5 and len(row["required_resources"]) == 17 + for link, old in row["relative_guide_links"].items(): + assert old["in_directory"] and digest((host / link).read_bytes()) == old["sha256"] + assert len(fields["provenance_readsets"]) == 14 + for readset in fields["provenance_readsets"]: + original = (PurePosixPath(row["guide"]).parent / readset).as_posix() + assert digest((host / readset).read_bytes()) == row["required_resources"][original] + manifest = host / "references/papers-20261015/references/source-manifest.json" + declared = json.loads(manifest.read_bytes()) + assert len(declared) == 8 + assert all(item["source_copy_in_deliverable"] is False for item in declared) + assert {item["sha256"] for item in declared}.isdisjoint(row["required_resources"].values()) @pytest.mark.parametrize("name", GUIDES) From e596898cefaf0c36f42591eb8d7f830629374382 Mon Sep 17 00:00:00 2001 From: Dong1017 <55723162+Dong1017@users.noreply.github.com> Date: Fri, 27 Nov 2026 05:57:46 +0800 Subject: [PATCH 12/12] Preserve declared references on four Workflow Reader entries Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com> --- src/inferrsi/knowledge/atomic_build.py | 22 +- .../knowledge/atomic_skill_directory.py | 31 +- .../draft-acceptance-issue.original.json | 100 ++++ ...on-analysis.capability-presence-audit.json | 128 +++++ ...epository-evolution-analysis.original.json | 224 +++++++++ ...analysis.rtk-consumer-path-transition.json | 128 +++++ .../atoms/rsi-evidence.decision-cases.json | 85 ++++ .../atoms/rsi-evidence.license-mit.json | 89 ++++ .../knowledge/atoms/rsi-evidence.license.json | 89 ++++ .../atoms/rsi-evidence.mechanisms.json | 85 ++++ .../knowledge/atoms/rsi-evidence.notice.json | 89 ++++ .../atoms/rsi-evidence.omni-experiments.json | 70 +++ .../atoms/rsi-evidence.original.json | 103 ++++ .../knowledge/atoms/rsi-evidence.readme.json | 85 ++++ .../atoms/rsi-evidence.source-ledger.json | 85 ++++ .../skill-evolution-playbook.original.json | 104 ++++ .../atoms/workflows/draft-acceptance-issue.md | 74 +++ .../repository-evolution-analysis.md | 443 ++++++++++++++++++ .../references/capability-presence-audit.md | 72 +++ .../rtk-consumer-path-transition.md | 156 ++++++ .../knowledge/atoms/workflows/rsi-evidence.md | 154 ++++++ .../references/loopx-goal-governance/LICENSE | 202 ++++++++ .../loopx-goal-governance/LICENSE-MIT.md | 21 + .../loopx-goal-governance/NOTICE.md | 9 + .../loopx-goal-governance/README.md | 77 +++ .../loopx-goal-governance/decision-cases.md | 61 +++ .../loopx-goal-governance/mechanisms.md | 197 ++++++++ .../loopx-goal-governance/source-ledger.json | 337 +++++++++++++ .../references/omni-experiments.md | 99 ++++ .../workflows/skill-evolution-playbook.md | 217 +++++++++ .../compositions/draft-acceptance-issue.json | 109 +++++ .../repository-evolution-analysis.json | 248 ++++++++++ .../knowledge/compositions/rsi-evidence.json | 168 +++++++ .../skill-evolution-playbook.json | 113 +++++ tests/knowledge/test_atomic_workflows.py | 127 ++++- 35 files changed, 4365 insertions(+), 36 deletions(-) create mode 100644 src/inferrsi/knowledge/atoms/draft-acceptance-issue.original.json create mode 100644 src/inferrsi/knowledge/atoms/repository-evolution-analysis.capability-presence-audit.json create mode 100644 src/inferrsi/knowledge/atoms/repository-evolution-analysis.original.json create mode 100644 src/inferrsi/knowledge/atoms/repository-evolution-analysis.rtk-consumer-path-transition.json create mode 100644 src/inferrsi/knowledge/atoms/rsi-evidence.decision-cases.json create mode 100644 src/inferrsi/knowledge/atoms/rsi-evidence.license-mit.json create mode 100644 src/inferrsi/knowledge/atoms/rsi-evidence.license.json create mode 100644 src/inferrsi/knowledge/atoms/rsi-evidence.mechanisms.json create mode 100644 src/inferrsi/knowledge/atoms/rsi-evidence.notice.json create mode 100644 src/inferrsi/knowledge/atoms/rsi-evidence.omni-experiments.json create mode 100644 src/inferrsi/knowledge/atoms/rsi-evidence.original.json create mode 100644 src/inferrsi/knowledge/atoms/rsi-evidence.readme.json create mode 100644 src/inferrsi/knowledge/atoms/rsi-evidence.source-ledger.json create mode 100644 src/inferrsi/knowledge/atoms/skill-evolution-playbook.original.json create mode 100644 src/inferrsi/knowledge/atoms/workflows/draft-acceptance-issue.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/repository-evolution-analysis.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/repository-evolution-analysis/references/capability-presence-audit.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/repository-evolution-analysis/references/rtk-consumer-path-transition.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/rsi-evidence.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/LICENSE create mode 100644 src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/LICENSE-MIT.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/NOTICE.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/README.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/decision-cases.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/mechanisms.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/source-ledger.json create mode 100644 src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/omni-experiments.md create mode 100644 src/inferrsi/knowledge/atoms/workflows/skill-evolution-playbook.md create mode 100644 src/inferrsi/knowledge/compositions/draft-acceptance-issue.json create mode 100644 src/inferrsi/knowledge/compositions/repository-evolution-analysis.json create mode 100644 src/inferrsi/knowledge/compositions/rsi-evidence.json create mode 100644 src/inferrsi/knowledge/compositions/skill-evolution-playbook.json diff --git a/src/inferrsi/knowledge/atomic_build.py b/src/inferrsi/knowledge/atomic_build.py index 5b5e8be97..a50e9284b 100644 --- a/src/inferrsi/knowledge/atomic_build.py +++ b/src/inferrsi/knowledge/atomic_build.py @@ -12,7 +12,7 @@ from .atomic_generation import FORMAT, PUBLIC_TASKS, SEAL, InstalledGeneration, digest, owned_path from .atomic_json import matches_span, member_spans from .atomic_reader import atom_material, permits_operations -from .atomic_skill_directory import directory_content, export_directory_skill, skill_spans +from .atomic_skill_directory import directory_dependencies, export_directory_skill, skill_spans from .decision_cards import DecisionSource from .knowledge_operations import IDENTITY, Bundle, _json, case_required_resources, safe_path @@ -149,9 +149,15 @@ def _authored(directory, path, field, descriptor, material, roots) -> tuple[Atom if field not in metadata or ("atom" in metadata and "composition" in metadata): raise ValueError(f"{path.name} must declare one {field}") content = {} - directory_export = metadata[field].get("skill") == {"directory_entry": True} - if directory_export and "directory_resources" not in descriptor: - raise ValueError("Directory Skill export requires checked original directory resources") + dependencies = descriptor.get("dependencies", {}) + directory_required = metadata[field].get("skill") == {"directory_entry": True} + if (field == "composition" and metadata["kind"] == "skill" + and descriptor.get("authority") == "checkout"): + original = next(iter(metadata.get("sources", [])), {}).get("path", "") + guide = PurePosixPath(metadata.get("entrypoint", "")).name == "SKILL.md" + directory_required |= guide or original.endswith(f"/{metadata['id']}/SKILL.md") + if directory_required and "directory_resources" not in descriptor: + raise ValueError("Directory Skill requires checked original directory resources") if "case_resources" in descriptor: if field != "composition" or metadata["kind"] != "case" or "content" in descriptor: raise ValueError("Only a Case composition may bind its content through case_resources") @@ -159,13 +165,13 @@ def _authored(directory, path, field, descriptor, material, roots) -> tuple[Atom if "directory_resources" in descriptor: if (field != "composition" or metadata["kind"] != "skill" or descriptor.get("authority") != "checkout" or "content" in descriptor - or descriptor.get("dependencies")): - raise ValueError("Directory resources require a self-contained checkout Skill") + or dependencies): + raise ValueError("Checkout Skill directories must use source-declared dependencies") bindings = descriptor["directory_resources"] if not isinstance(bindings, dict): raise ValueError("Skill directory resources must bind original relative names") content, origins = _pinned_resources(metadata, bindings, material) - content = directory_content(metadata, bindings, content, origins, material, roots) + dependencies = directory_dependencies(metadata, bindings, content, origins, material, roots) for name, value in descriptor.get("content", {}).items(): safe_path(name) if isinstance(value, dict) and value.keys() == {"path"}: @@ -184,7 +190,7 @@ def _authored(directory, path, field, descriptor, material, roots) -> tuple[Atom if "navigation.json" in content: raise ValueError("Explicit navigation content must declare its entrypoint") content["navigation.json"] = _json(metadata[field]) - bundle = Bundle(metadata, content, descriptor.get("dependencies", {})) + bundle = Bundle(metadata, content, dependencies) ref = descriptor.get("authority", "package") + ":" + metadata["id"] return AtomPin(ref, bundle.revision), bundle diff --git a/src/inferrsi/knowledge/atomic_skill_directory.py b/src/inferrsi/knowledge/atomic_skill_directory.py index 3a61e7c90..2b5f5932d 100644 --- a/src/inferrsi/knowledge/atomic_skill_directory.py +++ b/src/inferrsi/knowledge/atomic_skill_directory.py @@ -8,7 +8,7 @@ from ._skill_selection import skill_procedure from .atomic_composition import AtomPin, select_routes -from .atomic_generation import directory_skill_path, owned_path +from .atomic_generation import digest, directory_skill_path, owned_path from .knowledge_operations import Bundle, _tree, safe_path from .skill_catalog import _effective, _frontmatter_parts @@ -27,21 +27,26 @@ def skill_spans(body: bytes) -> dict: "procedure": ("L2", header.end(), len(body))} -def _verify_directory_routes(declaration, bindings, guide, source, material): +def _verify_directory_routes(declaration, bindings, guide, source, material, dependencies): sections = skill_spans(guide) if any(any(route.get(key) for key in ("when", "optional", "supersedes", "conflicts")) for route in declaration["routes"].values()): raise ValueError("Directory routes must preserve their unconditional delivery") nodes = declaration["nodes"] - originals = {AtomPin(nodes[name]["ref"], nodes[name]["revision"]) for name in bindings.values()} + file_pins = {path: AtomPin(nodes[name]["ref"], nodes[name]["revision"]) + for path, name in bindings.items()} for layer, names in (("L0", ["navigation"]), ("L1", ["decision"]), ("L2", ["decision", "procedure"]), ("L3", [])): selected = select_routes(declaration, layer=layer, context={}, case=None, finding=None) - pins = dict.fromkeys(use.pin for use in selected.required) + pins = list(dict.fromkeys(use.pin for use in selected.required)) if layer == "L3": - if pins.keys() != originals: + if set(pins) != set(file_pins.values()): raise ValueError("Skill L3 must deliver the complete original directory") continue + if layer == "L2": + if pins[len(names):] != [file_pins[path] for path in dependencies]: + raise ValueError("Skill L2 must deliver its declared original references") + pins = pins[:len(names)] actual = [] for pin in pins: if pin not in material: @@ -54,8 +59,8 @@ def _verify_directory_routes(declaration, bindings, guide, source, material): raise ValueError(f"Skill {layer} must deliver its own pinned guide sections") -def directory_content(metadata, bindings, content, origins, material, roots) -> dict[str, bytes]: - """Keep all the original names and bytes of a self-contained checkout Skill directory.""" +def directory_dependencies(metadata, bindings, content, origins, material, roots) -> dict[str, str]: + """Verify the original Skill directory and derive the explicitly declared file revisions.""" entry = PurePosixPath(safe_path(metadata["entrypoint"])) if (not isinstance(bindings, dict) or entry.as_posix() not in bindings or entry.name != "SKILL.md" or entry.parent.name != metadata["id"]): @@ -74,14 +79,18 @@ def directory_content(metadata, bindings, content, origins, material, roots) -> raise ValueError(f"Skill resource differs from its original relative source: {name}") root = roots[source["commit"]] directory = owned_path(root, original.parent.as_posix()) - if _effective(directory).get("references"): - raise ValueError("Self-contained directory cannot omit declared Skill references") released = _tree(directory, entry.parent.as_posix(), root=root) if content != released or metadata["required_resources"] != sorted(released): raise ValueError("Skill directory bindings must cover the complete original directory") + dependencies = {} + for reference in _effective(directory).get("references", []): + path = (entry.parent / safe_path(reference)).as_posix() + if path not in released: + raise ValueError(f"Missing declared Skill reference: {path}") + dependencies[path] = "sha256:" + digest(released[path]) _verify_directory_routes(metadata["composition"], bindings, content[entry.as_posix()], - source, material) - return content + source, material, dependencies) + return dependencies def export_directory_skill(bundle: Bundle) -> tuple[str, dict[str, bytes]]: diff --git a/src/inferrsi/knowledge/atoms/draft-acceptance-issue.original.json b/src/inferrsi/knowledge/atoms/draft-acceptance-issue.original.json new file mode 100644 index 000000000..42076f0cc --- /dev/null +++ b/src/inferrsi/knowledge/atoms/draft-acceptance-issue.original.json @@ -0,0 +1,100 @@ +{ + "authority": "checkout", + "metadata": { + "id": "draft-acceptance-issue.original", + "kind": "knowledge", + "entrypoint": "guide.md", + "title": "Draft a campaign acceptance issue with checklist, RunSpec, evidence paths, and placeholders for baseline/candidate SHAs.", + "origin": [ + "first-party" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/draft-acceptance-issue/SKILL.md", + "sha256": "2c14533c067c51b9763f80a9df0bf5eb5acd398f4265790c57039fed96d4c497" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Opening a new acceptance campaign in an RSI-style repository, before any baseline or candidate run", + "prerequisites": "A chosen campaign subject and an empty evidence// tree copied from evidence/_template/; SHAs may still be placeholders", + "input_contract": "A campaign id of the form {model-or-scenario}/{device}x{count}, any user-supplied criteria or accepted plan, and available workload/baseline/calibration evidence for deriving missing targets", + "produced_artifact": "An acceptance issue body with campaign id, pinned baseline and candidate SHAs, RunSpec, criteria source and derivation including gaps and freeze authority, gates, evidence paths, initial verdict and a downstream citation blurb", + "failure_modes": [ + "Gates written after the search loop has already run", + "Campaign SHAs committed into recipes/, benchmarks/, skills or workflow defaults", + "PASS claimed without a validator/ freeze and a results/ rationale" + ], + "refusal_point": "Refuses to state a verdict other than INCONCLUSIVE while the validator freeze or results rationale is absent" + }, + "state": "candidate", + "limitations": [ + "Drafts an issue only; it freezes no gate and runs no measurement.", + "The placeholder SHA convention depends on the campaign owner filling them in later.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/draft-acceptance-issue/SKILL.md", + "byte_range": [ + 0, + 4373 + ], + "sha256": "2c14533c067c51b9763f80a9df0bf5eb5acd398f4265790c57039fed96d4c497" + } + } + }, + "content": { + "guide.md": { + "path": "workflows/draft-acceptance-issue.md" + } + }, + "parts": { + "navigation": { + "skill_section": "navigation", + "layer": "L0", + "byte_range": [ + 0, + 167 + ], + "sha256": "58706d39daa9a09f6ffe2e9fc498095e8431b8bb31bc277d244e334704683c75" + }, + "decision": { + "skill_section": "decision", + "layer": "L1", + "byte_range": [ + 0, + 2861 + ], + "sha256": "8e6793ae5ee565507a43588828c25e66a7fd1d32fac153b5f7be76b72bcf3277" + }, + "procedure": { + "skill_section": "procedure", + "layer": "L2", + "byte_range": [ + 2861, + 4373 + ], + "sha256": "fe9aa75697f5223bf61fb31b6eeec4ee8a1983891545398bdeeed8cb5a5e0700" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/repository-evolution-analysis.capability-presence-audit.json b/src/inferrsi/knowledge/atoms/repository-evolution-analysis.capability-presence-audit.json new file mode 100644 index 000000000..e01bd2983 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/repository-evolution-analysis.capability-presence-audit.json @@ -0,0 +1,128 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Capability presence audit", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/research/repository-evolution-analysis/references/capability-presence-audit.md", + "sha256": "c21eb4a6aabe811a49a6540a34c54dbcfdcf7efae3052a79b54034c7838026a5" + } + ], + "origin": [ + "external" + ], + "attribution": [ + { + "url": "https://github.com/LearningToCommit/LearningToCommit", + "commit": "7e5a1d77", + "paths": [ + "data_construction/s1_scan_commits.py", + "data_construction/s3_tag.py", + "data_construction/s4_sample.py", + "data_construction/s5_build.py", + "modules/agent.py", + "modules/prompt_builder.py", + "modules/trajectory_to_md.py", + "system_prompts/solve_with_skill.txt", + "system_prompts/learn_reflect.txt", + "evaluation/pairwise_judge.py", + "evaluation/programmatic_metrics.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "77800032", + "paths": [ + "internal/", + "docs/" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "4b5d6d725fae3d8a263f6e43c707400e3765b84f", + "paths": [ + "internal/library/rtk.go", + "internal/library/rtk_upgrade.go", + "internal/proc/path_other.go", + "internal/proc/path_windows.go", + "internal/provider/install_windows.go" + ], + "type": "git", + "revision_precision": "full" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "9848a9062a65c49e074c09770dc7de73dd012bea", + "paths": [ + "internal/library/rtk.go", + "internal/library/rtk_upgrade.go", + "internal/proc/path_other.go", + "internal/proc/path_windows.go", + "internal/provider/install_windows.go", + "internal/library/rtk_path.go", + "internal/library/rtk_path_other.go", + "internal/library/rtk_path_windows.go", + "internal/library/rtk_path_test.go", + "internal/library/rtk_test.go", + "internal/library/rtk_upgrade_test.go", + "internal/library/library_test.go", + "internal/gui/library.go", + "internal/gui/assets/library.js", + "internal/gui/tests/library-rtk-path.test.cjs", + "library_cli.go", + "LICENSE" + ], + "type": "git", + "revision_precision": "full" + } + ], + "applicability": { + "scope": "any software repository with a recoverable git history", + "prerequisites": "git history access, optionally LearningToCommit-style benchmark for evaluation" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "The RTK transition is a learning example, not an independent heldout task; upstream tests were inspected, not executed.", + "Existing audit and synthetic KV comparison adapters are not a generic historical coding-task evaluator.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "id": "repository-evolution-analysis.capability-presence-audit", + "kind": "knowledge", + "entrypoint": "capability-presence-audit.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/research/repository-evolution-analysis/references/capability-presence-audit.md", + "byte_range": [ + 0, + 11461 + ], + "sha256": "c21eb4a6aabe811a49a6540a34c54dbcfdcf7efae3052a79b54034c7838026a5" + } + } + }, + "content": { + "capability-presence-audit.md": { + "path": "workflows/repository-evolution-analysis/references/capability-presence-audit.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/repository-evolution-analysis.original.json b/src/inferrsi/knowledge/atoms/repository-evolution-analysis.original.json new file mode 100644 index 000000000..c3e1fa78c --- /dev/null +++ b/src/inferrsi/knowledge/atoms/repository-evolution-analysis.original.json @@ -0,0 +1,224 @@ +{ + "authority": "checkout", + "metadata": { + "id": "repository-evolution-analysis.original", + "kind": "knowledge", + "entrypoint": "guide.md", + "title": "Analyze a repository's commit history to build a capability-evolution model: what the system can do, how it got there, and what patterns allow it to iterate quickly. Use to produce history-derived knowledge for agent skill conditioning, and to design temporal-split benchmarks for skill evaluation.\n", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/research/repository-evolution-analysis/SKILL.md", + "sha256": "0f48cc6a77b3ac861af698048be7c250c3ef5c225dc238b9a0e6d71208cbd93e" + }, + { + "url": "https://github.com/LearningToCommit/LearningToCommit", + "commit": "7e5a1d77", + "paths": [ + "data_construction/s1_scan_commits.py", + "data_construction/s3_tag.py", + "data_construction/s4_sample.py", + "data_construction/s5_build.py", + "modules/agent.py", + "modules/prompt_builder.py", + "modules/trajectory_to_md.py", + "system_prompts/solve_with_skill.txt", + "system_prompts/learn_reflect.txt", + "evaluation/pairwise_judge.py", + "evaluation/programmatic_metrics.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "77800032", + "paths": [ + "internal/", + "docs/" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "4b5d6d725fae3d8a263f6e43c707400e3765b84f", + "paths": [ + "internal/library/rtk.go", + "internal/library/rtk_upgrade.go", + "internal/proc/path_other.go", + "internal/proc/path_windows.go", + "internal/provider/install_windows.go" + ], + "type": "git", + "revision_precision": "full" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "9848a9062a65c49e074c09770dc7de73dd012bea", + "paths": [ + "internal/library/rtk.go", + "internal/library/rtk_upgrade.go", + "internal/proc/path_other.go", + "internal/proc/path_windows.go", + "internal/provider/install_windows.go", + "internal/library/rtk_path.go", + "internal/library/rtk_path_other.go", + "internal/library/rtk_path_windows.go", + "internal/library/rtk_path_test.go", + "internal/library/rtk_test.go", + "internal/library/rtk_upgrade_test.go", + "internal/library/library_test.go", + "internal/gui/library.go", + "internal/gui/assets/library.js", + "internal/gui/tests/library-rtk-path.test.cjs", + "library_cli.go", + "LICENSE" + ], + "type": "git", + "revision_precision": "full" + } + ], + "applicability": { + "scope": "any software repository with a recoverable git history", + "prerequisites": "git history access, optionally LearningToCommit-style benchmark for evaluation" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "The RTK transition is a learning example, not an independent heldout task; upstream tests were inspected, not executed.", + "Existing audit and synthetic KV comparison adapters are not a generic historical coding-task evaluator.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [ + { + "url": "https://github.com/LearningToCommit/LearningToCommit", + "commit": "7e5a1d77", + "paths": [ + "data_construction/s1_scan_commits.py", + "data_construction/s3_tag.py", + "data_construction/s4_sample.py", + "data_construction/s5_build.py", + "modules/agent.py", + "modules/prompt_builder.py", + "modules/trajectory_to_md.py", + "system_prompts/solve_with_skill.txt", + "system_prompts/learn_reflect.txt", + "evaluation/pairwise_judge.py", + "evaluation/programmatic_metrics.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "77800032", + "paths": [ + "internal/", + "docs/" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "4b5d6d725fae3d8a263f6e43c707400e3765b84f", + "paths": [ + "internal/library/rtk.go", + "internal/library/rtk_upgrade.go", + "internal/proc/path_other.go", + "internal/proc/path_windows.go", + "internal/provider/install_windows.go" + ], + "type": "git", + "revision_precision": "full" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "9848a9062a65c49e074c09770dc7de73dd012bea", + "paths": [ + "internal/library/rtk.go", + "internal/library/rtk_upgrade.go", + "internal/proc/path_other.go", + "internal/proc/path_windows.go", + "internal/provider/install_windows.go", + "internal/library/rtk_path.go", + "internal/library/rtk_path_other.go", + "internal/library/rtk_path_windows.go", + "internal/library/rtk_path_test.go", + "internal/library/rtk_test.go", + "internal/library/rtk_upgrade_test.go", + "internal/library/library_test.go", + "internal/gui/library.go", + "internal/gui/assets/library.js", + "internal/gui/tests/library-rtk-path.test.cjs", + "library_cli.go", + "LICENSE" + ], + "type": "git", + "revision_precision": "full" + } + ], + "empirical_validation": "not_run", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/research/repository-evolution-analysis/SKILL.md", + "byte_range": [ + 0, + 22892 + ], + "sha256": "0f48cc6a77b3ac861af698048be7c250c3ef5c225dc238b9a0e6d71208cbd93e" + } + } + }, + "content": { + "guide.md": { + "path": "workflows/repository-evolution-analysis.md" + } + }, + "parts": { + "navigation": { + "skill_section": "navigation", + "layer": "L0", + "byte_range": [ + 0, + 359 + ], + "sha256": "7d51fa6362de3f3fe6da29fddbb4825077593ae7e8167f66fb93767ebd9117b6" + }, + "decision": { + "skill_section": "decision", + "layer": "L1", + "byte_range": [ + 0, + 4449 + ], + "sha256": "7ced3a4f8df07fdea06e5e8a379fe2ec6491eb739f50368384fdb45ef08a7e4c" + }, + "procedure": { + "skill_section": "procedure", + "layer": "L2", + "byte_range": [ + 4449, + 22892 + ], + "sha256": "b4b1e3f25edee40978060a3cc1613af09d5e0b8d3854d08545619f60f04990ef" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/repository-evolution-analysis.rtk-consumer-path-transition.json b/src/inferrsi/knowledge/atoms/repository-evolution-analysis.rtk-consumer-path-transition.json new file mode 100644 index 000000000..8fad6446c --- /dev/null +++ b/src/inferrsi/knowledge/atoms/repository-evolution-analysis.rtk-consumer-path-transition.json @@ -0,0 +1,128 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Worked transition: manager discovery is not consumer reachability", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/research/repository-evolution-analysis/references/rtk-consumer-path-transition.md", + "sha256": "a70b1d128fb5e0ac12292a290d624f218a0831d7581fe8980b62661473e0f2b7" + } + ], + "origin": [ + "external" + ], + "attribution": [ + { + "url": "https://github.com/LearningToCommit/LearningToCommit", + "commit": "7e5a1d77", + "paths": [ + "data_construction/s1_scan_commits.py", + "data_construction/s3_tag.py", + "data_construction/s4_sample.py", + "data_construction/s5_build.py", + "modules/agent.py", + "modules/prompt_builder.py", + "modules/trajectory_to_md.py", + "system_prompts/solve_with_skill.txt", + "system_prompts/learn_reflect.txt", + "evaluation/pairwise_judge.py", + "evaluation/programmatic_metrics.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "77800032", + "paths": [ + "internal/", + "docs/" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "4b5d6d725fae3d8a263f6e43c707400e3765b84f", + "paths": [ + "internal/library/rtk.go", + "internal/library/rtk_upgrade.go", + "internal/proc/path_other.go", + "internal/proc/path_windows.go", + "internal/provider/install_windows.go" + ], + "type": "git", + "revision_precision": "full" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "9848a9062a65c49e074c09770dc7de73dd012bea", + "paths": [ + "internal/library/rtk.go", + "internal/library/rtk_upgrade.go", + "internal/proc/path_other.go", + "internal/proc/path_windows.go", + "internal/provider/install_windows.go", + "internal/library/rtk_path.go", + "internal/library/rtk_path_other.go", + "internal/library/rtk_path_windows.go", + "internal/library/rtk_path_test.go", + "internal/library/rtk_test.go", + "internal/library/rtk_upgrade_test.go", + "internal/library/library_test.go", + "internal/gui/library.go", + "internal/gui/assets/library.js", + "internal/gui/tests/library-rtk-path.test.cjs", + "library_cli.go", + "LICENSE" + ], + "type": "git", + "revision_precision": "full" + } + ], + "applicability": { + "scope": "any software repository with a recoverable git history", + "prerequisites": "git history access, optionally LearningToCommit-style benchmark for evaluation" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "The RTK transition is a learning example, not an independent heldout task; upstream tests were inspected, not executed.", + "Existing audit and synthetic KV comparison adapters are not a generic historical coding-task evaluator.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "id": "repository-evolution-analysis.rtk-consumer-path-transition", + "kind": "knowledge", + "entrypoint": "rtk-consumer-path-transition.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/research/repository-evolution-analysis/references/rtk-consumer-path-transition.md", + "byte_range": [ + 0, + 13701 + ], + "sha256": "a70b1d128fb5e0ac12292a290d624f218a0831d7581fe8980b62661473e0f2b7" + } + } + }, + "content": { + "rtk-consumer-path-transition.md": { + "path": "workflows/repository-evolution-analysis/references/rtk-consumer-path-transition.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/rsi-evidence.decision-cases.json b/src/inferrsi/knowledge/atoms/rsi-evidence.decision-cases.json new file mode 100644 index 000000000..16673255e --- /dev/null +++ b/src/inferrsi/knowledge/atoms/rsi-evidence.decision-cases.json @@ -0,0 +1,85 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Decision cases", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/loopx-goal-governance/decision-cases.md", + "sha256": "c2c1d3d75c4fcb515dd36ff84d8dc940c25d54c5757a29a80d1af88eb8b66115" + }, + { + "type": "git", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9" + } + ], + "origin": [ + "first-party" + ], + "attribution": [ + { + "type": "git", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9" + } + ], + "applicability": { + "scope": "Preparing acceptance criteria, documenting or reviewing an optimization campaign whose verdict will be cited downstream", + "prerequisites": "For preparation, the user requirements and available model/hardware/workload evidence; for verdicts, pinned baseline and candidate SHAs and an evidence tree under evidence//; conclusions about LoopX goal authority additionally need its governance reference", + "input_contract": "Campaign artifacts in plan/, results/, patch/ and validator/, plus the RunSpec that fixes repo x revision x backend x device x model x scenario", + "produced_artifact": "An evidence record that links paths instead of pasting metrics, and states exactly one of PASS, FAIL or INCONCLUSIVE with its rationale", + "failure_modes": [ + "Metrics pasted into an issue comment with no link to an evidence path", + "A verdict vocabulary outside PASS/FAIL/INCONCLUSIVE", + "PASS recorded on a cleanup or integrity-probe failure", + "Output reused across trials, aliased into a reference, or written outside its own trial directory", + "Source fingerprint taken over a directory overlap that excludes changed tracked files", + "Org-wide default SHAs assumed in a skill or CI instead of read from the acceptance issue" + ], + "refusal_point": "Refuses PASS when the validator freeze, the results rationale or the pinned SHAs are missing, and reports INCONCLUSIVE for that campaign instead" + }, + "state": "candidate", + "limitations": [ + "Documents evidence discipline; it performs no measurement and certifies no campaign.", + "The LoopX goal-governance reference is a source-derived candidate and adds no execution permission or empirical validation.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store.", + "Original-byte identity authenticates file contents, not full-file semantic review; inspected_scope states the actual readset.", + "Python source preparation and TypeScript decisions/accounting remain distinct; no pure Python quota kernel is extracted.", + "Local accounting idempotency and repair do not establish external exactly-once execution or supplier hard cost ceilings.", + "This candidate does not implement InferRSI goal checkpoints or promote the inherited owner." + ], + "empirical_validation": "not_run", + "id": "rsi-evidence.decision-cases", + "kind": "knowledge", + "entrypoint": "decision-cases.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/loopx-goal-governance/decision-cases.md", + "byte_range": [ + 0, + 7035 + ], + "sha256": "c2c1d3d75c4fcb515dd36ff84d8dc940c25d54c5757a29a80d1af88eb8b66115" + } + } + }, + "content": { + "decision-cases.md": { + "path": "workflows/rsi-evidence/references/loopx-goal-governance/decision-cases.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/rsi-evidence.license-mit.json b/src/inferrsi/knowledge/atoms/rsi-evidence.license-mit.json new file mode 100644 index 000000000..5f9fce924 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/rsi-evidence.license-mit.json @@ -0,0 +1,89 @@ +{ + "authority": "checkout", + "metadata": { + "title": "LoopX historical MIT license", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/loopx-goal-governance/LICENSE-MIT.md", + "sha256": "1df1cf519b9e5d8acbbc72820299d7aa95afa1acbfc1f43a15109ad1d59975f3" + }, + { + "type": "git", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9", + "path": "LICENSE-MIT", + "sha256": "1df1cf519b9e5d8acbbc72820299d7aa95afa1acbfc1f43a15109ad1d59975f3" + } + ], + "origin": [ + "external" + ], + "attribution": [ + { + "type": "git", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9", + "path": "LICENSE-MIT", + "sha256": "1df1cf519b9e5d8acbbc72820299d7aa95afa1acbfc1f43a15109ad1d59975f3" + } + ], + "applicability": { + "scope": "Preparing acceptance criteria, documenting or reviewing an optimization campaign whose verdict will be cited downstream", + "prerequisites": "For preparation, the user requirements and available model/hardware/workload evidence; for verdicts, pinned baseline and candidate SHAs and an evidence tree under evidence//; conclusions about LoopX goal authority additionally need its governance reference", + "input_contract": "Campaign artifacts in plan/, results/, patch/ and validator/, plus the RunSpec that fixes repo x revision x backend x device x model x scenario", + "produced_artifact": "An evidence record that links paths instead of pasting metrics, and states exactly one of PASS, FAIL or INCONCLUSIVE with its rationale", + "failure_modes": [ + "Metrics pasted into an issue comment with no link to an evidence path", + "A verdict vocabulary outside PASS/FAIL/INCONCLUSIVE", + "PASS recorded on a cleanup or integrity-probe failure", + "Output reused across trials, aliased into a reference, or written outside its own trial directory", + "Source fingerprint taken over a directory overlap that excludes changed tracked files", + "Org-wide default SHAs assumed in a skill or CI instead of read from the acceptance issue" + ], + "refusal_point": "Refuses PASS when the validator freeze, the results rationale or the pinned SHAs are missing, and reports INCONCLUSIVE for that campaign instead" + }, + "state": "candidate", + "limitations": [ + "Documents evidence discipline; it performs no measurement and certifies no campaign.", + "The LoopX goal-governance reference is a source-derived candidate and adds no execution permission or empirical validation.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store.", + "Original-byte identity authenticates file contents, not full-file semantic review; inspected_scope states the actual readset.", + "Python source preparation and TypeScript decisions/accounting remain distinct; no pure Python quota kernel is extracted.", + "Local accounting idempotency and repair do not establish external exactly-once execution or supplier hard cost ceilings.", + "This candidate does not implement InferRSI goal checkpoints or promote the inherited owner." + ], + "empirical_validation": "not_run", + "id": "rsi-evidence.license-mit", + "kind": "knowledge", + "entrypoint": "LICENSE-MIT.md", + "atom": { + "when": {}, + "license": "MIT", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/loopx-goal-governance/LICENSE-MIT.md", + "byte_range": [ + 0, + 1075 + ], + "sha256": "1df1cf519b9e5d8acbbc72820299d7aa95afa1acbfc1f43a15109ad1d59975f3" + } + } + }, + "content": { + "LICENSE-MIT.md": { + "path": "workflows/rsi-evidence/references/loopx-goal-governance/LICENSE-MIT.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/rsi-evidence.license.json b/src/inferrsi/knowledge/atoms/rsi-evidence.license.json new file mode 100644 index 000000000..76a7f7354 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/rsi-evidence.license.json @@ -0,0 +1,89 @@ +{ + "authority": "checkout", + "metadata": { + "title": "LoopX Apache License 2.0", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/loopx-goal-governance/LICENSE", + "sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30" + }, + { + "type": "git", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9", + "path": "LICENSE", + "sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30" + } + ], + "origin": [ + "external" + ], + "attribution": [ + { + "type": "git", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9", + "path": "LICENSE", + "sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30" + } + ], + "applicability": { + "scope": "Preparing acceptance criteria, documenting or reviewing an optimization campaign whose verdict will be cited downstream", + "prerequisites": "For preparation, the user requirements and available model/hardware/workload evidence; for verdicts, pinned baseline and candidate SHAs and an evidence tree under evidence//; conclusions about LoopX goal authority additionally need its governance reference", + "input_contract": "Campaign artifacts in plan/, results/, patch/ and validator/, plus the RunSpec that fixes repo x revision x backend x device x model x scenario", + "produced_artifact": "An evidence record that links paths instead of pasting metrics, and states exactly one of PASS, FAIL or INCONCLUSIVE with its rationale", + "failure_modes": [ + "Metrics pasted into an issue comment with no link to an evidence path", + "A verdict vocabulary outside PASS/FAIL/INCONCLUSIVE", + "PASS recorded on a cleanup or integrity-probe failure", + "Output reused across trials, aliased into a reference, or written outside its own trial directory", + "Source fingerprint taken over a directory overlap that excludes changed tracked files", + "Org-wide default SHAs assumed in a skill or CI instead of read from the acceptance issue" + ], + "refusal_point": "Refuses PASS when the validator freeze, the results rationale or the pinned SHAs are missing, and reports INCONCLUSIVE for that campaign instead" + }, + "state": "candidate", + "limitations": [ + "Documents evidence discipline; it performs no measurement and certifies no campaign.", + "The LoopX goal-governance reference is a source-derived candidate and adds no execution permission or empirical validation.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store.", + "Original-byte identity authenticates file contents, not full-file semantic review; inspected_scope states the actual readset.", + "Python source preparation and TypeScript decisions/accounting remain distinct; no pure Python quota kernel is extracted.", + "Local accounting idempotency and repair do not establish external exactly-once execution or supplier hard cost ceilings.", + "This candidate does not implement InferRSI goal checkpoints or promote the inherited owner." + ], + "empirical_validation": "not_run", + "id": "rsi-evidence.license", + "kind": "knowledge", + "entrypoint": "LICENSE", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/loopx-goal-governance/LICENSE", + "byte_range": [ + 0, + 11358 + ], + "sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30" + } + } + }, + "content": { + "LICENSE": { + "path": "workflows/rsi-evidence/references/loopx-goal-governance/LICENSE" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/rsi-evidence.mechanisms.json b/src/inferrsi/knowledge/atoms/rsi-evidence.mechanisms.json new file mode 100644 index 000000000..ae3090b92 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/rsi-evidence.mechanisms.json @@ -0,0 +1,85 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Mechanisms and operating boundaries", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/loopx-goal-governance/mechanisms.md", + "sha256": "4fa09099d362a8088fdb0e6a767f72aae6218b92fe5fd75b6fb78c2bb2a318fb" + }, + { + "type": "git", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9" + } + ], + "origin": [ + "first-party" + ], + "attribution": [ + { + "type": "git", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9" + } + ], + "applicability": { + "scope": "Preparing acceptance criteria, documenting or reviewing an optimization campaign whose verdict will be cited downstream", + "prerequisites": "For preparation, the user requirements and available model/hardware/workload evidence; for verdicts, pinned baseline and candidate SHAs and an evidence tree under evidence//; conclusions about LoopX goal authority additionally need its governance reference", + "input_contract": "Campaign artifacts in plan/, results/, patch/ and validator/, plus the RunSpec that fixes repo x revision x backend x device x model x scenario", + "produced_artifact": "An evidence record that links paths instead of pasting metrics, and states exactly one of PASS, FAIL or INCONCLUSIVE with its rationale", + "failure_modes": [ + "Metrics pasted into an issue comment with no link to an evidence path", + "A verdict vocabulary outside PASS/FAIL/INCONCLUSIVE", + "PASS recorded on a cleanup or integrity-probe failure", + "Output reused across trials, aliased into a reference, or written outside its own trial directory", + "Source fingerprint taken over a directory overlap that excludes changed tracked files", + "Org-wide default SHAs assumed in a skill or CI instead of read from the acceptance issue" + ], + "refusal_point": "Refuses PASS when the validator freeze, the results rationale or the pinned SHAs are missing, and reports INCONCLUSIVE for that campaign instead" + }, + "state": "candidate", + "limitations": [ + "Documents evidence discipline; it performs no measurement and certifies no campaign.", + "The LoopX goal-governance reference is a source-derived candidate and adds no execution permission or empirical validation.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store.", + "Original-byte identity authenticates file contents, not full-file semantic review; inspected_scope states the actual readset.", + "Python source preparation and TypeScript decisions/accounting remain distinct; no pure Python quota kernel is extracted.", + "Local accounting idempotency and repair do not establish external exactly-once execution or supplier hard cost ceilings.", + "This candidate does not implement InferRSI goal checkpoints or promote the inherited owner." + ], + "empirical_validation": "not_run", + "id": "rsi-evidence.mechanisms", + "kind": "knowledge", + "entrypoint": "mechanisms.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/loopx-goal-governance/mechanisms.md", + "byte_range": [ + 0, + 16696 + ], + "sha256": "4fa09099d362a8088fdb0e6a767f72aae6218b92fe5fd75b6fb78c2bb2a318fb" + } + } + }, + "content": { + "mechanisms.md": { + "path": "workflows/rsi-evidence/references/loopx-goal-governance/mechanisms.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/rsi-evidence.notice.json b/src/inferrsi/knowledge/atoms/rsi-evidence.notice.json new file mode 100644 index 000000000..04a430b85 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/rsi-evidence.notice.json @@ -0,0 +1,89 @@ +{ + "authority": "checkout", + "metadata": { + "title": "LoopX copyright and contributor notice", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/loopx-goal-governance/NOTICE.md", + "sha256": "3c3c36a40e1d65f3a6b20ec3a97319cb753e857f1d120f302cd828e107120f6d" + }, + { + "type": "git", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9", + "path": "NOTICE", + "sha256": "3c3c36a40e1d65f3a6b20ec3a97319cb753e857f1d120f302cd828e107120f6d" + } + ], + "origin": [ + "external" + ], + "attribution": [ + { + "type": "git", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9", + "path": "NOTICE", + "sha256": "3c3c36a40e1d65f3a6b20ec3a97319cb753e857f1d120f302cd828e107120f6d" + } + ], + "applicability": { + "scope": "Preparing acceptance criteria, documenting or reviewing an optimization campaign whose verdict will be cited downstream", + "prerequisites": "For preparation, the user requirements and available model/hardware/workload evidence; for verdicts, pinned baseline and candidate SHAs and an evidence tree under evidence//; conclusions about LoopX goal authority additionally need its governance reference", + "input_contract": "Campaign artifacts in plan/, results/, patch/ and validator/, plus the RunSpec that fixes repo x revision x backend x device x model x scenario", + "produced_artifact": "An evidence record that links paths instead of pasting metrics, and states exactly one of PASS, FAIL or INCONCLUSIVE with its rationale", + "failure_modes": [ + "Metrics pasted into an issue comment with no link to an evidence path", + "A verdict vocabulary outside PASS/FAIL/INCONCLUSIVE", + "PASS recorded on a cleanup or integrity-probe failure", + "Output reused across trials, aliased into a reference, or written outside its own trial directory", + "Source fingerprint taken over a directory overlap that excludes changed tracked files", + "Org-wide default SHAs assumed in a skill or CI instead of read from the acceptance issue" + ], + "refusal_point": "Refuses PASS when the validator freeze, the results rationale or the pinned SHAs are missing, and reports INCONCLUSIVE for that campaign instead" + }, + "state": "candidate", + "limitations": [ + "Documents evidence discipline; it performs no measurement and certifies no campaign.", + "The LoopX goal-governance reference is a source-derived candidate and adds no execution permission or empirical validation.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store.", + "Original-byte identity authenticates file contents, not full-file semantic review; inspected_scope states the actual readset.", + "Python source preparation and TypeScript decisions/accounting remain distinct; no pure Python quota kernel is extracted.", + "Local accounting idempotency and repair do not establish external exactly-once execution or supplier hard cost ceilings.", + "This candidate does not implement InferRSI goal checkpoints or promote the inherited owner." + ], + "empirical_validation": "not_run", + "id": "rsi-evidence.notice", + "kind": "knowledge", + "entrypoint": "NOTICE.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/loopx-goal-governance/NOTICE.md", + "byte_range": [ + 0, + 308 + ], + "sha256": "3c3c36a40e1d65f3a6b20ec3a97319cb753e857f1d120f302cd828e107120f6d" + } + } + }, + "content": { + "NOTICE.md": { + "path": "workflows/rsi-evidence/references/loopx-goal-governance/NOTICE.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/rsi-evidence.omni-experiments.json b/src/inferrsi/knowledge/atoms/rsi-evidence.omni-experiments.json new file mode 100644 index 000000000..1d704bced --- /dev/null +++ b/src/inferrsi/knowledge/atoms/rsi-evidence.omni-experiments.json @@ -0,0 +1,70 @@ +{ + "authority": "checkout", + "metadata": { + "title": "Qualifying Omni optimization experiments", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/omni-experiments.md", + "sha256": "8fafc1e05ef21ab60158fc626c73ca1b8c615ada59f90fd23199496daa46ac48" + } + ], + "origin": [ + "first-party" + ], + "attribution": [], + "applicability": { + "scope": "Preparing acceptance criteria, documenting or reviewing an optimization campaign whose verdict will be cited downstream", + "prerequisites": "For preparation, the user requirements and available model/hardware/workload evidence; for verdicts, pinned baseline and candidate SHAs and an evidence tree under evidence//; conclusions about LoopX goal authority additionally need its governance reference", + "input_contract": "Campaign artifacts in plan/, results/, patch/ and validator/, plus the RunSpec that fixes repo x revision x backend x device x model x scenario", + "produced_artifact": "An evidence record that links paths instead of pasting metrics, and states exactly one of PASS, FAIL or INCONCLUSIVE with its rationale", + "failure_modes": [ + "Metrics pasted into an issue comment with no link to an evidence path", + "A verdict vocabulary outside PASS/FAIL/INCONCLUSIVE", + "PASS recorded on a cleanup or integrity-probe failure", + "Output reused across trials, aliased into a reference, or written outside its own trial directory", + "Source fingerprint taken over a directory overlap that excludes changed tracked files", + "Org-wide default SHAs assumed in a skill or CI instead of read from the acceptance issue" + ], + "refusal_point": "Refuses PASS when the validator freeze, the results rationale or the pinned SHAs are missing, and reports INCONCLUSIVE for that campaign instead" + }, + "state": "candidate", + "limitations": [ + "Documents evidence discipline; it performs no measurement and certifies no campaign.", + "The LoopX goal-governance reference is a source-derived candidate and adds no execution permission or empirical validation.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "id": "rsi-evidence.omni-experiments", + "kind": "knowledge", + "entrypoint": "omni-experiments.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/omni-experiments.md", + "byte_range": [ + 0, + 5380 + ], + "sha256": "8fafc1e05ef21ab60158fc626c73ca1b8c615ada59f90fd23199496daa46ac48" + } + } + }, + "content": { + "omni-experiments.md": { + "path": "workflows/rsi-evidence/references/omni-experiments.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/rsi-evidence.original.json b/src/inferrsi/knowledge/atoms/rsi-evidence.original.json new file mode 100644 index 000000000..3926472db --- /dev/null +++ b/src/inferrsi/knowledge/atoms/rsi-evidence.original.json @@ -0,0 +1,103 @@ +{ + "authority": "checkout", + "metadata": { + "id": "rsi-evidence.original", + "kind": "knowledge", + "entrypoint": "guide.md", + "title": "Guide agents to establish acceptance criteria, freeze and cite RSI evidence using plan/results/patch/validator paths and PASS/FAIL/INCONCLUSIVE verdicts.", + "origin": [ + "first-party" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/SKILL.md", + "sha256": "5edd2bd544da050d2688f37c85ae6e7927eaee24af764e3c96b6cec04982990a" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Preparing acceptance criteria, documenting or reviewing an optimization campaign whose verdict will be cited downstream", + "prerequisites": "For preparation, the user requirements and available model/hardware/workload evidence; for verdicts, pinned baseline and candidate SHAs and an evidence tree under evidence//; conclusions about LoopX goal authority additionally need its governance reference", + "input_contract": "Campaign artifacts in plan/, results/, patch/ and validator/, plus the RunSpec that fixes repo x revision x backend x device x model x scenario", + "produced_artifact": "An evidence record that links paths instead of pasting metrics, and states exactly one of PASS, FAIL or INCONCLUSIVE with its rationale", + "failure_modes": [ + "Metrics pasted into an issue comment with no link to an evidence path", + "A verdict vocabulary outside PASS/FAIL/INCONCLUSIVE", + "PASS recorded on a cleanup or integrity-probe failure", + "Output reused across trials, aliased into a reference, or written outside its own trial directory", + "Source fingerprint taken over a directory overlap that excludes changed tracked files", + "Org-wide default SHAs assumed in a skill or CI instead of read from the acceptance issue" + ], + "refusal_point": "Refuses PASS when the validator freeze, the results rationale or the pinned SHAs are missing, and reports INCONCLUSIVE for that campaign instead" + }, + "state": "candidate", + "limitations": [ + "Documents evidence discipline; it performs no measurement and certifies no campaign.", + "The LoopX goal-governance reference is a source-derived candidate and adds no execution permission or empirical validation.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/SKILL.md", + "byte_range": [ + 0, + 8927 + ], + "sha256": "5edd2bd544da050d2688f37c85ae6e7927eaee24af764e3c96b6cec04982990a" + } + } + }, + "content": { + "guide.md": { + "path": "workflows/rsi-evidence.md" + } + }, + "parts": { + "navigation": { + "skill_section": "navigation", + "layer": "L0", + "byte_range": [ + 0, + 190 + ], + "sha256": "1ddee4264095fa092d0b18c31699b9ffa746a9fab278e48e29cfc960e68969bb" + }, + "decision": { + "skill_section": "decision", + "layer": "L1", + "byte_range": [ + 0, + 3393 + ], + "sha256": "d4e538e3a4081737a2110aa9c9e4b9aae5ef6cd0af9073433a2e22f16007c69e" + }, + "procedure": { + "skill_section": "procedure", + "layer": "L2", + "byte_range": [ + 3393, + 8927 + ], + "sha256": "f4e849f901ce9eff3f0f6fab396095da45e2859124626c8dc478c1b696b5398b" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/rsi-evidence.readme.json b/src/inferrsi/knowledge/atoms/rsi-evidence.readme.json new file mode 100644 index 000000000..b80996d4a --- /dev/null +++ b/src/inferrsi/knowledge/atoms/rsi-evidence.readme.json @@ -0,0 +1,85 @@ +{ + "authority": "checkout", + "metadata": { + "title": "LoopX Goal authority and quota boundaries", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/loopx-goal-governance/README.md", + "sha256": "c86eb179cea1b42f346f5c1dc076292ba086be907f20b0beee45c43cf0f8d6fe" + }, + { + "type": "git", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9" + } + ], + "origin": [ + "first-party" + ], + "attribution": [ + { + "type": "git", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9" + } + ], + "applicability": { + "scope": "Preparing acceptance criteria, documenting or reviewing an optimization campaign whose verdict will be cited downstream", + "prerequisites": "For preparation, the user requirements and available model/hardware/workload evidence; for verdicts, pinned baseline and candidate SHAs and an evidence tree under evidence//; conclusions about LoopX goal authority additionally need its governance reference", + "input_contract": "Campaign artifacts in plan/, results/, patch/ and validator/, plus the RunSpec that fixes repo x revision x backend x device x model x scenario", + "produced_artifact": "An evidence record that links paths instead of pasting metrics, and states exactly one of PASS, FAIL or INCONCLUSIVE with its rationale", + "failure_modes": [ + "Metrics pasted into an issue comment with no link to an evidence path", + "A verdict vocabulary outside PASS/FAIL/INCONCLUSIVE", + "PASS recorded on a cleanup or integrity-probe failure", + "Output reused across trials, aliased into a reference, or written outside its own trial directory", + "Source fingerprint taken over a directory overlap that excludes changed tracked files", + "Org-wide default SHAs assumed in a skill or CI instead of read from the acceptance issue" + ], + "refusal_point": "Refuses PASS when the validator freeze, the results rationale or the pinned SHAs are missing, and reports INCONCLUSIVE for that campaign instead" + }, + "state": "candidate", + "limitations": [ + "Documents evidence discipline; it performs no measurement and certifies no campaign.", + "The LoopX goal-governance reference is a source-derived candidate and adds no execution permission or empirical validation.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store.", + "Original-byte identity authenticates file contents, not full-file semantic review; inspected_scope states the actual readset.", + "Python source preparation and TypeScript decisions/accounting remain distinct; no pure Python quota kernel is extracted.", + "Local accounting idempotency and repair do not establish external exactly-once execution or supplier hard cost ceilings.", + "This candidate does not implement InferRSI goal checkpoints or promote the inherited owner." + ], + "empirical_validation": "not_run", + "id": "rsi-evidence.readme", + "kind": "knowledge", + "entrypoint": "README.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/loopx-goal-governance/README.md", + "byte_range": [ + 0, + 4701 + ], + "sha256": "c86eb179cea1b42f346f5c1dc076292ba086be907f20b0beee45c43cf0f8d6fe" + } + } + }, + "content": { + "README.md": { + "path": "workflows/rsi-evidence/references/loopx-goal-governance/README.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/rsi-evidence.source-ledger.json b/src/inferrsi/knowledge/atoms/rsi-evidence.source-ledger.json new file mode 100644 index 000000000..4b030afc7 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/rsi-evidence.source-ledger.json @@ -0,0 +1,85 @@ +{ + "authority": "checkout", + "metadata": { + "title": "LoopX source ledger", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/loopx-goal-governance/source-ledger.json", + "sha256": "4a0f1f02134af5b7d54a1f13e104b8066372d3d4a1a4a9e717514632fff05893" + }, + { + "type": "git", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9" + } + ], + "origin": [ + "first-party" + ], + "attribution": [ + { + "type": "git", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9" + } + ], + "applicability": { + "scope": "Preparing acceptance criteria, documenting or reviewing an optimization campaign whose verdict will be cited downstream", + "prerequisites": "For preparation, the user requirements and available model/hardware/workload evidence; for verdicts, pinned baseline and candidate SHAs and an evidence tree under evidence//; conclusions about LoopX goal authority additionally need its governance reference", + "input_contract": "Campaign artifacts in plan/, results/, patch/ and validator/, plus the RunSpec that fixes repo x revision x backend x device x model x scenario", + "produced_artifact": "An evidence record that links paths instead of pasting metrics, and states exactly one of PASS, FAIL or INCONCLUSIVE with its rationale", + "failure_modes": [ + "Metrics pasted into an issue comment with no link to an evidence path", + "A verdict vocabulary outside PASS/FAIL/INCONCLUSIVE", + "PASS recorded on a cleanup or integrity-probe failure", + "Output reused across trials, aliased into a reference, or written outside its own trial directory", + "Source fingerprint taken over a directory overlap that excludes changed tracked files", + "Org-wide default SHAs assumed in a skill or CI instead of read from the acceptance issue" + ], + "refusal_point": "Refuses PASS when the validator freeze, the results rationale or the pinned SHAs are missing, and reports INCONCLUSIVE for that campaign instead" + }, + "state": "candidate", + "limitations": [ + "Documents evidence discipline; it performs no measurement and certifies no campaign.", + "The LoopX goal-governance reference is a source-derived candidate and adds no execution permission or empirical validation.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store.", + "Original-byte identity authenticates file contents, not full-file semantic review; inspected_scope states the actual readset.", + "Python source preparation and TypeScript decisions/accounting remain distinct; no pure Python quota kernel is extracted.", + "Local accounting idempotency and repair do not establish external exactly-once execution or supplier hard cost ceilings.", + "This candidate does not implement InferRSI goal checkpoints or promote the inherited owner." + ], + "empirical_validation": "not_run", + "id": "rsi-evidence.source-ledger", + "kind": "knowledge", + "entrypoint": "source-ledger.json", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/references/loopx-goal-governance/source-ledger.json", + "byte_range": [ + 0, + 20966 + ], + "sha256": "4a0f1f02134af5b7d54a1f13e104b8066372d3d4a1a4a9e717514632fff05893" + } + } + }, + "content": { + "source-ledger.json": { + "path": "workflows/rsi-evidence/references/loopx-goal-governance/source-ledger.json" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/skill-evolution-playbook.original.json b/src/inferrsi/knowledge/atoms/skill-evolution-playbook.original.json new file mode 100644 index 000000000..70e1a88fb --- /dev/null +++ b/src/inferrsi/knowledge/atoms/skill-evolution-playbook.original.json @@ -0,0 +1,104 @@ +{ + "authority": "checkout", + "metadata": { + "id": "skill-evolution-playbook.original", + "kind": "knowledge", + "entrypoint": "guide.md", + "title": "Practical design choices for evolving agent skills from execution traces: when one trajectory should update a skill, how conflicting lessons are handled, how negative evidence is preserved, how large an edit should be, and when skills should split or merge. Drawn from Trace2Skill and SkillOpt. Use when designing or operating a skill evolution pipeline.\n", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/skill-evolution-playbook/SKILL.md", + "sha256": "f988a0569be93fec550da52484d22d970b0a6c31394ea463ad6ee40e0877ede6" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Design choices for evolving agent skills from execution traces, drawn from Trace2Skill and SkillOpt: when a trajectory should update a skill, how conflicting lessons are handled, how negative evidence is preserved, how large an edit should be and when skills split or merge; for designing or operating a skill evolution pipeline", + "prerequisites": "A final-test partition kept outside edit selection and the incumbent skill retained for rollback; changing a skill's scope first needs explicit review of its identity and consumers", + "input_contract": "Execution trajectories or trace IDs with the diagnosed causal failure and the successful behavior an amendment must preserve; the incumbent skill and its revision lineage; held-out evaluation results for candidate edits", + "produced_artifact": "A scoped case or amendment proposal, or a consolidated candidate edit, with rejection records and the versioned revision lineage; a candidate for independently evaluated acceptance, not a replacement decision or an efficacy claim", + "failure_modes": [ + "An anecdote, or agreement among analysts, is taken as efficacy", + "Consolidation output is treated as a replacement decision instead of a candidate awaiting independent acceptance", + "A tie or uncertain result is reported as improvement", + "A conflict is resolved by voting for whichever outcome appeared more often in the pool", + "A rejection is applied to every future use of an idea instead of the comparison it constrains", + "Paper-specific section counts or length budgets are used as universal defaults, or a skill is split on length alone", + "A stronger task solver is assumed to be a stronger improver, or replay rankings and private inner scores are read as outer generalization" + ], + "refusal_point": "Records a conflict that conditioning cannot resolve, where the same context produces different outcomes across runs, as INCONCLUSIVE and flags it for human review instead of choosing a lesson; claims no universal minimum trace count, paper-to-code equivalence or local efficacy" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Original typed source inventory is not normalized; retain source identities and limits in the procedure/readsets.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/skill-evolution-playbook/SKILL.md", + "byte_range": [ + 0, + 13082 + ], + "sha256": "f988a0569be93fec550da52484d22d970b0a6c31394ea463ad6ee40e0877ede6" + } + } + }, + "content": { + "guide.md": { + "path": "workflows/skill-evolution-playbook.md" + } + }, + "parts": { + "navigation": { + "skill_section": "navigation", + "layer": "L0", + "byte_range": [ + 0, + 409 + ], + "sha256": "2cdfb63f21cf1ea6060e06f9f09da75f5f4dea7ee06cf71a7f01f29751f1b658" + }, + "decision": { + "skill_section": "decision", + "layer": "L1", + "byte_range": [ + 0, + 4074 + ], + "sha256": "646c40f2c81f52b664edf678b60bbc340223daa5127540db15ee0dae6a60af06" + }, + "procedure": { + "skill_section": "procedure", + "layer": "L2", + "byte_range": [ + 4074, + 13082 + ], + "sha256": "9c508cb8a510cf055dc298d575f8a06be11fc1eac131e73f8d0a26b1ee46d2ce" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/workflows/draft-acceptance-issue.md b/src/inferrsi/knowledge/atoms/workflows/draft-acceptance-issue.md new file mode 100644 index 000000000..874096066 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/draft-acceptance-issue.md @@ -0,0 +1,74 @@ +--- +name: draft-acceptance-issue +description: Draft a campaign acceptance issue with checklist, RunSpec, evidence paths, and placeholders for baseline/candidate SHAs. +metadata: + inferrsi: | + { + "schema_version": 1, + "profile": "local-skill-v1", + "kind": "skill", + "status": "candidate", + "origin": [ + "first-party" + ], + "consumption_mode": "packaged", + "tags": [ + "acceptance", + "issue", + "runspec", + "template", + "campaign" + ], + "empirical_validation": "not_run", + "applicability": { + "scope": "Opening a new acceptance campaign in an RSI-style repository, before any baseline or candidate run", + "prerequisites": "A chosen campaign subject and an empty evidence// tree copied from evidence/_template/; SHAs may still be placeholders", + "input_contract": "A campaign id of the form {model-or-scenario}/{device}x{count}, any user-supplied criteria or accepted plan, and available workload/baseline/calibration evidence for deriving missing targets", + "produced_artifact": "An acceptance issue body with campaign id, pinned baseline and candidate SHAs, RunSpec, criteria source and derivation including gaps and freeze authority, gates, evidence paths, initial verdict and a downstream citation blurb", + "failure_modes": [ + "Gates written after the search loop has already run", + "Campaign SHAs committed into recipes/, benchmarks/, skills or workflow defaults", + "PASS claimed without a validator/ freeze and a results/ rationale" + ], + "refusal_point": "Refuses to state a verdict other than INCONCLUSIVE while the validator freeze or results rationale is absent" + }, + "recommendations": [ + "Use user-supplied criteria; when absent, follow the performance-ceiling-analysis acceptance procedure to formulate targets, preserving partial requirements and identifying derived fields and evidence gaps.", + "Write the gates in plan/ before any search loop; a gate chosen afterwards cannot reject the candidate honestly.", + "Use the and placeholders until the campaign fixes them, and keep the real values in the issue.", + "Set the initial verdict to INCONCLUSIVE so the absence of evidence is recorded rather than assumed away." + ], + "limitations": [ + "Drafts an issue only; it freezes no gate and runs no measurement.", + "The placeholder SHA convention depends on the campaign owner filling them in later." + ], + "provenance_readsets": [], + "searchspace_not_applicable": "SKILL.md §§ Steps and Output prepare an acceptance issue, RunSpec, frozen gates and evidence paths; device identifiers are campaign metadata rather than a hardware-resource mechanism." + } +--- + +# Draft acceptance issue + +Use when starting a new campaign in a ThinkFlowLab RSI-style repo. + +## Steps + +1. Pick `campaign_id` (naming: `{model-or-scenario} / {device}×{count}`). +2. Copy `evidence/_template/` → `evidence//` (empty tree with README stubs). +3. Open issue using `.github/ISSUE_TEMPLATE/campaign-acceptance.yml` or [docs/contributing.md#acceptance-checklist](https://github.com/InferMatrixLab/InferRSI/blob/b2f60f913a949f9073686a23476f752e11d709a4/docs/contributing.md#acceptance-checklist). +4. Fill **pinned baseline SHA** and **pinned candidate SHA** in the issue—use placeholders `` / `` until known. +5. Resolve criteria using the [acceptance-criteria procedure](../../../playbooks/measurement/performance-ceiling-analysis/references/acceptance-criteria.md): + use user-supplied criteria; otherwise use `performance-ceiling-analysis` to + formulate targets. Preserve partial requirements, label derived fields and + retain unresolved evidence gaps. List supported gates and their provenance in + `plan/` before candidate search. +6. Set initial verdict `INCONCLUSIVE`. + +## Do not + +- Commit campaign SHAs into `recipes/`, `benchmarks/`, skills, or workflow defaults. +- Claim `PASS` without `validator/` freeze and `results/` rationale. + +## Output + +Issue body sections: campaign id, SHAs, RunSpec, criteria source and derivation (including evidence gaps and freeze authority), gates, evidence paths, verdict, downstream citation blurb. diff --git a/src/inferrsi/knowledge/atoms/workflows/repository-evolution-analysis.md b/src/inferrsi/knowledge/atoms/workflows/repository-evolution-analysis.md new file mode 100644 index 000000000..1ee25d8ae --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/repository-evolution-analysis.md @@ -0,0 +1,443 @@ +--- +name: repository-evolution-analysis +description: 'Analyze a repository''s commit history to build a capability-evolution model: what the system can do, how it got there, and what patterns allow it to iterate quickly. Use to produce history-derived knowledge for agent skill conditioning, and to design temporal-split benchmarks for skill evaluation. + + ' +metadata: + inferrsi: | + { + "schema_version": 1, + "status": "candidate", + "sources": [ + { + "url": "https://github.com/LearningToCommit/LearningToCommit", + "commit": "7e5a1d77", + "paths": [ + "data_construction/s1_scan_commits.py", + "data_construction/s3_tag.py", + "data_construction/s4_sample.py", + "data_construction/s5_build.py", + "modules/agent.py", + "modules/prompt_builder.py", + "modules/trajectory_to_md.py", + "system_prompts/solve_with_skill.txt", + "system_prompts/learn_reflect.txt", + "evaluation/pairwise_judge.py", + "evaluation/programmatic_metrics.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "77800032", + "paths": [ + "internal/", + "docs/" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "4b5d6d725fae3d8a263f6e43c707400e3765b84f", + "paths": [ + "internal/library/rtk.go", + "internal/library/rtk_upgrade.go", + "internal/proc/path_other.go", + "internal/proc/path_windows.go", + "internal/provider/install_windows.go" + ], + "type": "git", + "revision_precision": "full" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "9848a9062a65c49e074c09770dc7de73dd012bea", + "paths": [ + "internal/library/rtk.go", + "internal/library/rtk_upgrade.go", + "internal/proc/path_other.go", + "internal/proc/path_windows.go", + "internal/provider/install_windows.go", + "internal/library/rtk_path.go", + "internal/library/rtk_path_other.go", + "internal/library/rtk_path_windows.go", + "internal/library/rtk_path_test.go", + "internal/library/rtk_test.go", + "internal/library/rtk_upgrade_test.go", + "internal/library/library_test.go", + "internal/gui/library.go", + "internal/gui/assets/library.js", + "internal/gui/tests/library-rtk-path.test.cjs", + "library_cli.go", + "LICENSE" + ], + "type": "git", + "revision_precision": "full" + } + ], + "verification": { + "locally_verified": false, + "evidence_level": "source_grounded", + "note": "Carried LearningToCommit pipeline and Magpie history analysis, not causal evidence of development speed. The reviewed paper amendment is linked from SKILL.md; paper-to-code equivalence is not established. First-hand Magpie coordination research remains pending Dot delivery and owner review. The RTK worked transition is pinned static source/test inspection only; no upstream execution or heldout efficacy evaluation." + }, + "applicability": { + "scope": "any software repository with a recoverable git history", + "prerequisites": "git history access, optionally LearningToCommit-style benchmark for evaluation" + }, + "tags": [ + "repository-intelligence", + "history", + "skill-distillation", + "evaluation" + ], + "profile": "local-skill-v1", + "kind": "skill", + "origin": [ + "external" + ], + "empirical_validation": "not_run", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "The RTK transition is a learning example, not an independent heldout task; upstream tests were inspected, not executed.", + "Existing audit and synthetic KV comparison adapters are not a generic historical coding-task evaluator." + ], + "provenance_readsets": [], + "consumption_mode": "packaged", + "references": [ + "references/rtk-consumer-path-transition.md" + ] + } +--- + +# Repository Evolution Analysis + +Status: candidate. Procedures have not been evaluated against a real campaign. + +## When to use this skill + +Use this skill when you need to answer one of these questions before acting +on a repository: + +- What capabilities has this repository accumulated, and in what order? +- Why can this team iterate quickly, and what patterns should I preserve? +- What historical tasks can I construct for skill evaluation with a proper + temporal cutoff? +- Does this repository have a recurring convention for adding a new provider, + adapter, or capability class that I should follow? + +Do not use this skill to justify a specific code change — that requires +evidence from the current source. This skill produces history-derived +knowledge that conditions how you approach future changes. + +## Evidence to inspect first + +Before analysing history, determine what you have: + +1. Does `git log` work? (Full history vs. shallow clone — report the clone depth.) +2. What are the top-level directories and their activity counts? + `git log --numstat --format='%H' | grep -v '^$' | awk '{print $3}' | cut -d/ -f1 | sort | uniq -c | sort -rn | head -10` +3. What is the commit rate over time? A prepared JSONL extract is faster than + re-scanning — if one exists, use it. +4. Are there already extracted commit clusters, coupling indexes, or important- + commit shortlists? If so, read those first and validate by sampling diffs + rather than running a full re-scan. + +## Building the evolution model + +The model has three parts. Build them in order. + +### State model + +Identify what state the repository carries across commits: registered modules, +provider/adapter lists, config surfaces, routing tables. These are the nouns +that change. + +Method: look for `register`, `PROVIDERS`, `ADAPTERS`, `BACKENDS`, `ROUTES`, +`plugins`, `catalog` patterns in the most-active files. Count commits per +top-level directory as a proxy for where state lives. + +From the Magpie analysis (source-grounded, commit history 2026-09-22 to +2026-10-14, 3428 commits): +- State lives almost entirely in `internal/` (3280 commits = 95.7% of activity). +- Key state surfaces: provider registry, subscription manager, routing groups, + session index, library (MCP/skills/instructions), gateway config, usage ledger. +- `docs/` (152) and `site/` (83) are secondary; `.github/` (26) is CI-only. +Source: `magpie-change-coupling.json`, `magpie-commits.jsonl`. + +### Capability model + +Name the recurring capability families. A family is a cluster of commits that +add, repair, and extend one coherent user-facing capability. + +Method: start from existing clusters if available; validate each by sampling +2-3 diffs per cluster. For an unanalysed repository, use `git log --follow +--numstat -- ` on the most-active files, then group files by co-commit +frequency. + +From the Magpie analysis (source-grounded): + +| Family | Subsystem | Commits (approx) | Description | +|--------|-----------|-------------------|-------------| +| Provider onboarding | internal | ~300 | Adding a new AI provider/subscription | +| Subscription/auth | internal | ~200 | Sign-in flows, session tokens, metering | +| Routing & affinity | internal | ~150 | Routing groups, per-client affinity | +| GUI settings | internal | ~200 | Settings pages, UI state | +| Library/MCP | internal | ~180 | Skills, MCP servers, instructions sharing | +| Session search | internal | ~120 | Session index, search, folders | +| Usage/metering | internal | ~160 | Balance, usage charts, gateway keys | +| i18n | internal | ~120 | German, Japanese, Traditional Chinese | + +Source: `magpie-clusters.json`, validated by diff sampling on 8 SHAs from +`magpie-important-commits.md`. + +### Transition model + +For each family, reconstruct the actual commit sequence. The task description +proposes: initial feature → repair → edge-case → abstraction → compatibility +→ validation → cleanup. Do **not** assume this order. Infer it from real SHAs. + +From the Magpie analysis, the observed sequence for **provider onboarding**: + +1. `702477525a` (2026-09-24): Claude subscription as a provider; model lists + fetched, never compiled in. [initial feature] +2. `9bf6d43527` (2026-10-01): magpie no longer asks Anthropic for usage; adding + an account improved. [repair + edge-case] +3. `09c635cf03` (2026-09-25): model tells Pi/Crush/Codex how much it holds. + [capability extension, concurrent with step 2] +4. `4f22d103d3` (2026-09-27): Kiro served through its own API. [parallel provider + variant — abstraction follows feature] + +Observed sequence for **library/MCP centralization**: + +1. `dfc2d7fa93` (2026-09-25): MCP servers, skills, instructions kept once in + magpie, given to every agent. [initial abstraction — after several individual + agent-specific skills existed] +2. `bf0f3e3f73` (2026-10-03): a remote MCP server signed in once in magpie used + by every agent. [capability extension] +3. `9848a9062a` (2026-10-03): RTK says when it is missing and installs it. + [repair — self-healing environment] + +Source: `magpie-important-commits.md`, verified via `git show --stat` on each SHA. + +**Key observation:** In Magpie, abstraction layers are introduced *after* 2-5 +features exist that would share them, not speculatively upfront. This is +consistent across provider onboarding, library/MCP, and routing. Source: inferred +from commit date ordering; not causally established. + +## Historical Magpie observations and their limits + +These are carried history-analysis results from the earlier corpus, not a fresh +coordination audit. Commit granularity, repair intervals and subject patterns do +not causally establish speed, review latency, automation or release reliability. +The first-hand ownership/concurrency/review/testing/integration/release case is +pending Dot delivery and owner review; do not reconstruct it from these counts. + +**Evidence-grounded findings:** + +- **Change granularity**: 71% of commits under 1000 lines; p50 = 151 lines, + p75 = 342. Review speed and change safety were not measured. + Source: computed from `magpie-commits.jsonl` numstat. + +- **Repair latency**: median 1.54 hours from feature commit to related fix + (454 validated commit pairs). 42% of repairs land within 1 hour. + Source: computed from `magpie-commits.jsonl` date fields. + +- **Single-subsystem focus**: 91.3% of focused commits touch only one top-level + area. Provider, gateway, and GUI changes arrive in separate commits. + Source: computed from `magpie-commits.jsonl` top-3 paths. + +- **PR merge cadence**: ~40 PRs/day (from `(#NNNN)` patterns in subjects); + 27% of commits include a PR number. + Source: computed from `magpie-commits.jsonl` subjects. + +- **Abstraction timing**: shared layers introduced post-feature (observed for + library/MCP, provider registry, routing groups). Correlation with speed; + causation not established. + +**What this implies for an agent working on such a repository:** +When adding a new provider, adapter, or capability class, follow the existing +registration pattern — do not introduce a new abstraction unless 2+ concrete +implementations already exist. + +## Auditing a claimed capability + +When a release note or README claims a capability and you need to state whether +it runs at a given revision, use +[capability presence audit](references/capability-presence-audit.md). It classifies +each claim into implemented, hook, documented only or contradicted, and requires +the enabling gate for anything not implemented. This is narrower than the +capability model above: it answers presence and wiring, not speed. + +## Temporal-split benchmark construction (LearningToCommit method) + +Use historical tasks to separate earlier onboarding evidence from later test +changes. Keep three evidence classes distinct: the pinned public implementation +below, the paper's reported method/results, and proposed InferRSI safeguards. + +### Observed public implementation + +The following is a source inspection of +[LearningToCommit at `7e5a1d770eb9eb58e614db45f40b1b911529c6e7`](https://github.com/LearningToCommit/LearningToCommit/tree/7e5a1d770eb9eb58e614db45f40b1b911529c6e7), +not an executed benchmark or a claim of equivalence with every paper version. + +1. **Scan and split** + ([`s1_scan_commits.py`](https://github.com/LearningToCommit/LearningToCommit/blob/7e5a1d770eb9eb58e614db45f40b1b911529c6e7/data_construction/s1_scan_commits.py), + [`utils.py`](https://github.com/LearningToCommit/LearningToCommit/blob/7e5a1d770eb9eb58e614db45f40b1b911529c6e7/data_construction/utils.py)): + parse non-merge commit metadata/numstat, prefilter tiny or housekeeping + changes, sort retained commits by the recorded date, keep the most recent + requested count, then assign the oldest fraction to `learning` and the + remainder to `test`. An LLM suitability scan follows that split; unavailable + or oversized diffs are marked unsuitable. This stage, not S3, assigns the + chronological split. +2. **Derive categories** + ([`s2_cluster.py`](https://github.com/LearningToCommit/LearningToCommit/blob/7e5a1d770eb9eb58e614db45f40b1b911529c6e7/data_construction/s2_cluster.py)): + ask a model to derive development categories from a sample of suitable + commits' suitability rationales. This is not direct file-coupling clustering. +3. **Tag categories** + ([`s3_tag.py`](https://github.com/LearningToCommit/LearningToCommit/blob/7e5a1d770eb9eb58e614db45f40b1b911529c6e7/data_construction/s3_tag.py)): + classify each suitable commit using the categories, subject, rationale and + diff; retain the existing split. The tag is a category, not a cutoff date. +4. **Sample separately** + ([`s4_sample.py`](https://github.com/LearningToCommit/LearningToCommit/blob/7e5a1d770eb9eb58e614db45f40b1b911529c6e7/data_construction/s4_sample.py)): + perform category-proportional sampling within the learning and test pools, + excluding unsuitable and uncategorized commits. This does not promise equal + category counts or coverage when the requested sample is too small. +5. **Build tasks** + ([`s5_build.py`](https://github.com/LearningToCommit/LearningToCommit/blob/7e5a1d770eb9eb58e614db45f40b1b911529c6e7/data_construction/s5_build.py)): + export each sampled change's oracle diff and parent-revision source archive; + synthesize an issue-style query from subject, body and diff. The emitted + `benchmark_tasks.jsonl` top-level fields are: + ```text + id, repo, category, synthetic_query, oracle_diff, snapshot_path, + learning_commits + ``` + Each learning record contains `sha, repo, title, category, synthetic_query, + diff_path, snapshot_path`. Mode `all` shares all sampled learning commits + with each test task; `by_category` selects the matching category. No + `tier`, frozen `validator` or verification-command field is emitted here. + +**Snapshot and access boundary.** S5's helper uses `git archive` at the sampled +commit's parent. [`modules/sandbox.py`](https://github.com/LearningToCommit/LearningToCommit/blob/7e5a1d770eb9eb58e614db45f40b1b911529c6e7/modules/sandbox.py) +extracts that archive and initializes a new Git repository with a base commit; +it does not give the agent the target repository's original history. These +inspected paths do not implement a `hidden_paths` filter or frozen external +validator. The phase directory is explicitly **not a security sandbox**: +agent tools run with host-user permissions. A parent snapshot alone does not +establish isolation from later source, oracle data or other host files. + +**Skill conditioning.** +[`workflow/phases.py`](https://github.com/LearningToCommit/LearningToCommit/blob/7e5a1d770eb9eb58e614db45f40b1b911529c6e7/workflow/phases.py) +copies learned skill files into the phase's separate skills directory for the +with-skill solve; the baseline receives no skill directory. +[`modules/prompt_builder.py`](https://github.com/LearningToCommit/LearningToCommit/blob/7e5a1d770eb9eb58e614db45f40b1b911529c6e7/modules/prompt_builder.py) +substitutes workspace/skills paths and describes that directory in the user +context. The [with-skill template](https://github.com/LearningToCommit/LearningToCommit/blob/7e5a1d770eb9eb58e614db45f40b1b911529c6e7/system_prompts/solve_with_skill.txt) +points to it; the environment context asks the agent to read `SKILL.md` first. +This is directory-based access, not verbatim insertion of the skill body. + +**Evaluation, not a correctness oracle.** + +- [`evaluation/programmatic_metrics.py`](https://github.com/LearningToCommit/LearningToCommit/blob/7e5a1d770eb9eb58e614db45f40b1b911529c6e7/evaluation/programmatic_metrics.py) + computes changed-file IoU, tool-using assistant-message counts from the + trajectory, and signed/absolute line-count deviation from the oracle patch. + It does not run a frozen validator or map validator exit codes to task + correctness. +- [`evaluation/pairwise_judge.py`](https://github.com/LearningToCommit/LearningToCommit/blob/7e5a1d770eb9eb58e614db45f40b1b911529c6e7/evaluation/pairwise_judge.py) + compares the with-skill and baseline **patches**, shown with the task query + and oracle diff, on scope alignment, logic similarity, redundancy/hallucination + and code style. Its default four rounds use ABBA presentation order. It is + not an oracle-trajectory comparison or a fallback gated on ambiguous + programmatic results. Patch similarity and judge preference do not establish + functional correctness. + +### Paper claims and version boundary + +The [existing Learning to Commit paper ledger](../../maintenance/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md) +records the v1 method, author-reported pilot outcomes and limitations. Those +paper claims are separate from the public-code observations above; this source +reconciliation does not reproduce them or establish paper-to-code equivalence. +Do not combine versions or promote this candidate on the basis of reported +localization, patch-size or judge outcomes. + +### Proposed InferRSI safeguards and portability questions + +These are adaptations to evaluate, **not mechanisms attributed to the pinned +upstream implementation**: + +- Freeze the learning inputs and skill revision before held-out evaluation; + audit synthetic-query answer leakage independently of the chronological split. +- Enforce source/oracle separation in an actually isolated, least-privilege + execution environment. If paths must be hidden, specify and verify that policy + rather than assuming that an archive or phase directory enforces it. +- Define and freeze task-specific correctness/integrity validators outside the + editable workspace, with explicit failure and incomplete-evidence handling. + Report correctness separately from localization, style, patch size and cost. +- For NPU/kernel tasks, first check whether commit context supports an intent-only + query and a reproducible parent environment. Compiler/runtime availability, + numerical checks, profiler access and performance-regression gates require + task-specific qualification; temporal sampling alone does not transfer them. +- Compare with-skill and baseline under declared matched model, harness, tool and + budget controls, retaining failed attempts and deviations. No kernel-repository + portability, agent-efficacy or performance result is established by this guide. + +## Scoped historical lessons + +For each lesson, record parent snapshot, task intent, accepted change, the agent's +specific discrepancy and the narrow applicability condition. Separate file-local +habits, subsystem invariants and repository-wide conventions. Accepted historical +code is a contrastive reference, not the unique correct solution or an eternal +rule. Revise or retire lessons when later accepted evidence contradicts them. + +Freeze adaptation inputs before future-task evaluation; audit issue synthesis and +source access independently. Report correctness, localization, patch size, style +and resource use separately. The +[Learning to Commit paper ledger](../../maintenance/npu-skill-factory/references/papers-20261015/references/learning-to-commit.md) +and [convention-expiry counterexample](../../maintenance/npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md#e-c2--better-repository-familiarity-can-produce-unnecessary-caution) +extend the existing temporal-split method. These methodology papers do not verify +Magpie's actual development coordination or authorize another history scan. + +### Worked learning transition: RTK consumer PATH + +The [pinned RTK transition](references/rtk-consumer-path-transition.md) turns one +already-cited Magpie change into a conditional lesson: manager discovery and +hook enablement do not establish consumer name resolution. Read its +unknown-PATH, binary-identity, diagnostic side-effect and platform qualifications +before reuse. It is a learning example, not an independent heldout task; +upstream tests were inspected, not executed. Candidate/not_run is unchanged. + +## Constructing the capability evolution graph + +For a new repository, build the graph with this procedure: + +1. Run coupling analysis on the commit log to find co-changed file sets. +2. For the top 5-10 file clusters, trace the commit sequence on those files + with `git log --follow --numstat -- `. +3. For each cluster, read the first, largest, and most recent 2-3 commits. + Record for each: + ``` + intent: (what the commit message says it does) + subsystem: (top-level directory or component name) + before: (concrete: what was the state/API before this commit) + after: (concrete: what changed in behavior/interface) + files: (list of changed files) + validation: (were tests added? in the same commit or a later one?) + followups: (SHA of the next commit in the same family, if traceable) + rework: (was this commit later reverted or significantly amended?) + ``` +4. Connect nodes with edges only where a commit SHA directly establishes the + connection (not where you infer it from timing alone). + +INCONCLUSIVE: if the repository history has gaps (shallow clone, squash merges, +or missing files), report which capability families cannot be reconstructed and +why. + +## What this skill does not do + +- It does not analyse the current source to determine correctness. +- It does not produce a performance measurement. +- It does not decide whether a proposed change is safe to make. +- It does not automatically select which tasks to include in a benchmark. + +All of those require separate evidence. diff --git a/src/inferrsi/knowledge/atoms/workflows/repository-evolution-analysis/references/capability-presence-audit.md b/src/inferrsi/knowledge/atoms/workflows/repository-evolution-analysis/references/capability-presence-audit.md new file mode 100644 index 000000000..ebd0c9c62 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/repository-evolution-analysis/references/capability-presence-audit.md @@ -0,0 +1,72 @@ +# Capability presence audit + +A procedure for answering one narrow question: **does the claimed capability actually run at this revision, and through what gate?** It is narrower than a capability-family analysis and wider than reading a README. + +Use this reference when a release note, README or vendor document lists features and you must state what the code does. Do not use it for performance claims — this classifies presence and wiring, not speed. + +## The four buckets + +Every claim lands in exactly one: + +| Bucket | Test | Typical evidence | +|---|---|---| +| **Implemented** | A reachable call path from the public entrypoint changes behaviour | A caller that is not gated off, plus a body that is not empty | +| **Hook** | A symbol exists and is called, but its body is empty, or its caller is gated off by a value that never occurs | Empty virtual method with no subclass; a body behind a constant-false gate | +| **Documented only** | No symbol, or symbols only in tests and docs | A tree-wide search that returns nothing in the called graph | +| **Contradicted** | The code does something different from the claim | A default that inverts the claim; a backend that asserts instead of degrading | + +A claim that fits two buckets is under-specified. Split it before classifying: "asynchronous scheduling is enabled by default" is two claims, one about existence and one about the default. + +## Procedure + +1. **Record the claim verbatim.** Do not paraphrase into something easier to confirm. Note whether it is a feature list, a hardware list, or an exclusion list. Exclusion lists are the easiest to audit and the most informative: a README that says "does not ship X" is making a falsifiable claim. + +2. **Find the entrypoint that would exercise the claim.** Follow from the public entry, not from the directory that shares the claim's name. Name-adjacency is the most common false positive. + +3. **Classify.** Use the table above. + +4. **For every hook, find the gate.** Ask what would have to be true for the body to run, then check whether that condition can be true in this build. An empty virtual method plus no subclass is a hook. A real body behind a flag whose value is a constant is also a hook. A flag that defaults false is *not* a hook if the documentation says it is optional. + +5. **Check for subclasses and registries.** A base class with virtual methods proves nothing. Search for derived types and for registration. Record the command shape, because "no subclass found" is a claim about a search. + +6. **Check defaults, not just existence.** A feature can be present and inert. Read the environment-variable or configuration default and quote it. Then check whether some other construction path overrides it — a `setdefault` in a dataclass `__post_init__` can make a variable default-false in one sense and default-true in another. + +7. **Separate the four claim strengths.** Exists, is correct, is fast, is end-to-end usable. Never let one imply another. + +8. **State the extraction boundary.** Say explicitly whether the tree is complete. Only a complete tree lets "absent" mean absent; a sparse checkout licenses only "not located in the inspected paths". + +## Worked instance + +Applied to [deepseek-ai/DeepInfer @ 8b16149741a4935e1dec8cea27853f273b374c5b](https://github.com/deepseek-ai/DeepInfer/tree/8b16149741a4935e1dec8cea27853f273b374c5b), by static source reading only. The supplied source-reading archive includes the parent and six direct vendor snapshots, but omits nine listed media files and leaves ten nested vendor gitlinks unexpanded. Its untruncated upstream tree inventory describes the snapshot before those omissions; it does not make the delivered archive a complete checkout or build environment. The observations below are bounded to the named parent-source paths, not an absence proof over omitted or external code. + +| Claim (verbatim from README) | Bucket | Deciding evidence | +|---|---|---| +| "Asynchronous scheduling (zero-overhead batch scheduler)" / "Enabled by default." | **Implemented**; constructor-dependent default | [The worker defers decode post-processing](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/worker/worker.py#L182-L187). [EngineArgs uses setdefault and rearms the variable](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/engine/arg_utils.py#L48-L55), with [NORMAL/COMPLETION true and PROMPT false](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/engine/engine_type.py#L15-L17). The standalone [EnvVar.bool default is false](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/environ.py#L69-L71). These construction contexts are not contradictory; an explicit environment value is preserved. | +| "Parallelism: Attention DP / balanced CP, MoE EP + EPLB" — the EPLB rearrangement part | **Implemented**, opt-in; not a Hook | [Model sampling calls the EPLB manager](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/model_executor/models/deepseek.py#L402-L409), which [calls each balancer](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/model_executor/eplb/__init__.py#L378-L384). Its [real update/rearrange path](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/model_executor/eplb/__init__.py#L131-L165) returns when the interval is zero and skips EP size one. The [interval defaults to zero](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/environ.py#L111-L117), using the [integer default](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/environ.py#L62-L63). This disables dynamic rearrangement by default, not the implementation or all load statistics. | +| "A KV cache system" — under the README's complete-service exclusion heading | Service save-integration **Hook**; in-engine KV **Implemented** | [README:38-42](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/README.md#L38-L42) excludes components needed for a complete service. The inspected [save-integration methods have no implementation](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/engine/llm_engine.py#L815-L822); this does not mean device KV is missing: [CacheEngine allocates KV/state storage and constructs GPUCacheInterface](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/worker/cache_engine.py#L918-L966). | +| "VE/Prefill/Decode disaggregation (most required engine functionality is already implemented)" — the same service exclusion list | **Hook** at the inspected integration seam | [init_pd_split](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/engine/llm_engine.py#L800-L809), [send_processed_prompts and post_process_model_outputs](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/engine/llm_engine.py#L848-L858) have no implementation in the base engine. The bounded parent-source search described below located no subclass; this does not negate the README's statement that supporting engine functionality exists. | +| "Load balancing across data-parallel replicas for both prefill and decode" — the same service exclusion list | **Documented only** within this readset | [README:38-42](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/README.md#L38-L42) states the service exclusion. This bounded hook/default audit did not establish an application request router or audit omitted/external implementations; it makes no stronger absence claim. | + +Two subtleties the exercise surfaced: + +- **`finalize_seq` is not empty.** It is inside the same virtual block but [calls scheduler.free_seq](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/engine/llm_engine.py#L804-L806). So the hook block is heterogeneous: an implementation inheriting it would get partial behaviour rather than nothing. A blanket "all these are empty" statement would be wrong. +- **A body can exist behind an inactive base-class gate.** [do_copy_state](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/engine/llm_engine.py#L787-L798) performs a copy only when its buffer exists, while [should_copy_state returns False](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/engine/llm_engine.py#L811-L813) in the inspected base engine. Body-present alone is not evidence that this entrypoint executes it. + +## Pitfalls + +- **Name-adjacency.** A directory or class named after the feature is not evidence that the feature runs. In the audited source, three claimed-absent components were present as named empty methods — the name was *more* misleading than absence would have been. +- **Body-present-is-not-reachable.** See the state-copy case above. +- **Flag defaults.** EPLB dynamic rearrangement is opt-in, whereas ZOS is enabled by the standard NORMAL/COMPLETION EngineArgs constructor when no environment override exists. Reading the variable's standalone default alone gives the wrong answer for that entrypoint. +- **Hardware lists.** A supported-device list is not a compatibility guarantee. Check whether unsupported cases assert or degrade silently; in the audited source one property hard-asserted on the non-NVIDIA backend. +- **Documentation that describes the deployment, not the code.** A production Q&A can truthfully describe a shape the open release does not implement. Label it DOC and keep it separate from CODE findings — both statements can be true. +- **Comments as evidence, carefully.** A source comment saying "virtual method, handles finished requests" is the author's description, not the behaviour. Read the body. The same applies in reverse: a comment stating a correctness requirement (as `mtp_varlen.hpp:160` does) is evidence of intent that must then be checked against the code that follows it. +- **Sparse checkouts.** Absence in a curated skill-doc checkout proves nothing. Say so rather than reporting a feature as missing. + +## Output + +A table with one row per claim: claim verbatim, bucket, deciding evidence, the gate that would enable it, residual uncertainty. Then a short list of findings that change how the release may be described. + +## Evidence this instance produced + +- The full-SHA path/line links above distinguish feature code, constructor defaults and the complete-service exclusion list; none is native execution evidence. +- Bounded search: `rg --no-ignore -n -F LLMEngine deepinfer tests`, plus class-declaration inspection, at the stated pin. The located declaration is [llm_engine.py:130](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/engine/llm_engine.py#L130); the public entry [constructs that engine through EngineArgs](https://github.com/deepseek-ai/DeepInfer/blob/8b16149741a4935e1dec8cea27853f273b374c5b/deepinfer/entrypoints/llm.py#L77-L84). No subclass was located in those two inspected directories. Vendors, unexpanded gitlinks and external deployment code are outside this search. diff --git a/src/inferrsi/knowledge/atoms/workflows/repository-evolution-analysis/references/rtk-consumer-path-transition.md b/src/inferrsi/knowledge/atoms/workflows/repository-evolution-analysis/references/rtk-consumer-path-transition.md new file mode 100644 index 000000000..0763a2732 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/repository-evolution-analysis/references/rtk-consumer-path-transition.md @@ -0,0 +1,156 @@ +# Worked transition: manager discovery is not consumer reachability + +Status: source-derived **candidate**; empirical validation **not_run**. This is +one learning example inside repository-evolution-analysis, not a new skill, +benchmark task or independent heldout task. It does not establish automatic +learning, agent efficacy or Magpie's development speed. + +## Source boundary + +The inspected change is +[`9848a9062a65c49e074c09770dc7de73dd012bea`](https://github.com/yetone/magpie/commit/9848a9062a65c49e074c09770dc7de73dd012bea), +whose recorded parent is +[`4b5d6d725fae3d8a263f6e43c707400e3765b84f`](https://github.com/yetone/magpie/tree/4b5d6d725fae3d8a263f6e43c707400e3765b84f). +Public source was inspected on 2026-10-29; upstream programs, shell profiles, +installers, Go tests and browser tests were **not executed** for this example. +The commit's reported checks are author reports, not local receipts. + +| Readset | Parent evidence | Change evidence and purpose | +| --- | --- | --- | +| Discovery and diagnostic view | [`internal/library/rtk.go`](https://github.com/yetone/magpie/blob/4b5d6d725fae3d8a263f6e43c707400e3765b84f/internal/library/rtk.go) | [`rtk.go`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/library/rtk.go): `rtkPath`, `ReadRTK`, hook-state detection | +| PATH observation and mutation | These PATH-specific files are added by the change, absent in its parent | [`rtk_path.go`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/library/rtk_path.go), [`rtk_path_other.go`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/library/rtk_path_other.go), [`rtk_path_windows.go`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/library/rtk_path_windows.go) | +| PATH supplied to the observer | [`proc/path_other.go`](https://github.com/yetone/magpie/blob/4b5d6d725fae3d8a263f6e43c707400e3765b84f/internal/proc/path_other.go), [`proc/path_windows.go`](https://github.com/yetone/magpie/blob/4b5d6d725fae3d8a263f6e43c707400e3765b84f/internal/proc/path_windows.go), [`provider/install_windows.go`](https://github.com/yetone/magpie/blob/4b5d6d725fae3d8a263f6e43c707400e3765b84f/internal/provider/install_windows.go) | [`proc/path_other.go`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/proc/path_other.go), [`proc/path_windows.go`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/proc/path_windows.go), [`provider/install_windows.go`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/provider/install_windows.go): `LoginPath` and reuse of the moved registry reader | +| Upgrade destination | [`rtk_upgrade.go`](https://github.com/yetone/magpie/blob/4b5d6d725fae3d8a263f6e43c707400e3765b84f/internal/library/rtk_upgrade.go) | [`rtk_upgrade.go`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/library/rtk_upgrade.go): symlink-aware script destination | +| Entry points and presentation | Changed caller hunks in the pinned commit | [`internal/gui/library.go`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/gui/library.go), [`internal/gui/assets/library.js`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/gui/assets/library.js), [`library_cli.go`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/library_cli.go): warning, explicit repair action and restart advice | + +This is a bounded readset, not a complete consumer/runtime audit. In particular, +the change's description of Pi's extension is a reported motivation; the +extension's independent upstream implementation was not inspected here. + +## Reconstruct the transition + +**Task intent (commit report).** An agent could fail to find RTK by name although +Magpie found an installation and showed its hook enabled. The requested repair +was to expose that mismatch and offer an explicit PATH action, not silently +rewrite shell profiles or reinstall every agent. + +**Before (inspected parent).** `rtkPath` first used Magpie's `exec.LookPath`, then +searched installer locations outside that PATH. `ReadRTK` exposed the discovered +path, version, gains and per-agent hook state. These facts did not answer whether +a separately launched agent could resolve the name `rtk`. On non-Windows, +`proc.UserPath` augmented Magpie's own environment with known installer folders +and login-shell entries. Thus the manager's search environment could be broader +than the consumer's. The parent view had no `OffPath` distinction. + +**After (inspected change).** Discovery is retained, with Windows WinGet package +folders added. A separate `rtkReached` examines `proc.LoginPath`, and `ReadRTK` +adds `OffPath`, `PathDir` and `PathLink` when that check reports no match. The GUI +shows the warning whenever `OffPath` is true, but offers the repair button only +when a destination is available; the CLI also describes the applicable action. +`PathRTK` is reached by the explicit GUI +POST `/api/library/rtk/path` or CLI `magpie library rtk path`. It attempts the +platform-specific change, rereads the diagnostic view, rejects a still-off-PATH +result and lists enabled agents for restart. It does not restart those processes. + +**Observed discrepancy, not a reconstructed agent failure.** The contrast is +between manager-side discovery/hook state and consumer-side name resolution. +No original coding-agent trajectory or independent agent patch is available in +this readset, so do not invent what an agent tried or why it made a mistake. + +## Conditions and counter-signals + +| Condition | What the pinned implementation establishes | What it does not establish | +| --- | --- | --- | +| Manager found a path | `rtkPath` found a manager-PATH match or an existing fallback path | Successful execution, consumer name resolution or matching consumer binary; fallback `exists` is only a stat check | +| Known consumer PATH, no runnable name | `rtkReached` found no non-directory `rtk`/`rtk.exe` in its nonempty entries; non-Windows also requires an execute bit | Exhaustive emulation of every shell's aliases, wrappers, launch environment or executable-resolution rules | +| Unknown consumer PATH | A nil `LoginPath` makes `rtkReached` return **true**, suppressing the warning | Confirmed reachability; absence of `OffPath` can mean unknown rather than success | +| Runnable same-name file found | The name/existence/mode predicate passed somewhere in the observed directories | Identity with `ReadRTK.Path`, matching version, first-resolved binary, integrity, hook compatibility or a successful launch; Windows does not apply a Unix execute-bit test | +| PATH repaired | The code rereads the view and gives restart advice | Changed environments of already-running agents/terminals or actual end-to-end RTK use | + +Non-Windows `LoginPath` invokes the login shell interactively and caches a +successful PATH for a minute. Windows instead reads machine then user registry +PATH values, expanding variables and skipping unreadable keys. Neither is a +receipt from a specific agent process; caching, partial registry reads and +different launchers can weaken the approximation. A nil result is distinct from +a non-nil empty list in `rtkReached`. + +### Mutation and diagnostic boundaries + +- **Non-Windows repair:** select the first eligible directory from the fixed + list of local-bin, user-bin, Homebrew, system-local-bin, Linuxbrew and Cargo + locations. It must already occur in the observed PATH, be an existing writable + directory and have no existing `rtk` entry under `Lstat`. Create a symlink to + the discovered binary; do not overwrite an occupied entry or edit a profile. + If no destination qualifies, return advice rather than invent another folder. +- **Windows repair:** use the binary's own directory, append it to the user's + registry PATH if absent under the implemented case/trailing-separator check, + update Magpie's process PATH and broadcast an environment-change notification. + This is not the non-Windows symlink mechanism and not a copy of the binary. +- **Upgrade follow-through:** the non-Windows script-upgrade branch resolves a + symlink's target directory rather than installing over the link. Existing + package-manager branches remain separate; reading the proposed command does + not execute an upgrade or prove installer classification for every layout. +- **Diagnostics are not pure read-only:** with a discovered binary, `ReadRTK` + executes `--version` and `gain --daily --format json`. On the non-Windows + off-PATH branch, selecting `PathDir` may create, close and attempt to remove a + temporary file to probe writability; cleanup errors are not checked. PATH + observation may execute login-shell profiles. Do not call this a harmless + filesystem read or guarantee that an arbitrary discovered executable has no + side effects. `ReadRTK` does not itself perform the explicit PATH repair. +- **Caller effects are separate:** the GUI GET handler can call `RTKLatest`, + and the CLI calls `CheckLatest`; those paths may query GitHub. A read-labelled + UI/CLI operation therefore is not an offline/no-execution guarantee either. + +## Tests inspected, not executed + +| Source at the change pin | Assertions inspected | Limit | +| --- | --- | --- | +| [`rtk_path_test.go`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/library/rtk_path_test.go), `TestRTKOffPath` | Fallback discovery outside PATH; no destination produces advice; an eligible user-bin destination produces a symlink and enabled-agent restart list; script-upgrade destination follows that link | `!windows`; fake RTK and test PATH, not a real agent/installer | +| [`library_test.go`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/library/library_test.go), sandbox helper; [`rtk_test.go`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/library/rtk_test.go) | Sandbox replaces `userPath` with the test's PATH; fake RTK supplies version/gain/install behavior | Does not exercise real login-shell discovery; fake output is not observed savings | +| [`rtk_upgrade_test.go`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/library/rtk_upgrade_test.go) | Fake Brew/script upgrades and a local fake latest-release server | Not real package-manager or Windows validation | +| [`library-rtk-path.test.cjs`](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/internal/gui/tests/library-rtk-path.test.cjs) | English/Chinese warning, enabled-agent tag, button POST, warning removal and restart message in Chromium/WebKit cases | API is mocked; does not run backend PATH mutation or an agent | + +The inspected regression does not test unknown-PATH semantics, same-name binary +identity or Windows registry execution. This table describes test source, not a +passing test result. No upstream runtime or cross-platform qualification follows. + +## Conditional lesson to reuse + +When a manager configures a consumer with an absolute executable path but the +consumer's hooks later invoke it by name, **separate installation discovery, +hook enablement, consumer resolution and actual execution**. Inspect the actual +caller and environment at the target revision before reusing this lesson. + +1. Identify the command shape and who resolves it. Record the manager's found + path separately from the consumer environment; keep unknown observations + unknown rather than upgrading a warning's absence to success. +2. Check name collisions and version/identity requirements separately. The + historical predicate is evidence of its implementation, not a universal + identity validator or a recommendation to fail open. +3. Before offering repair, identify authorized mutations, occupied destinations, + platform behavior, upgrade destination and process-restart requirements. + Classify diagnostic execution/probes separately from the explicit repair. +4. Use discriminating tests for the mismatch and the chosen mutation. Add + unknown/identity/launcher/platform cases only under a separately accepted + implementation scope; source inspection alone does not close those gaps. + +This lesson is narrow: it does not apply unchanged when the consumer always +uses an absolute path, inherits a different verified environment or has another +resolver. The accepted historical patch is one contrastive solution, not the +unique correct repair or an enduring repository-wide convention. + +## Evaluation and rights limits + +The target diff and regression tests are learning inputs here. Reusing this +same transition as a heldout task would leak the answer; future efficacy work +needs independently separated tasks, frozen controls and correctness evidence. +InferRSI's existing `audit` and `kv-admission-diagnostic-v1` comparison adapters +handle report auditing/extraction and synthetic KV diagnosis respectively; they +do **not** provide a generic historical coding-task evaluator. Packaging and +Reader checks verify access/consistency, not this lesson's effect on agents. + +This reference is an attributed interpretation of yetone/magpie, not a vendored +source snapshot. Its pinned [root LICENSE](https://github.com/yetone/magpie/blob/9848a9062a65c49e074c09770dc7de73dd012bea/LICENSE) +declares MIT; no substantial upstream code is reproduced here. That observation +does not resolve rights for other inherited sources, grant third-party/model +rights or alter existing unknown/absent license declarations in this skill. diff --git a/src/inferrsi/knowledge/atoms/workflows/rsi-evidence.md b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence.md new file mode 100644 index 000000000..558fca4e8 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence.md @@ -0,0 +1,154 @@ +--- +name: rsi-evidence +description: Guide agents to establish acceptance criteria, freeze and cite RSI evidence using plan/results/patch/validator paths and PASS/FAIL/INCONCLUSIVE verdicts. +metadata: + inferrsi: | + { + "schema_version": 1, + "profile": "local-skill-v1", + "kind": "skill", + "status": "candidate", + "origin": [ + "first-party" + ], + "consumption_mode": "packaged", + "tags": [ + "evidence", + "verdict", + "runspec", + "provenance", + "review" + ], + "empirical_validation": "not_run", + "provenance_readsets": [ + "references/loopx-goal-governance/README.md" + ], + "applicability": { + "scope": "Preparing acceptance criteria, documenting or reviewing an optimization campaign whose verdict will be cited downstream", + "prerequisites": "For preparation, the user requirements and available model/hardware/workload evidence; for verdicts, pinned baseline and candidate SHAs and an evidence tree under evidence//; conclusions about LoopX goal authority additionally need its governance reference", + "input_contract": "Campaign artifacts in plan/, results/, patch/ and validator/, plus the RunSpec that fixes repo x revision x backend x device x model x scenario", + "produced_artifact": "An evidence record that links paths instead of pasting metrics, and states exactly one of PASS, FAIL or INCONCLUSIVE with its rationale", + "failure_modes": [ + "Metrics pasted into an issue comment with no link to an evidence path", + "A verdict vocabulary outside PASS/FAIL/INCONCLUSIVE", + "PASS recorded on a cleanup or integrity-probe failure", + "Output reused across trials, aliased into a reference, or written outside its own trial directory", + "Source fingerprint taken over a directory overlap that excludes changed tracked files", + "Org-wide default SHAs assumed in a skill or CI instead of read from the acceptance issue" + ], + "refusal_point": "Refuses PASS when the validator freeze, the results rationale or the pinned SHAs are missing, and reports INCONCLUSIVE for that campaign instead" + }, + "recommendations": [ + "Use user-supplied acceptance criteria; otherwise follow performance-ceiling-analysis to formulate targets. Preserve partial requirements and record each derived field's evidence before freezing gates.", + "Link evidence paths in the report; a metric quoted only in a comment cannot be re-checked later.", + "Fingerprint tracked source even when the output directory overlaps it, and exclude only the current run's generated files.", + "Treat a missing upstream-cache release proof as INCONCLUSIVE rather than a PASS with a caveat.", + "Read baseline and candidate SHAs from the acceptance issue for that campaign, never from a skill default.", + "Freeze optional required_trial_checks for complete requests, effective graph controls and clean worker exits; require literal true per trial and retain supporting receipts." + ], + "limitations": [ + "Documents evidence discipline; it performs no measurement and certifies no campaign.", + "The LoopX goal-governance reference is a source-derived candidate and adds no execution permission or empirical validation." + ] + } +--- + +# RSI evidence discipline + +Use when documenting or reviewing optimization campaigns in ThinkFlowLab-style repos. + +## Establish acceptance criteria + +Use the user's supplied criteria, including a referenced accepted plan. If none +were supplied, use `performance-ceiling-analysis` to formulate evidence-backed +targets under its [acceptance-criteria procedure](../../../playbooks/measurement/performance-ceiling-analysis/references/acceptance-criteria.md). +Preserve partial requirements and derive only missing fields. Record the source +of each criterion, derivation evidence and freeze authority before search. +Unknown inputs remain explicit; estimates cannot relax supplied or frozen gates. + +## Evidence paths + +For campaign id `{campaign_id}`, artifacts live under: + +- `evidence/{campaign_id}/plan/` +- `evidence/{campaign_id}/results/` +- `evidence/{campaign_id}/patch/` +- `evidence/{campaign_id}/validator/` + +Do not paste metrics only in issue comments—link paths. + +## Verdicts + +Only **`PASS`**, **`FAIL`**, or **`INCONCLUSIVE`**. + +- **PASS**: pinned baseline SHA + pinned candidate SHA, frozen validators, gates met on recorded RunSpec. +- **FAIL**: gates not met with complete evidence. +- **INCONCLUSIVE**: missing freeze, partial runs, or environment blocks comparison. + +## SHAs + +Baseline and candidate revisions are **owned by the acceptance issue** for that campaign. Replace placeholders like `` and `` from the issue—never assume org-wide default pins in skills or CI. + +## RunSpec + +Freeze **repo × revision × backend × device × model × scenario** before comparing results. Reference `inferrsi.runspec.RunSpec` or your renamed package. + +## Runtime and upstream review gates + +- Keep framework dispatch and its tests model-neutral. Prefer existing explicit + configuration over a second model/device/version-specific selection rule. + Model policy belongs in model adapters; backend prerequisites and topology + constraints belong in the owning backend. Remove obsolete knobs and tests + when consolidating selection, while retaining default and explicit-opt-in checks. +- Before changing a shared component or script, enumerate direct and transitive + consumers and map each changed contract to a regression test. Exercise the + other consumers' fast and fallback paths, layouts, dtypes, hooks and gradients; + include encoder/decoder integration where applicable. Record commands, source, + environment, failures and skips. Missing consumer coverage is `INCONCLUSIVE`; + one model's E2E success does not establish another model's quality or speed. +- Hardware/dtype matches do not prove build dependencies or collective availability. + Keep optional acceleration opt-in until initialization establishes prerequisites; + do not fall back on only one rank after starting a collective. +- Prove that request caches release after success, failure, interruption and + dropped step-mode requests. Avoid strong references from singleton models to + request prefix KV. Preserve reusable graph buffers separately. +- Search the target repository for shared primitives before adding kernels. + Place reusable math in its common operator layer, keep model-specific policy + in the adapter, and qualify reduction order, casts, hooks and dtype fallbacks. +- Fingerprint tracked source even when output directories overlap source. + Exclude only the current run's generated untracked artifacts. +- Require outputs to resolve inside their own trial directory. Reject aliases to + references, repeated paths within a trial, and reused outputs across trials. +- Cleanup and integrity probe failures must still produce a failed manifest; + missing evidence or changed source must never become `PASS`. +- Publish portable reproduction commands and path-normalized evidence with + checksums. Keep the archived raw records immutable and distinguish historical + frozen claims from fresh comparisons on rebased code. + +## Downstream citation + +External PRs link the acceptance issue and SHAs; they do not redefine thresholds. Mark summaries **unverified** if artifacts are missing. + +## Goal authority and accounting decisions + +When a recommendation, stop/resume decision or repeated settlement depends on +source state, use the [LoopX Goal governance reference](references/loopx-goal-governance/README.md). +It separates canonical Todo authority from Markdown/index projections, Python +fact preparation from TypeScript decisions, and local accounting recovery from +external execution guarantees. Read its counterexamples before interpreting +`should_run`, missing state or a replay lookup. This source-derived candidate +adds no execution permission or empirical validation; the evidence, RunSpec and +verdict rules above still apply. + +## Omni and streaming experiments + +Use the [Omni experiment contract](references/omni-experiments.md) +for reference/RNG parity, feedback-aware stage boundaries, +matching streaming decode schedules, internal graph controls and protocol preflight. +Freeze selected `--require-trial-check` dotted boolean fields +in RunSpec and require literal true evidence from every baseline/candidate trial. +Missing, malformed or false fields make qualification INCONCLUSIVE; a successful +process and metric alone do not prove complete requests or normal worker exits. +Retain underlying receipts and all failed attempts. After repairing the harness, +rerun the complete comparison rather than combining arms from different attempts. +These checks do not replace the accuracy dataset or mixed-request concurrency. diff --git a/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/LICENSE b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/LICENSE-MIT.md b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/LICENSE-MIT.md new file mode 100644 index 000000000..f5746a7ee --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/LICENSE-MIT.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 LoopX contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/NOTICE.md b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/NOTICE.md new file mode 100644 index 000000000..45a3556ec --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/NOTICE.md @@ -0,0 +1,9 @@ +LoopX +Copyright 2026 LoopX contributors + +LoopX was created by huangruiteng (https://github.com/huangruiteng), +with contributions from the LoopX community. + +LoopX releases through v0.4.7 were distributed under the MIT License. +The historical MIT license text and copyright notice are retained in +LICENSE-MIT. diff --git a/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/README.md b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/README.md new file mode 100644 index 000000000..30a79f0ff --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/README.md @@ -0,0 +1,77 @@ +# LoopX Goal authority and quota boundaries + +Use this source-derived candidate when reviewing an agent's proposed next action, +a stopped Goal, or a repeated quota settlement. It supplies questions and +counterexamples for the existing RSI evidence workflow; it does not implement a +controller or change InferRSI's RunSpec, authorization or verdict rules. + +The source is [LoopX at `f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9`](https://github.com/loopx-project/loopx/tree/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9), +inspected on 2026-10-26. [The ledger](source-ledger.json) records actual file +bytes, Git blob identities, inspected sections and exclusions. Code, document +intent, test assertions and deductions have separate meanings. Upstream tests +were read, not run; empirical validation is `not_run` and agent efficacy is not +evaluated. + +## Choose the question + +| Question | Read | Observation to retain | +| --- | --- | --- | +| Is this the current Todo authority or a readable view? | [Authority and projections](mechanisms.md#authority-and-projections) | Selected provider, revision, complete source availability and Goal identity | +| Does `should_run` permit delivery, repair or another bounded action? | [Decision ownership and order](mechanisms.md#decision-ownership-and-order) | Admission lanes, effective action, reason and the guard that changed them | +| Is a retry the same accounting effect? | [Accounting identity and recovery](mechanisms.md#accounting-identity-and-recovery) | Effect ID, semantic request digest, index basis and durable receipt | +| Can an old event file or a missing receipt be treated as empty? | [Retirement and external effects](mechanisms.md#retirement-and-external-effects) | Explicit refusal or uncertainty; preserve the source and recovery evidence | +| What would expose an incorrect interpretation? | [Decision cases](decision-cases.md) | Source-supported expected result and the tempting unsupported conclusion | + +```mermaid +flowchart TB + A["Selected canonical Todo provider\nsource authority + revision"] --> P["Python: collect source facts\nhealth, frontier and scope"] + P --> T["TypeScript: ordered run decision\naction + distinct admission lanes"] + T --> C["Separate TypeScript accounting transaction\neffect ID + request digest + receipt"] + A -. "readable projection" .-> D["Markdown / Todo index / status"] + C --> F["Local JSON + Markdown + run index"] +``` + +The diagram shows inspected responsibilities, not an atomic transaction across +these layers. A returned decision does not execute work. Accounting artifacts +do not fence an external host or provider effect. + +## Apply the knowledge + +1. Identify the source revision and affected Goal. If an exact `GoalRef` is + required, retain both the Goal ID and its instance ID. +2. Establish source availability before interpreting counts or recommendations. + Distinguish missing state, unavailable provider and valid empty state. +3. Read the action and all admission lanes together. Check the ordered guards + before treating a repair or inbox action as normal delivery permission. +4. For accounting recovery, distinguish repeating the original commit from a + replay lookup. Compare identity and request semantics before retrying. +5. Record the remaining uncertainty and the next authorized check. Keep + execution status, task acceptance and `PASS` / `FAIL` / `INCONCLUSIVE` + separate. + +The examples are review aids, not permission to execute LoopX, restore a Goal, +remove files or spend compute. The historical reference for InferRSI RFC #137 +remains `a6f28057b49fe03bb234fa6ce1bac5d61df0c58f`; this newer knowledge readset +does not replace that pin or deliver its checkpoint implementation. + +## Read through InferRSI + +With the optional `skills` parser installed: + +```bash +inferrsi skills resource rsi-evidence references/loopx-goal-governance/mechanisms.md +inferrsi skills reference optimization-search-policy ../../workflows/governance/rsi-evidence/references/loopx-goal-governance/README.md +``` + +The generated catalog's `inferrsi.common.skills.rsi_evidence` record links the +complete owner, including these resources. Reading, indexing or packaging the +material does not establish LoopX runtime behavior or incremental skill benefit. + +## License and attribution + +The pinned source uses Apache-2.0. Preserve its original [LICENSE](LICENSE) +and [NOTICE](NOTICE.md). The notice credits LoopX contributors and its creator +huangruiteng, and records MIT distribution through v0.4.7; the retained +[historical MIT text](LICENSE-MIT.md) does not relicense current code. +These references paraphrase the inspected mechanisms; no LoopX runtime is +bundled and no enterprise affiliation is inferred. diff --git a/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/decision-cases.md b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/decision-cases.md new file mode 100644 index 000000000..706b1c62a --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/decision-cases.md @@ -0,0 +1,61 @@ +# Decision cases + +These are source-supported review cases for the [mechanisms](mechanisms.md). +They are not recorded executions. `not_run` applies to runtime and agent +evaluation. Inputs below describe the relevant facts; they are not complete +LoopX API requests or authorization to run work. + +## Goal and next-action cases + +| Case | Relevant input or observation | Expected interpretation / next check | Unsupported conclusion | +| --- | --- | --- | --- | +| G1: missing active state | The selected Goal has `state_file_missing`; an old recommendation and unused quota remain visible | Goal health is false. Inspect reconnect/retire guidance; do not manufacture intent, acceptance or stop conditions from the recommendation | Budget availability makes this a runnable Goal | +| G2: display versus authority | Markdown says a Todo is open; the selected provider is unavailable | Retain an authority failure, not a valid empty or Markdown-backed work list. Restore/inspect the owning provider through an authorized recovery | Readable Markdown is sufficient fallback authority | +| G3: valid empty source | Canonical read is loaded and complete, with zero Todos | Empty source is real input. Separately inspect closure/frontier evidence before terminal classification | Empty display or zero count proves terminal completion | +| G4: budget and recovery | No execution lane is open and state is `throttled`; compare with a separately admitted recovery lane | Closed throttled case skips. An explicitly admitted recovery can select `outcome_floor_recovery`; inspect its own boundary | A recovery action permits arbitrary delivery or enforces a supplier cost cap | +| G5: capability and workspace | Capability requests `repair_bridge`, and workspace guard is present; no later inbox/terminal override | Normal/recovery delivery and capability repair are closed; workspace repair is the selected action. `should_run=true` is repair permission at this layer | `should_run=true` permits the original selected Todo | +| G6: inbox exception | Required prompt upgrade plus due reply; compare nonterminal facts with terminal-source inbox facts | Nonterminal upgrade blocks. Terminal-source inbox exception preserves the reply action. Read source conditions rather than applying a universal priority slogan | Inbox always wins, or terminal always closes every possible lane | +| G7: terminal and resume | Complete user/agent Todo sources and validated empty frontier derive terminal-no-follow-up, with no inbox priority | All execution lanes close and recurring automation stops until explicit resume. Missing/incomplete source evidence cannot substitute for this derivation | A resumed receipt grants a fresh future task or makes incomplete sources terminal | + +G1 is grounded in `decision_summary.goal_missing_state_blocker` / +`goal_status_health_ok` and `should_run._apply_missing_state_health_guidance`. +G2/G3 use `local_authority.read_canonical_todos_if_promoted`, +`shared_goal_work_source.read_shared_goal_work_source`, and +`test_real_directory_lifecycle_uses_canonical_state_despite_stale_audit`. +G4–G6 use the shared `quota_run_decision.json` fixture and the Python/TypeScript +decision tests. G7 uses the Python terminal projection in +`test_terminal_closure_precedes_automation_upgrade`; the terminal helper's full +implementation is outside this readset. The [ledger](source-ledger.json) and +[decision ownership](mechanisms.md#decision-ownership-and-order) link these +sources. + +## Accounting and retirement cases + +| Case | Relevant input or observation | Expected interpretation / next check | Unsupported conclusion | +| --- | --- | --- | --- | +| A1: repeated commit | Same effect, full semantic request and Goal instance; a matching committed receipt exists | Validate receipt and artifacts. Return replay without a second index row, or repair missing artifacts under the original receipt | A new timestamp or lost response justifies a new effect ID | +| A2: conflicting request | Reuse an effect ID but change `source`, preview or another digest-covered semantic field | Reject with `effect_id_conflict`. Top-level transport timestamp/CAS changes are different from changes inside the complete preview | Identity equality alone makes a changed request equivalent | +| A3: competing new effect | Two different effects were prepared against the same observed index digest | The later new transaction fails its stale basis. Refresh the decision/basis; do not replace the digest merely to force admission | A new effect ID bypasses stale state | +| A4: partial local publication | Receipt exists; one expected artifact is missing or the final index row is its verified truncated prefix | Repeat the original commit to repair the receipt's artifacts. Conflicting JSON content, different Markdown text or an unrelated malformed row must fail; lookup-only replay does not run this repair | Any malformed index can be rewritten, or replay lookup is a repair command | +| A5: recreated Goal alias | Same Goal ID now refers to a new instance, or an alias-only caller encounters an exact-source row | Preserve and validate the exact `GoalRef`; reject incompatible ownership. Do not consume old-instance accounting as current | Same display ID means same lifetime | +| A6: external effect before receipt | External host/provider work may have completed; no durable local receipt or matching lookup row exists | Record uncertainty. Inspect the operation's independent identity/readback before any authorized retry | Local accounting guarantees external exactly-once, or a miss proves no charge | +| R1: retired event source | A legacy source has nonempty `events.jsonl` or one of the three retired aliases, including malformed bytes | Refuse that source, preserve bytes and expose incomplete coverage. Inspect/export with a compatible release before deliberately changing its active binding | Ignore events, replay them silently, delete them automatically, or fill the gap with rollout history | + +A1–A4 use `spend_commit.ts`, `accounting_artifact_transaction.ts`, +`test_quota_spend_commit_runtime.py` and the selected +`quota_spend_commit.test.ts` cases: exact-effect replay, changed-request/CAS +conflicts, partial-artifact repair and conflicting-identity/index rejection. +A5 follows `source_admission.ts` and the exact GoalRef checks in the transaction +and replay owners. A6 is an explicit deduction from the local accounting scope +and the retirement document's separately stated external-effect crash window; +it is not a reproduced failure. R1 uses `legacy_event_source.py` and +`test_retired_todo_event_source.py`. + +## Record a decision + +For an actual use, retain the applicable source revision, Goal/source identity, +observed input, selected action or refusal, and unresolved evidence. For an +accounting recovery, also retain effect identity, request semantics, index basis +and receipt availability. Separate an inspected source assertion, a locally +observed result and a proposed next action. Keep the original campaign verdict +and authorization unchanged. diff --git a/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/mechanisms.md b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/mechanisms.md new file mode 100644 index 000000000..7d36f47da --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/mechanisms.md @@ -0,0 +1,197 @@ +# Mechanisms and operating boundaries + +All source links below name LoopX commit +`f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9`. **Code** describes inspected control +flow; **test** describes assertions in upstream tests, not a local test result; +**document** describes stated intent; **deduction** is the resulting review +guidance. The [ledger](source-ledger.json) gives the inspected sections. + +## Authority and projections + +**Code:** `read_canonical_todos_if_promoted` retains a historical name but no +longer permits a Markdown fallback. It requires a loaded native result with a +recognized `source_authority`, `decision_read_from_provider=true`, +`legacy_fallback_used=false` and a consistent Todo read model. A requested +Todo/lease snapshot also requires leases and `provider_revision`. Missing or +failed authority raises its cause; it does not become a valid empty Todo list. +[Python reader](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/coordination/local_authority.py#L245-L333) + +The TypeScript list owner loads the selected provider once and builds Todos, +optional leases and acceptance guards from that head. It returns revision and +source-authority facts. `read_shared_goal_work_source` requires a declared state +path and runtime root, but takes its work items from this canonical read and +records its provider basis; it does not read Todo text from the display file. +[List owner](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/coordination/local_authority_read.ts#L292-L354), +[work-source caller](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/goals/shared_goal_work_source.py) + +| Layer | Responsibility | Unsafe substitution | +| --- | --- | --- | +| Provider selection and canonical snapshot | Choose and read current Todo authority; carry source, revision and record identity | A readable old Markdown file cannot rescue a lost provider | +| Source registration / exact Goal identity | Bind an observation or accounting request to its source and Goal instance | A registry witness is neither a grant nor a transaction spanning registry and provider | +| Markdown, Todo index and rollout annotations | Present current state and historical context | A historical event status cannot overwrite current Todo status or claim | + +**Code:** a missing provider selector does not redirect an existing SQLite +authority to File. The selector opener reports the missing selector. The +registry-source witness checks the recorded bytes and explicitly does not span +provider storage. This readset inspects these seams, not all provider internals. +[Provider selection](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/coordination/local_authority_provider.ts#L218-L252), +[source witness](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/coordination/authority_source.ts) + +**Test:** the retirement suite keeps current Todo status and claims when audit +events disagree. Its File/SQLite lifecycle case makes the provider unavailable +while readable stale Markdown remains; reads must fail or expose no authoritative +work, then recover after the provider is restored. This is different from a +successful empty snapshot. +[Authority counterexamples](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane/test_retired_todo_event_source.py#L32-L48), +[provider-loss case](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane/test_retired_todo_event_source.py#L229-L326) + +## Decision ownership and order + +**Code:** Python prepares source facts, Goal-scoped health, replan applicability, +terminal evidence and compatibility text. `resolve_quota_run_decision` sends +typed facts to `effect_runtime_result("quota.run_decision", ...)`. TypeScript's +`resolveQuotaRunDecision` owns the ordered base decision. Python merges only the +returned `quota_patch`, retaining source numbers and unrelated quota metadata. +The managed runtime call crosses to Node/TypeScript; this is not a standalone +pure Python quota kernel. +[Python adapter](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/decision_summary.py#L242-L312), +[typed owner](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/run_decision.ts), +[runtime boundary](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/effect_runtime.py#L1274-L1372) + +Read the following sequence with its conditions; it is not a universal ranking +of all work in LoopX. + +| Step in the typed owner | Condition and effect | +| --- | --- | +| Delivery guards | A non-running capability gate without monitor fallback closes normal/recovery delivery; `repair_bridge` enables capability repair. A workspace guard clears all lanes then enables workspace repair. A required automation-prompt upgrade clears all execution lanes. | +| Base action | Choose normal delivery, recovery, workspace repair, self-repair or capability repair from the remaining lanes. With none open, map operator/health/throttle/wait states to their skip/notify actions. | +| Replan | Without inbox priority, an applicable required replan needs healthy Goal facts, no workspace guard and no required prompt upgrade. It selects a bounded replan instead of normal/recovery delivery. | +| Terminal | Validated terminal-no-follow-up with no inbox priority clears execution lanes and stops recurring automation until explicit resume. It requires complete source/frontier evidence supplied by the Python side, not merely a zero visible count. | +| Inbox | A nonterminal required prompt upgrade still blocks inbox work. Otherwise a due reply or material review clears other lanes and selects its own bounded action; reply wins when both are due. Terminal-source inbox work retains its explicit exception. | +| Task coordination | A ready coordination contract refines only an admitted `normal_run`. It does not capture an inbox or repair action. A route hint is a separate returned patch, not permission to create work. | + +**Code:** `goal_missing_state_blocker` recognizes the selected Goal's +`state_file_missing` finding. `goal_status_health_ok` returns false for it; +unrelated Goal diagnostics are scoped separately. The final should-run facade +can replace an otherwise eligible health skip with `blocked_health` and the +finding's reconnect/retire guidance. Do not create a substitute Goal from a +generic recommendation when its declared active state is gone. +[Health input](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/decision_summary.py#L74-L137), +[missing-state guidance](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/should_run.py#L507-L543) + +**Test:** Python and TypeScript consume the same ordered-rule fixture. It covers +throttled/waiting/health states, explicit recovery, capability/workspace guards, +replan and terminal/inbox exceptions. Python also asserts that large integer +quota values and nested metadata survive the adapter. The small +`test_quota_decision_summary.py` tests only plan-item flattening; it does not +prove the complete decision system. +[Shared fixture](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane_ts/fixtures/quota_run_decision.json), +[Python assertions](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane/test_quota_run_decision.py), +[TypeScript assertions](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane_ts/quota_run_decision.test.ts) + +**Deduction:** `should_run=true` alone is insufficient. Retain `effective_action`, +normal/recovery/repair lane flags, state and reason. A throttle skip blocks the +closed delivery lane; an explicitly admitted recovery/repair action has its own +semantics. None of these fields enforces a provider-side currency ceiling. + +## Accounting identity and recovery + +**Code:** Python constructs a complete preview request, validates the Goal/path +boundary and requires an index basis for execution. It preserves the complete +preview across the large-local-snapshot transport. TypeScript owns spend +validation and the durable accounting transaction. It requires an eligible +preview, positive integer slots, and `after.spent_slots = before.spent_slots + +slots`, with a permitted spend disposition. The caller's validated +delivery-completion attribution survives a later repair frontier. +[Python facade](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/spend_commit.py), +[typed validation](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/spend_commit.ts#L258-L420) + +| Identity / observation | Inspected behavior | +| --- | --- | +| `effect_id` | Use explicit request identity; otherwise `preview.effect_ref`, settlement effect plus `#quota_spend`, or a deterministic hash of selected semantic fields. It identifies the accounting effect, not a proof that external work ran. | +| `request_digest` | Hash canonical key-sorted semantics: effect, root, Goal, source, complete preview, compact before/after, agent and exact GoalRef when present. Top-level `generated_at`, `execute` and CAS observation are excluded. Fields inside the complete preview still participate. | +| `expected_index_digest` | Compare the current run-index bytes before creating a new transaction. Another new effect from the same stale basis is rejected. A matching existing receipt is resolved before this new-effect CAS. | +| Exact `GoalRef` | Source-owned accounting requires Goal ID plus instance ID and source admission together. Admission checks current ownership under the handed-off local locks. An alias-only replay cannot consume an exact-source record. | + +Source identity and digest are defined in +[spend_commit.ts](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/spend_commit.ts#L278-L361). +The [source-admission seam](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/source_admission.ts) +and [Python lock handoff](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/accounting_admission.py) +are local ownership checks. Distributed lease correctness is outside this +readset. + +**Code:** preview constructs a record and, when a runtime root is present, +prospective paths and the observed index digest without publishing artifacts. +Execution serializes the local transaction, writes a per-effect `prepared` +receipt, materializes JSON/Markdown/index, then marks the receipt `committed`. +The receipt retains the expected index prefix's digest and byte length. +[Preview/commit owner](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/spend_commit.ts#L787-L931), +[transaction sequence](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/accounting_artifact_transaction.ts#L894-L1044) + +Distinguish two operations when recovering: + +- **Repeat the same commit:** a matching receipt must have the same effect, + request digest and Goal instance. Its artifacts are checked and missing + artifacts may be repaired; the result is `repaired` or `replayed`. Conflicting + existing JSON content or different Markdown text is rejected. A truncated final index row is repaired only + when it is the expected row prefix after the receipt's verified prior bytes. +- **Replay lookup (`operation="replay"`):** inspect existing spend-index rows, + resolve effect identity, and check Goal and valid agent identity. It does not + execute the commit repair sequence. `read_only=true` also avoids the index + mutation lock; a lookup miss is a miss, not evidence that external work never + happened. + +Relevant rows with conflicting `effect_ref` and commit metadata are rejected in +either direction. Non-quota or unrelated-effect rows are not treated as a +matching spend. An index match without a matching receipt is not silently +adopted as a newly committed transaction. +[Identity/replay lookup](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/accounting_artifact_transaction.ts#L418-L536), +[repair constraints](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/accounting_artifact_transaction.ts#L734-L891), +[Goal/agent replay check](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/spend_commit.ts#L556-L677) + +**Test:** upstream cases assert no-write preview, one row for repeated or +concurrent identical commits, conflict on changed request/stale index basis, +artifact repair, and refusal of conflicting identity/index content. These are +local accounting assertions, not tests of an external provider's billing. +[TypeScript accounting cases](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane_ts/quota_spend_commit.test.ts#L737-L1103), +[Python facade cases](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane/test_quota_spend_commit_runtime.py#L148-L251) + +The settlement event is append-only, while visible `spent_slots` is a rolling +window aggregate. The recorded before/after is a same-status-payload projection. +Later totals can stay flat or decrease when old spends expire; that does not +undo the event or prove a refund. +[Projection semantics](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/spend_commit.ts#L462-L505) + +## Retirement and external effects + +**Code/document:** a nonempty legacy `events.jsonl` or any bound +`state_event_log`, `state_events_file` or `event_log` is refused on the retired +Todo source route. The guard detects nonempty bytes without treating malformed +content as empty. The prescribed recovery preserves the file and inspects or +exports it with a compatible older release before deliberate removal of its +active binding/file. There is no automatic replay, deletion or Markdown +substitution. Empty/absent files contain no event-owned Todos. Current canonical +reads remain provider-owned and do not import stale audit files. +[Retirement guard](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/goals/legacy_event_source.py), +[retirement document](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/docs/architecture/rfcs/ledger/shared-goal-authority-state-provider-v0/2026-09-25-todo-event-retirement.md) + +**Test:** read/write selectors refuse without changing original state/event +bytes; completion requires canonical authority before validation effects. A +retired source makes that Goal unavailable and the Todo index incomplete while +healthy Goals remain visible. Historical rollout records cannot fill the gap. +[Refusal and portfolio cases](https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane/test_retired_todo_event_source.py#L52-L188) + +**Document:** the separate experimental supervisor receipt log explicitly leaves +the crash interval between an external host effect and its receipt unresolved. +**Deduction from the inspected accounting code:** quota receipt repair only +reconstructs local accounting artifacts; it does not add fencing to that +external operation. If an external effect happened and the receipt is missing, +an automatic retry can duplicate the effect. Resolve it using that operation's +own identity/readback and authorization contract; do not infer success or safe +re-execution from a local lookup miss. + +Local accounting idempotency, correct Goal admission and bounded next-action +selection establish neither external exactly-once execution nor a supplier-side +hard cost cap. The readset does not qualify provider backends, distributed +leases, all controller overlays, runtime integration, performance or agent +benefit. It introduces no executor, database, migration or automatic retry. diff --git a/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/source-ledger.json b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/source-ledger.json new file mode 100644 index 000000000..bb5dda691 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/loopx-goal-governance/source-ledger.json @@ -0,0 +1,337 @@ +{ + "status": "candidate", + "origin": "source-derived", + "empirical_validation": "not_run", + "agent_efficacy": "not_evaluated", + "source": { + "type": "repository", + "repository": "loopx-project/loopx", + "url": "https://github.com/loopx-project/loopx", + "commit": "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9", + "tree": "c2ce33feec908b70c3b582119c5d1fadbc038a16", + "inspected_on": "2026-10-26", + "access": "Original raw file bytes at the fixed commit, checked against the Git tree blob identities; no source installation or execution.", + "license": "Apache-2.0", + "notice": "NOTICE credits LoopX contributors and creator huangruiteng and retains MIT history through v0.4.7." + }, + "scope": { + "governing_issue": "https://github.com/InferMatrixLab/InferRSI/issues/149", + "tracking_issue": "https://github.com/InferMatrixLab/InferRSI/issues/91", + "owner": "workflows/governance/rsi-evidence/references/loopx-goal-governance", + "related_historical_issue": "https://github.com/InferMatrixLab/InferRSI/issues/137", + "related_historical_commit_preserved": "a6f28057b49fe03bb234fa6ce1bac5d61df0c58f" + }, + "evidence_classes": { + "code": "Inspected source control flow, not reproduced runtime behavior.", + "document": "Pinned author-stated intent and limits.", + "test": "Inspected upstream assertions, not local test outcomes.", + "deduction": "Review guidance derived from the stated code/document boundary; not an observed incident.", + "discovery-only": "Actually inspected to locate the owner; excluded from mechanism support and coverage credit." + }, + "readset": [ + { + "path": "LICENSE", + "kind": "license", + "inspected_scope": "Full original bytes; Apache-2.0 terms.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/LICENSE", + "git_blob_sha": "d645695673349e3947e8e5ae42332d0ac3164cd7", + "sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30", + "bytes": 11358 + }, + { + "path": "NOTICE", + "kind": "notice", + "inspected_scope": "Full original bytes; creator/contributor attribution and through-v0.4.7 MIT history.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/NOTICE", + "git_blob_sha": "45a3556ecf5e5d6fc04755d5b94f22cd90428346", + "sha256": "3c3c36a40e1d65f3a6b20ec3a97319cb753e857f1d120f302cd828e107120f6d", + "bytes": 308 + }, + { + "path": "LICENSE-MIT", + "kind": "historical-license", + "inspected_scope": "Full original historical MIT text; not a license substitution for current source.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/LICENSE-MIT", + "git_blob_sha": "f5746a7eee9f275edd9b23f3ac1af27d02e9cd2d", + "sha256": "1df1cf519b9e5d8acbbc72820299d7aa95afa1acbfc1f43a15109ad1d59975f3", + "bytes": 1075 + }, + { + "path": "loopx/control_plane/quota/run_decision.ts", + "kind": "code", + "inspected_scope": "Complete file: typed fact decoding, ordered guards, action selection and returned patches.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/run_decision.ts", + "git_blob_sha": "751c96b2869724903dd0ee6bff3dc855d4f3d7db", + "sha256": "dfd6d391a8042b0eb2a538b11140dec6179b4ecfbe8244ef481f21a22e3b374a", + "bytes": 11418 + }, + { + "path": "loopx/control_plane/quota/decision_summary.py", + "kind": "code", + "inspected_scope": "Complete file: compact packet, Goal-scoped health, recommendation refinement, typed runtime adapter and patch merge.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/decision_summary.py", + "git_blob_sha": "8a279260ea0428dabde1ae02f1239a8aab32fe36", + "sha256": "0d85de8174aeb23946917ee3a65a523dbe7f622c6d8e8cd57c316dfb430af737", + "bytes": 12469 + }, + { + "path": "loopx/control_plane/quota/spend_commit.ts", + "kind": "code", + "inspected_scope": "Lines 1-420 and 462-677, 787-931; identity/digest, validation, record, native replay, preview and commit. Payload rendering between these sections only located by symbol search.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/spend_commit.ts", + "git_blob_sha": "7a4f7eab4ad3a5c8be9af30c0fde2f1167b7699c", + "sha256": "626b38c6a101ff6653c7e6910939f579a86cfd196792cb664f3f625dfa0c32fc", + "bytes": 31263 + }, + { + "path": "docs/architecture/rfcs/ledger/shared-goal-authority-state-provider-v0/2026-09-25-todo-event-retirement.md", + "kind": "document", + "inspected_scope": "Complete retirement brief, compatibility/refusal, canonical versus legacy routes and separate supervisor external-effect limit.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/docs/architecture/rfcs/ledger/shared-goal-authority-state-provider-v0/2026-09-25-todo-event-retirement.md", + "git_blob_sha": "274866bf5b2640da8c1f5a6b544cfc26ec17a3fa", + "sha256": "b841e73af4466dad018fff880e38275c91a2315942dc91a7d23e453b885cead7", + "bytes": 3082 + }, + { + "path": "tests/control_plane/test_quota_run_decision.py", + "kind": "test", + "inspected_scope": "Complete file: Python adapter assertions, terminal fixture, ordered rules, inbox exception and source-number preservation.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane/test_quota_run_decision.py", + "git_blob_sha": "33481d70435682dd0eb4e63e5a2481bea72ae1eb", + "sha256": "0417ef3614bd7a6e4b9b461e846851c8ae02afab54a8ae08f3bc2b289321cf05", + "bytes": 12584 + }, + { + "path": "tests/control_plane/test_quota_decision_summary.py", + "kind": "test", + "inspected_scope": "Complete file: plan-item flattening only; not full decision coverage.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane/test_quota_decision_summary.py", + "git_blob_sha": "8e864cedec10d5d3e0994e225920745745d9dda6", + "sha256": "69bcbf4b346b2fe53823529ab4956ae3e8cbce0777811636d30ca88cb3895f01", + "bytes": 752 + }, + { + "path": "tests/control_plane/test_quota_spend_commit_runtime.py", + "kind": "test", + "inspected_scope": "Imports; lines 148-251 and 329-418; native typed facade, concurrent exact retries, complete preview retention, stale basis and boundary rejections. Other tests located by name only.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane/test_quota_spend_commit_runtime.py", + "git_blob_sha": "bfa94dbf83eb68a7c394913df613cfeaa49a74fd", + "sha256": "67ae3337c27a9aa5e9ad6af7397a20636de273fe38a808a9a4356acfae1d0bb0", + "bytes": 14649 + }, + { + "path": "tests/control_plane_ts/quota_run_decision.test.ts", + "kind": "test", + "inspected_scope": "Complete file: shared rule fixture, malformed facts and coordination route-hint assertions.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane_ts/quota_run_decision.test.ts", + "git_blob_sha": "dc6ec5c00cac0d7a0bb3ee26df2d0a0c7ba97021", + "sha256": "b6c1f0704ba7385d77448970707d3e3aa93647f6b057cb1fa59d5e9c91897aef", + "bytes": 2270 + }, + { + "path": "tests/control_plane_ts/quota_spend_commit.test.ts", + "kind": "test", + "inspected_scope": "Lines 236-344, 737-813 and 941-1103: preview/rejection, commit replay, conflicting versus unrelated identity, partial-artifact/tail repair, prefix/row conflict, CAS and concurrent retries. Other source/lock cases located by name, not used to qualify leases.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane_ts/quota_spend_commit.test.ts", + "git_blob_sha": "553c25ed95c4313b0cdef71c7957af7f614be6ca", + "sha256": "06eddc569b5cb26fc8d70379d24f91893f2420645cd6c6cdc57de86909329eb6", + "bytes": 35895 + }, + { + "path": "loopx/control_plane/quota/accounting_artifact_transaction.ts", + "kind": "code", + "inspected_scope": "Lines 1-125, 390-536 and 734-1044; receipt contract, identity/replay, missing/conflicting artifact checks, prefix/tail repair and local commit order. Receipt path-validation symbols located, not a complete security audit.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/accounting_artifact_transaction.ts", + "git_blob_sha": "576deb432329d000af1c00b8ec812b8662f2c2d5", + "sha256": "821545fd7ef4e1c1e4b75af506c8a52d312873919e3233c06570a33182ec7d6c", + "bytes": 34291 + }, + { + "path": "loopx/control_plane/quota/source_admission.ts", + "kind": "code", + "inspected_scope": "Complete file: alias versus exact GoalRef, admission pair, local lock-witness adoption, current-owner check and cleanup; underlying lock implementation excluded.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/source_admission.ts", + "git_blob_sha": "47526e2a75935f864a1699e0383e5bff3e194836", + "sha256": "6da4d0c619725233b283fc31168feada913a724ab5048eba52cca4641d26604d", + "bytes": 10857 + }, + { + "path": "loopx/control_plane/quota/accounting_admission.py", + "kind": "code", + "inspected_scope": "Complete file: Python exact-source/legacy admission and ordered local lock handoff; no distributed-lease qualification.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/accounting_admission.py", + "git_blob_sha": "3ea97a9eead60c6db37e0ff3be0d78cacc86f3cc", + "sha256": "3f687091fa2ffe41f5e0d528b7e2e330c0ae07109302773a2fdebbb8c2f8952a", + "bytes": 3696 + }, + { + "path": "tests/control_plane_ts/fixtures/quota_run_decision.json", + "kind": "test-fixture", + "inspected_scope": "Base facts/results, cases through replan/terminal/inbox plus closed-lane cases; all case names inspected. This is a shared expected-rule fixture, not a local result.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane_ts/fixtures/quota_run_decision.json", + "git_blob_sha": "9e81c71c503e348f647f3bc77556ef4dc9a1e9f0", + "sha256": "7a5861021f2e8eda8f3f7c70d452a54b09aeeef171ab91c309d780b30ac457fb", + "bytes": 14721 + }, + { + "path": "tests/control_plane/test_retired_todo_event_source.py", + "kind": "test", + "inspected_scope": "Lines 1-188 and 229-326; audit cannot override current status, nonempty/empty event sources, validation-before-authority refusal, scoped portfolio incompleteness, canonical provider loss/restoration. HTTP case located but not read in full.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/tests/control_plane/test_retired_todo_event_source.py", + "git_blob_sha": "3cf34c9a38bd74817780fa24fc8c5cfd3a8a1f3c", + "sha256": "0cef96cc0df93a6cf69326968c0cac3e42fbec9f137dad8d49b8338a38cba236", + "bytes": 17707 + }, + { + "path": "loopx/cli_commands/todo_event.py", + "kind": "discovery-only", + "inspected_scope": "First 95 lines: error/audit logging helper; not the retired Todo source authority. Excluded from mechanism support.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/cli_commands/todo_event.py", + "git_blob_sha": "d59260d6980c35f423504b1b545e7e9a27a94bfd", + "sha256": "01d8a86e0820c967a43920cd9dea462aa35365e555d9046eebb948eb6df799fd", + "bytes": 7397 + }, + { + "path": "loopx/control_plane/todos/update_source.py", + "kind": "discovery-only", + "inspected_scope": "Complete small snapshot helper inspected during caller discovery; not a provider authority or write protocol. Excluded from mechanism support.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/todos/update_source.py", + "git_blob_sha": "2bafe1f0345b48ad54073f4c274808831177e00d", + "sha256": "0f0d37f3d333008f6f6068cc5f44cc7cf4a270724090daf93827377c55fdb8c4", + "bytes": 1380 + }, + { + "path": "loopx/control_plane/quota/should_run.py", + "kind": "code", + "inspected_scope": "Missing-state health guidance at lines 507-543; relevant action/health and acceptance guard search contexts only. Not a complete controller/overlay readset.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/should_run.py", + "git_blob_sha": "21ebc67e262e7fc24ba3ef3073c0b98a48d39543", + "sha256": "ebadbec6276a764e6d2dd42e8c84fa87710fb0872168fc257b459009581b4c5d", + "bytes": 28948 + }, + { + "path": "loopx/control_plane/quota/should_run_prepare.py", + "kind": "code", + "inspected_scope": "Source-selection/capability/receipt-resume search contexts and lines 731-840 only; source facts have separate preparation and receipt resume does not grant new work. Rest excluded.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/should_run_prepare.py", + "git_blob_sha": "fdb68941165252e9999d20d153cb220ca40afc05", + "sha256": "37f1c3673882b67f89675187d08ea83170f29d5ccd291fa63ffdca18f5ade523", + "bytes": 41168 + }, + { + "path": "loopx/control_plane/quota/spend_commit.py", + "kind": "code", + "inspected_scope": "Complete file: complete preview request, typed result/error adapter, native replay, execution index basis and lock/admission owner.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/spend_commit.py", + "git_blob_sha": "5ddc370ba6fcea4ecf0c9f416eaab0ae3da97d23", + "sha256": "8b5f2a8a38f7090d3a306bb0b436e2b154cf17c687b1b70ab3d6a9d0b17eb68d", + "bytes": 11986 + }, + { + "path": "loopx/control_plane/goals/shared_goal_work_source.py", + "kind": "code", + "inspected_scope": "Complete file: read Todos and leases at one canonical provider basis, no state-text work fallback.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/goals/shared_goal_work_source.py", + "git_blob_sha": "04c3583385e9058328455ea5c6f59ef1e6fdcabf", + "sha256": "0b3b92d8ce7e22a8080ef6a7f17ddfebbb60019a8508d21e70fcaf46386f6859", + "bytes": 2386 + }, + { + "path": "loopx/control_plane/goals/legacy_event_source.py", + "kind": "code", + "inspected_scope": "Complete file: three retired aliases plus adjacent events.jsonl, nonempty-byte refusal and preservation guidance.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/goals/legacy_event_source.py", + "git_blob_sha": "59f06883bd5af9574fff1d21c82a7d8b09aa1589", + "sha256": "e4fd7bd6d28cc53a1bcc6587cf2a2b687c71472ab0fb2adbd8b93baead0b5084", + "bytes": 1592 + }, + { + "path": "loopx/control_plane/coordination/local_authority.py", + "kind": "code", + "inspected_scope": "Lines 245-445: canonical-read validation, no Markdown fallback, incomplete/failed source rejection, request-local snapshot scope and canonical display adaptation.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/coordination/local_authority.py", + "git_blob_sha": "b4f88c5f5de73b0c90a95ea0b86cec9e3290886c", + "sha256": "1b50a7d0db7b68384c3f10fef04f9fa4e316d8d0dbc0b55dae013077e61309b8", + "bytes": 18321 + }, + { + "path": "loopx/control_plane/coordination/authority_source.ts", + "kind": "code", + "inspected_scope": "Complete file: registry source byte witness and its explicit non-grant/non-transaction boundary.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/coordination/authority_source.ts", + "git_blob_sha": "2779466d3281de25b131f77037091d10a4c8baec", + "sha256": "7c516799c4be782a0baf9d71ed28b14fa40f50937f8d49c29bb6a3b58470806c", + "bytes": 2080 + }, + { + "path": "loopx/control_plane/coordination/local_authority_read.ts", + "kind": "code", + "inspected_scope": "listLocalCoordinationTodos, lines 292-354; selected provider head and returned source/revision/no-fallback facts. Other functions located by symbols only.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/coordination/local_authority_read.ts", + "git_blob_sha": "f76cddd6ecef3b7bf59608c4e42109a49f8b8a3c", + "sha256": "2b06eaf17a72a96b867619e84376ac5625c26fb7772a350081a4117e31c57887", + "bytes": 18388 + }, + { + "path": "loopx/control_plane/coordination/local_authority_provider.ts", + "kind": "code", + "inspected_scope": "Provider declarations and lines 218-325; missing selector does not redirect initialized SQLite authority, selected provider seam. Backend implementations excluded.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/coordination/local_authority_provider.ts", + "git_blob_sha": "50007652797e69897428112dbabe5580c0473b07", + "sha256": "020b3bbc0807787d8eec1f2fd4a7d1ad5774aa3ac182fab3a9d2d68e3c73dd8e", + "bytes": 17350 + }, + { + "path": "loopx/control_plane/effect_runtime.py", + "kind": "code", + "inspected_scope": "Managed Node/TypeScript path/start/request/result boundaries by search context, including lines 1274-1372. No runtime execution or lifecycle qualification.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/effect_runtime.py", + "git_blob_sha": "fea81a4694d81ab1fa9f7d6935d92a3f7e3a61c9", + "sha256": "a1f4f49f433f8587afaaeffa40c64945d6fc4c69a43b00a71acd06a6d051b4d0", + "bytes": 59173 + }, + { + "path": "loopx/control_plane/quota/goal_boundary.py", + "kind": "discovery-only", + "inspected_scope": "Goal boundary/capability declarations located and source sampled; not the missing-state health owner. Excluded from mechanism support.", + "url": "https://github.com/loopx-project/loopx/blob/f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9/loopx/control_plane/quota/goal_boundary.py", + "git_blob_sha": "4e8f18adab4026773f68933f33ad961e652d1311", + "sha256": "dbce5a542287def0c4efe1f01ad76874df3a1be3013c2d0b4ebf210f29fa7872", + "bytes": 19235 + } + ], + "preserved_originals": [ + { + "source_path": "LICENSE", + "resource": "LICENSE", + "sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30", + "bytes": 11358 + }, + { + "source_path": "NOTICE", + "resource": "NOTICE.md", + "sha256": "3c3c36a40e1d65f3a6b20ec3a97319cb753e857f1d120f302cd828e107120f6d", + "bytes": 308 + }, + { + "source_path": "LICENSE-MIT", + "resource": "LICENSE-MIT.md", + "sha256": "1df1cf519b9e5d8acbbc72820299d7aa95afa1acbfc1f43a15109ad1d59975f3", + "bytes": 1075 + } + ], + "exclusions": [ + "Most of the repository, UI, host adapters and complete quota controller/receipt overlays.", + "Storage/provider implementations, provider capacity/soak behavior and distributed lease correctness.", + "Full terminal/frontier derivation implementation; terminal evidence shape is inspected in the adapter/tests.", + "Supervisor runtime implementation; only the retirement document's separate external-effect boundary is used.", + "Source installation, native LoopX tests, external provider effects/billing, agent trials, model/device/quality/performance validation.", + "vLLM adoption reports are not used as causal performance or efficacy evidence." + ], + "limitations": [ + "Original-byte identity authenticates file contents, not full-file semantic review; inspected_scope states the actual readset.", + "Python source preparation and TypeScript decisions/accounting remain distinct; no pure Python quota kernel is extracted.", + "Local accounting idempotency and repair do not establish external exactly-once execution or supplier hard cost ceilings.", + "This candidate does not implement InferRSI goal checkpoints or promote the inherited owner." + ] +} diff --git a/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/omni-experiments.md b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/omni-experiments.md new file mode 100644 index 000000000..40a8e8a72 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/rsi-evidence/references/omni-experiments.md @@ -0,0 +1,99 @@ +# Qualifying Omni optimization experiments + +Use this protocol when a multimodal pipeline has feedback, stochastic audio +sampling, internal graphs, or stateful streaming. Freeze selected checks and +quality tolerances in the acceptance issue and `plan/` before searching. This +adds no default hardware job or model-specific threshold. + +## Reference and preflight + +- Map per-step feedback before splitting stages: a depth head whose output feeds + the next temporal step may need to stay in the same AR stage. Module names do + not establish process boundaries. +- Pin reference code/checkpoint, dependency versions, dtype, attention backend, + buffer construction device, and cast/move order. Nonpersistent rotary buffers + can differ despite identical weights. Match per-request RNG device, random + operation order/shapes and reveal schedule, not just a seed. Locate the first + divergent token/frame before relaxing tolerances. Isolate reference packages + when serving requires a different supported dependency range. +- Compare full decode with reference full decode, and streaming with reference + streaming under the same codec chunk schedule. Measure the reference's own + full/stream difference separately; it cannot excuse additional integration + error. Keep transport chunk coalescing from silently changing decoder shapes. +- Inventory outer and internal graph switches, effective backend, capture, + replay and fallback. An outer eager flag may leave component graphs enabled. +- Preflight the benchmark consumer with metadata-only, empty-final and coalesced + payloads. Count first audio only on nonempty samples while preserving completion + events. Distinguish text-end, audio-end and request-end; verify flush and abort + cleanup. Preserve processor signatures when adding diagnostic wrappers. +- Validate mixed prompts, seeds and lengths concurrently, cancellation followed + by a new request, and the campaign's accuracy dataset. Repeating one prompt + or matching a few fixtures does not replace these checks. + +## Executable trial qualification + +Select adapter-produced boolean fields with repeatable CLI options, for example: + +```text +--require-trial-check evidence.requests_complete +--require-trial-check evidence.workers_closed +--require-trial-check evidence.graph_controls_verified +``` + +Use the same flags for `inferrsi plan` and `inferrsi run`. They are frozen as +`required_trial_checks` in `run.lock.json`. Each baseline and candidate benchmark +command writes its normal metric plus the selected fields to `{result}` (or +`INFERRSI_RESULT_PATH`), for example: + +```json +{ + "metrics": {"latency_ms": 100}, + "evidence": { + "requests_complete": true, + "workers_closed": true, + "graph_controls_verified": true + } +} +``` + +These are illustrative adapter-defined keys, not built-in hardware probes. Derive +fields from actual request counts, worker exit receipts, and effective graph +controls; keep the underlying receipts in the trial's output directory. Emit +completion only after checking worker exits. Process exit zero, lack of an error +message, or executor-forced cleanup does not establish normal worker shutdown. +Never hardcode `true` to obtain a verdict. + +The harness snapshots only selected boolean fields into each `execution.json`. +Literal `true` is required on every measured trial, on both arms. Missing, +unreadable, non-boolean or false values make the comparison `INCONCLUSIVE` and +leave `improvement_pct` unset; raw metrics remain available for diagnosis. +Qualification describes completeness and comparability, not an accuracy score: +quality rejection still belongs to the explicit validation command and its frozen +gates. A completed quality rejection remains `FAIL` when evidence is otherwise +complete. No selected checks preserves the existing command contract; it does +not imply lifecycle or graph qualification. Adapter attestations do not replace +independent validation, source integrity, L3 quality or L4 service evidence. + +## Comparable experiments and repair + +Use the site's reservation mechanism on shared devices (such as `npu run` where +provided). Freeze device allocation, workload and software, including CANN, +torch-npu and vllm-ascend for Ascend. Record contention and graph/backend settings; +CUDA tooling and MPS are platform-specific. Use portable device labels in shared +artifacts and keep private machine addresses out of logs. + +Retain the common AB/BA loop. Report independent process repetitions separately +from requests within each process. Warm up before steady-state measurements; +report startup/capture costs separately when relevant. A new model unsupported +on upstream main needs a clearly labelled integration-with-optimizations-off +control, not a fabricated main baseline. + +Retain failed and slow attempts. If a consumer or harness bug is repaired, start +a fresh complete comparison with new frozen commands/source/validator identities; +do not splice successful samples across attempts or rewrite old evidence. A +receipt failure does not automatically retry commands or reserve more hardware. + +Skipping multimodal memory profiling can help diagnosis but cannot qualify +deployment capacity. Exercise normal profiling at declared modality limits and +headroom at target concurrency. Distinguish sampled device memory from allocator +peaks, component timing from service timing, and request success from clean exit. diff --git a/src/inferrsi/knowledge/atoms/workflows/skill-evolution-playbook.md b/src/inferrsi/knowledge/atoms/workflows/skill-evolution-playbook.md new file mode 100644 index 000000000..55135276c --- /dev/null +++ b/src/inferrsi/knowledge/atoms/workflows/skill-evolution-playbook.md @@ -0,0 +1,217 @@ +--- +name: skill-evolution-playbook +description: 'Practical design choices for evolving agent skills from execution traces: when one trajectory should update a skill, how conflicting lessons are handled, how negative evidence is preserved, how large an edit should be, and when skills should split or merge. Drawn from Trace2Skill and SkillOpt. Use when designing or operating a skill evolution pipeline. + + ' +metadata: + inferrsi: | + { + "tags": [ + "skill-evolution", + "trace2skill", + "skillopt", + "rsi" + ], + "status": "candidate", + "profile": "local-skill-v1", + "schema_version": 1, + "kind": "skill", + "origin": [ + "external" + ], + "empirical_validation": "not_run", + "applicability": { + "scope": "Design choices for evolving agent skills from execution traces, drawn from Trace2Skill and SkillOpt: when a trajectory should update a skill, how conflicting lessons are handled, how negative evidence is preserved, how large an edit should be and when skills split or merge; for designing or operating a skill evolution pipeline", + "prerequisites": "A final-test partition kept outside edit selection and the incumbent skill retained for rollback; changing a skill's scope first needs explicit review of its identity and consumers", + "input_contract": "Execution trajectories or trace IDs with the diagnosed causal failure and the successful behavior an amendment must preserve; the incumbent skill and its revision lineage; held-out evaluation results for candidate edits", + "produced_artifact": "A scoped case or amendment proposal, or a consolidated candidate edit, with rejection records and the versioned revision lineage; a candidate for independently evaluated acceptance, not a replacement decision or an efficacy claim", + "failure_modes": [ + "An anecdote, or agreement among analysts, is taken as efficacy", + "Consolidation output is treated as a replacement decision instead of a candidate awaiting independent acceptance", + "A tie or uncertain result is reported as improvement", + "A conflict is resolved by voting for whichever outcome appeared more often in the pool", + "A rejection is applied to every future use of an idea instead of the comparison it constrains", + "Paper-specific section counts or length budgets are used as universal defaults, or a skill is split on length alone", + "A stronger task solver is assumed to be a stronger improver, or replay rankings and private inner scores are read as outer generalization" + ], + "refusal_point": "Records a conflict that conditioning cannot resolve, where the same context produces different outcomes across runs, as INCONCLUSIVE and flags it for human review instead of choosing a lesson; claims no universal minimum trace count, paper-to-code equivalence or local efficacy" + }, + "recommendations": [ + "Condition a conflicting lesson on its context (when X, do A; when Y, avoid A) before choosing one side.", + "Store each rejection record with its evaluation evidence, outside the deployed task procedure, and give it a retirement condition.", + "Bound the target passage and intended behavior before editing, inspect the actual diff and preserve rollback state.", + "Prefer an amendment when the existing skill owns the workflow; create a new candidate only for a genuinely distinct capability." + ], + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Original typed source inventory is not normalized; retain source identities and limits in the procedure/readsets." + ], + "provenance_readsets": [], + "consumption_mode": "packaged", + "searchspace_not_applicable": "SKILL.md §§ When should one trajectory update a skill?, How large should a skill edit be?, and When should skills split or merge? govern skill-text evolution and held-out evaluation, not hardware-resource state or control." + } +--- + +# Skill Evolution Playbook + +Status: candidate. Repository-derived notes record Trace2Skill @ 3d0b52a +and SkillOpt @ 343db229; the earlier Trace2Skill attribution to 7e5a1d77 belongs +to LearningToCommit and does not establish that implementation's behavior. +The [reviewed paper ledgers](../npu-skill-factory/references/papers-20261015/references/readset.md) +keep Trace2Skill v5 and SkillOpt v2 separate from these repository pins. No +paper-to-code equivalence or local efficacy is established. + +## When should one trajectory update a skill? + +A single trajectory can motivate a scoped case or amendment proposal. Diagnose +its causal failure first and retain successful behavior the amendment must +preserve. Neither an anecdote nor agreement among analysts establishes efficacy. +No universal minimum trace count follows from these papers. + +Trace2Skill's reviewed paper describes evidence-pool analysis and consolidation; +SkillOpt separates proposal generation from independently evaluated acceptance. +Consolidation produces a coherent candidate, not a replacement decision. Keep +final-test partitions outside edit selection, check combined effects and +unrelated-success regressions, and retain the incumbent for rollback. A tie or +uncertain result must not be reported as improvement. + +See [Trace2Skill evidence](../npu-skill-factory/references/papers-20261015/references/trace2skill.md), +[SkillOpt evidence](../npu-skill-factory/references/papers-20261015/references/skillopt.md) +and [interaction counterexamples](../npu-skill-factory/references/papers-20261015/cases/methodology-counterexamples.md). + +## How are conflicting lessons handled? + +Two trajectories can encode contradictory lessons: one shows approach A works, +another shows approach A fails. + +**Trace2Skill's approach:** parallel multi-agent patch proposal followed by +hierarchical conflict-free consolidation. The `skill_evolver` agents each +propose section-level patches (`insert_after`, `replace_in_section`, +`add_section`, etc.); the consolidation step identifies conflicting edits to +the same section and resolves them through a separate consolidation model call. +Source: `skill_evolver/skill_evolving_agent.py`, `_SUPPORTED_PATCH_OPS` (historical code locator; pin attribution unresolved, not reverified). + +**Practical resolution strategies:** +1. **Context-condition the lesson.** If A works in context X but fails in + context Y, the skill should encode both as conditional: "When X, do A. + When Y, avoid A." This is better than choosing one and losing the other. +2. **Separate sections.** Conflicting lessons often target different conditions. + Add a "known failure modes" or "does not apply when" section rather than + overwriting the "procedure" section. +3. **Escalate to human review.** When the conflict cannot be resolved by + conditioning (the same context genuinely produces different outcomes across + runs), record it as INCONCLUSIVE and flag for human review. Do not resolve + by voting on whichever outcome appeared more often in the pool. + +## How is negative evidence preserved? + +**SkillOpt:** rejected candidate edits are stored in the staging area with +their evaluation result before being discarded. The staging state records +what was tried and why it was rejected. +Source: `skillopt_sleep/staging.py` @ 343db229. + +**Trace2Skill:** error traces are analyzed separately from success traces, and +both pools contribute to the consolidated edit. Error-driven evolution produces +failure-mode additions to the skill; success-driven evolution adds positive +procedure refinements. Neither is discarded. +Source: Trace2Skill `run_parallel_skill_evolution.py` (error traces) vs +`run_parallel_combined_skill_evolution.py` (combined success+error traces) (historical code locator; pin attribution unresolved, not reverified). + +**What to preserve in a rejection record:** +```yaml +rejected_edit: + proposed_change: + hypothesis: + held_out_result: + verdict: FAIL or INCONCLUSIVE + evidence_level: + context: + date: +``` + +A rejection record is editing context: keep incumbent/candidate identities, +target conditions, measured outcome, suspected cause and a retirement condition. +Store it with the corresponding evaluation evidence, outside the deployed task +procedure. Rejection constrains that comparison, not all future uses of an idea. +Protected guidance can be revised explicitly when its supporting evidence expires. + +## How large should a skill edit be? + +**SkillOpt's bounded edit:** modifications are restricted to specific sections +(`procedure`, `failure_modes`, `knowledge_sources`). The `clip.py` module +enforces a length budget: the candidate must not be substantially longer than +the current skill. The `revision.parent` field tracks the lineage so v0→v1→v2 +is reconstructible. +Source: `skillopt/optimizer/clip.py`, `skillopt/optimizer/skill.py` @ 343db229. + +**Trace2Skill's section-level patches:** edits target named sections with +specific operations. `replace_in_section` replaces content within a section, +`insert_after` adds content after a named anchor. Protected files (`LICENSE.txt`, +`recalc.py`) cannot be modified regardless of what the patch proposes. +Source: `skill_evolver/skill_evolving_agent.py` PROTECTED_FILES, PATCH_OPS (historical code locator; pin attribution unresolved, not reverified). + +**Practical size rule:** bound the target passage and intended behavior before +editing, inspect the actual diff, and preserve rollback state. Paper-specific +section counts and length budgets are not universal defaults. Changing a skill's +scope requires explicit review of its identity and consumers; consolidation or +splitting is justified by distinct workflows and observed interactions, not an +arbitrary word count. + +## When should skills split or merge? + +**Split a skill when:** +- The `procedure` has grown to cover two distinct workflows that rarely co-occur. + The signal: most trajectories use only the first half or only the second half, + rarely both. +- Two distinct `applicability` conditions consistently produce conflicting lesson + proposals. The conflict is structural, not resolvable by conditioning. +- Agents repeatedly need only a separable workflow with its own trigger and + evidence contract; length alone is not a split criterion. + +**Merge skills when:** +- Two skills consistently co-activate (every trajectory that uses skill A also + uses skill B, with little overlap with other skills). +- One skill's `procedure` duplicates a large portion of another's. +- The two skills' `applicability` conditions are indistinguishable in practice. + +**What to version when splitting:** +The original skill becomes deprecated (v_last) with a forward pointer to both +new skills. Both new skills start at v0 with `revision.parent = `. + +## Skill deepening vs skill creation + +Trace2Skill studies two modes: +- **Self-deepen:** start from an existing human-written skill; use traces to + refine procedure, add failure modes, and extend coverage. +- **Self-create:** start from a minimal draft (e.g., name + description only); + build up from error traces. + +Neither mode is universally superior. A relevant incumbent offers useful +structure, but model/harness-specific regressions and task-conditioning matter. +Prefer an amendment when the existing skill owns the workflow; create a new +candidate for a genuinely distinct capability. See the reviewed Trace2Skill v5 +ledger and its human-skill/small-model counterexample before claiming transfer. + +## Task solver and improver are different claims + +Use the [adaptation-interface records](../../../playbooks/planning/optimization-search-policy/references/papers-20261015/knowledge/adaptation-interfaces.md) +for Dream-RSI replay support, AIDE²'s separate inner/private/outer evaluation +boundaries and JitRL's candidate-scoring prerequisites. A stronger task-solving +agent is not automatically a stronger improver. The AIDE² improver comparison +remains inconclusive; later checkpoints can regress on individual held-out domains. +Replay rankings and private inner scores are not untouched outer generalization +evidence. These records enable no execution interface or persistent memory store. + +## What should be versioned? + +- The skill document itself (`SKILL.md`) at each accepted version. +- The trajectory pool or trace IDs that motivated each edit. +- The held-out evaluation result (metric before → after) for each accepted edit. +- Rejected candidates and their evaluation results. +- The `revision.parent` chain so the full lineage is reconstructible. + +What does NOT need to be versioned separately: +- The raw agent trajectories (store a reference/ID, not a full copy). +- Intermediate patch proposals that were not accepted. +- The evaluation harness configuration (that is versioned separately in the + benchmark/evidence tree). diff --git a/src/inferrsi/knowledge/compositions/draft-acceptance-issue.json b/src/inferrsi/knowledge/compositions/draft-acceptance-issue.json new file mode 100644 index 000000000..ad989d28f --- /dev/null +++ b/src/inferrsi/knowledge/compositions/draft-acceptance-issue.json @@ -0,0 +1,109 @@ +{ + "authority": "checkout", + "metadata": { + "id": "draft-acceptance-issue", + "kind": "skill", + "entrypoint": "workflows/governance/draft-acceptance-issue/SKILL.md", + "title": "Draft a campaign acceptance issue with checklist, RunSpec, evidence paths, and placeholders for baseline/candidate SHAs.", + "origin": [ + "first-party" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/draft-acceptance-issue/SKILL.md", + "sha256": "2c14533c067c51b9763f80a9df0bf5eb5acd398f4265790c57039fed96d4c497" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Opening a new acceptance campaign in an RSI-style repository, before any baseline or candidate run", + "prerequisites": "A chosen campaign subject and an empty evidence// tree copied from evidence/_template/; SHAs may still be placeholders", + "input_contract": "A campaign id of the form {model-or-scenario}/{device}x{count}, any user-supplied criteria or accepted plan, and available workload/baseline/calibration evidence for deriving missing targets", + "produced_artifact": "An acceptance issue body with campaign id, pinned baseline and candidate SHAs, RunSpec, criteria source and derivation including gaps and freeze authority, gates, evidence paths, initial verdict and a downstream citation blurb", + "failure_modes": [ + "Gates written after the search loop has already run", + "Campaign SHAs committed into recipes/, benchmarks/, skills or workflow defaults", + "PASS claimed without a validator/ freeze and a results/ rationale" + ], + "refusal_point": "Refuses to state a verdict other than INCONCLUSIVE while the validator freeze or results rationale is absent" + }, + "state": "candidate", + "limitations": [ + "Drafts an issue only; it freezes no gate and runs no measurement.", + "The placeholder SHA convention depends on the campaign owner filling them in later.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "required_resources": [ + "workflows/governance/draft-acceptance-issue/SKILL.md" + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "checkout:draft-acceptance-issue.original.navigation", + "revision": "sha256:ac98627b1dea3fd5eb68642d4c3c77efd78b3de7e9147fda45d90a0d9d27cfdf" + }, + "decision": { + "ref": "checkout:draft-acceptance-issue.original.decision", + "revision": "sha256:a66294ae6e9c9766cf38903b4c6c5c5b6f72ccde4ba3833fffe8dc38ceefcf34" + }, + "procedure": { + "ref": "checkout:draft-acceptance-issue.original.procedure", + "revision": "sha256:c4631e08a93c836f6f213bbc0988e79134f57cbab00d63a76a217a68332e5d40", + "requires": [ + "decision" + ] + }, + "original": { + "ref": "checkout:draft-acceptance-issue.original", + "revision": "sha256:ca10b80e39fe01a5ea57ccc6a3d834ec5f030f8cac79bc67f5ccd45cc1aa17ae" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "decision" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure" + ] + }, + "originals": { + "layer": "L3", + "required": [ + "original" + ] + } + } + } + }, + "directory_resources": { + "workflows/governance/draft-acceptance-issue/SKILL.md": "original" + } +} diff --git a/src/inferrsi/knowledge/compositions/repository-evolution-analysis.json b/src/inferrsi/knowledge/compositions/repository-evolution-analysis.json new file mode 100644 index 000000000..1ff7e00ed --- /dev/null +++ b/src/inferrsi/knowledge/compositions/repository-evolution-analysis.json @@ -0,0 +1,248 @@ +{ + "authority": "checkout", + "metadata": { + "id": "repository-evolution-analysis", + "kind": "skill", + "entrypoint": "workflows/research/repository-evolution-analysis/SKILL.md", + "title": "Analyze a repository's commit history to build a capability-evolution model: what the system can do, how it got there, and what patterns allow it to iterate quickly. Use to produce history-derived knowledge for agent skill conditioning, and to design temporal-split benchmarks for skill evaluation.\n", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/research/repository-evolution-analysis/SKILL.md", + "sha256": "0f48cc6a77b3ac861af698048be7c250c3ef5c225dc238b9a0e6d71208cbd93e" + }, + { + "url": "https://github.com/LearningToCommit/LearningToCommit", + "commit": "7e5a1d77", + "paths": [ + "data_construction/s1_scan_commits.py", + "data_construction/s3_tag.py", + "data_construction/s4_sample.py", + "data_construction/s5_build.py", + "modules/agent.py", + "modules/prompt_builder.py", + "modules/trajectory_to_md.py", + "system_prompts/solve_with_skill.txt", + "system_prompts/learn_reflect.txt", + "evaluation/pairwise_judge.py", + "evaluation/programmatic_metrics.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "77800032", + "paths": [ + "internal/", + "docs/" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "4b5d6d725fae3d8a263f6e43c707400e3765b84f", + "paths": [ + "internal/library/rtk.go", + "internal/library/rtk_upgrade.go", + "internal/proc/path_other.go", + "internal/proc/path_windows.go", + "internal/provider/install_windows.go" + ], + "type": "git", + "revision_precision": "full" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "9848a9062a65c49e074c09770dc7de73dd012bea", + "paths": [ + "internal/library/rtk.go", + "internal/library/rtk_upgrade.go", + "internal/proc/path_other.go", + "internal/proc/path_windows.go", + "internal/provider/install_windows.go", + "internal/library/rtk_path.go", + "internal/library/rtk_path_other.go", + "internal/library/rtk_path_windows.go", + "internal/library/rtk_path_test.go", + "internal/library/rtk_test.go", + "internal/library/rtk_upgrade_test.go", + "internal/library/library_test.go", + "internal/gui/library.go", + "internal/gui/assets/library.js", + "internal/gui/tests/library-rtk-path.test.cjs", + "library_cli.go", + "LICENSE" + ], + "type": "git", + "revision_precision": "full" + } + ], + "applicability": { + "scope": "any software repository with a recoverable git history", + "prerequisites": "git history access, optionally LearningToCommit-style benchmark for evaluation" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "The RTK transition is a learning example, not an independent heldout task; upstream tests were inspected, not executed.", + "Existing audit and synthetic KV comparison adapters are not a generic historical coding-task evaluator.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [ + { + "url": "https://github.com/LearningToCommit/LearningToCommit", + "commit": "7e5a1d77", + "paths": [ + "data_construction/s1_scan_commits.py", + "data_construction/s3_tag.py", + "data_construction/s4_sample.py", + "data_construction/s5_build.py", + "modules/agent.py", + "modules/prompt_builder.py", + "modules/trajectory_to_md.py", + "system_prompts/solve_with_skill.txt", + "system_prompts/learn_reflect.txt", + "evaluation/pairwise_judge.py", + "evaluation/programmatic_metrics.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "77800032", + "paths": [ + "internal/", + "docs/" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "4b5d6d725fae3d8a263f6e43c707400e3765b84f", + "paths": [ + "internal/library/rtk.go", + "internal/library/rtk_upgrade.go", + "internal/proc/path_other.go", + "internal/proc/path_windows.go", + "internal/provider/install_windows.go" + ], + "type": "git", + "revision_precision": "full" + }, + { + "url": "https://github.com/yetone/magpie", + "commit": "9848a9062a65c49e074c09770dc7de73dd012bea", + "paths": [ + "internal/library/rtk.go", + "internal/library/rtk_upgrade.go", + "internal/proc/path_other.go", + "internal/proc/path_windows.go", + "internal/provider/install_windows.go", + "internal/library/rtk_path.go", + "internal/library/rtk_path_other.go", + "internal/library/rtk_path_windows.go", + "internal/library/rtk_path_test.go", + "internal/library/rtk_test.go", + "internal/library/rtk_upgrade_test.go", + "internal/library/library_test.go", + "internal/gui/library.go", + "internal/gui/assets/library.js", + "internal/gui/tests/library-rtk-path.test.cjs", + "library_cli.go", + "LICENSE" + ], + "type": "git", + "revision_precision": "full" + } + ], + "empirical_validation": "not_run", + "required_resources": [ + "workflows/research/repository-evolution-analysis/SKILL.md", + "workflows/research/repository-evolution-analysis/references/capability-presence-audit.md", + "workflows/research/repository-evolution-analysis/references/rtk-consumer-path-transition.md" + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "checkout:repository-evolution-analysis.original.navigation", + "revision": "sha256:48f8a7deca581aa6517f0ddb6b02ddbdc0562d34dc243aafa82201b0736b1003" + }, + "decision": { + "ref": "checkout:repository-evolution-analysis.original.decision", + "revision": "sha256:9eacf6c23770465c9997a3bbc2679bcb91db5385e2122c4db8dc2e064cb840e0" + }, + "procedure": { + "ref": "checkout:repository-evolution-analysis.original.procedure", + "revision": "sha256:9384f41bb56baf15ebc692a82cc6c6f754593e9c90d8d1230b354d23861e3e5b", + "requires": [ + "decision" + ] + }, + "original": { + "ref": "checkout:repository-evolution-analysis.original", + "revision": "sha256:cd610034cfb37c854ad70e2f16ab17d24511dfe018f9cd8787543984bd8c0106" + }, + "capability-presence-audit": { + "ref": "checkout:repository-evolution-analysis.capability-presence-audit", + "revision": "sha256:ce7271af12488bb77a2309c1ddff44567f06c1cf03b3458b3d2a7bab178efe6f" + }, + "rtk-consumer-path-transition": { + "ref": "checkout:repository-evolution-analysis.rtk-consumer-path-transition", + "revision": "sha256:8fa3a2be27eba6edc3260bd2ac977176cb7b5ed4d5a80119f8a4b06f630cbe1b" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "decision" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure", + "rtk-consumer-path-transition" + ] + }, + "originals": { + "layer": "L3", + "required": [ + "original", + "capability-presence-audit", + "rtk-consumer-path-transition" + ] + } + } + } + }, + "directory_resources": { + "workflows/research/repository-evolution-analysis/SKILL.md": "original", + "workflows/research/repository-evolution-analysis/references/capability-presence-audit.md": "capability-presence-audit", + "workflows/research/repository-evolution-analysis/references/rtk-consumer-path-transition.md": "rtk-consumer-path-transition" + } +} diff --git a/src/inferrsi/knowledge/compositions/rsi-evidence.json b/src/inferrsi/knowledge/compositions/rsi-evidence.json new file mode 100644 index 000000000..7131076e9 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/rsi-evidence.json @@ -0,0 +1,168 @@ +{ + "authority": "checkout", + "metadata": { + "id": "rsi-evidence", + "kind": "skill", + "entrypoint": "workflows/governance/rsi-evidence/SKILL.md", + "title": "Guide agents to establish acceptance criteria, freeze and cite RSI evidence using plan/results/patch/validator paths and PASS/FAIL/INCONCLUSIVE verdicts.", + "origin": [ + "first-party" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/governance/rsi-evidence/SKILL.md", + "sha256": "5edd2bd544da050d2688f37c85ae6e7927eaee24af764e3c96b6cec04982990a" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Preparing acceptance criteria, documenting or reviewing an optimization campaign whose verdict will be cited downstream", + "prerequisites": "For preparation, the user requirements and available model/hardware/workload evidence; for verdicts, pinned baseline and candidate SHAs and an evidence tree under evidence//; conclusions about LoopX goal authority additionally need its governance reference", + "input_contract": "Campaign artifacts in plan/, results/, patch/ and validator/, plus the RunSpec that fixes repo x revision x backend x device x model x scenario", + "produced_artifact": "An evidence record that links paths instead of pasting metrics, and states exactly one of PASS, FAIL or INCONCLUSIVE with its rationale", + "failure_modes": [ + "Metrics pasted into an issue comment with no link to an evidence path", + "A verdict vocabulary outside PASS/FAIL/INCONCLUSIVE", + "PASS recorded on a cleanup or integrity-probe failure", + "Output reused across trials, aliased into a reference, or written outside its own trial directory", + "Source fingerprint taken over a directory overlap that excludes changed tracked files", + "Org-wide default SHAs assumed in a skill or CI instead of read from the acceptance issue" + ], + "refusal_point": "Refuses PASS when the validator freeze, the results rationale or the pinned SHAs are missing, and reports INCONCLUSIVE for that campaign instead" + }, + "state": "candidate", + "limitations": [ + "Documents evidence discipline; it performs no measurement and certifies no campaign.", + "The LoopX goal-governance reference is a source-derived candidate and adds no execution permission or empirical validation.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "required_resources": [ + "workflows/governance/rsi-evidence/SKILL.md", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/LICENSE", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/LICENSE-MIT.md", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/NOTICE.md", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/README.md", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/decision-cases.md", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/mechanisms.md", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/source-ledger.json", + "workflows/governance/rsi-evidence/references/omni-experiments.md" + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "checkout:rsi-evidence.original.navigation", + "revision": "sha256:600c6680f42d521eee9727f7aea197b6be3d669ae7e96337b5dcd45f7190079a" + }, + "decision": { + "ref": "checkout:rsi-evidence.original.decision", + "revision": "sha256:e6dfa4f199733096bddec10f7024c25c0b030065c09a21cb970653150abc4e0b" + }, + "procedure": { + "ref": "checkout:rsi-evidence.original.procedure", + "revision": "sha256:5d9ccfa49ac55d3855b7c6af41142be3371c57f7e72602217eb8b6efb4164307", + "requires": [ + "decision" + ] + }, + "original": { + "ref": "checkout:rsi-evidence.original", + "revision": "sha256:8f1f5835e75528adc8668a3b114b23b4270fb40e6deea596eb68dc8de8018df7" + }, + "license": { + "ref": "checkout:rsi-evidence.license", + "revision": "sha256:9e9faea75bf047ee5bbf25c0ba4d98c624d293425c54015b8f25969d9ea82e1a" + }, + "license-mit": { + "ref": "checkout:rsi-evidence.license-mit", + "revision": "sha256:21f15fa81cb5c361df0046d879f9615a2b5bb279c5be2e347662817cb60ad6e7" + }, + "notice": { + "ref": "checkout:rsi-evidence.notice", + "revision": "sha256:e8996f7f4f4b0280ae9c18f122fbd8534fca62a805577602622bf86586b153b7" + }, + "readme": { + "ref": "checkout:rsi-evidence.readme", + "revision": "sha256:e875756b5c56185ee85aeaa47efa830c7d2bdbd8703367a955b65dc68e4696e5" + }, + "decision-cases": { + "ref": "checkout:rsi-evidence.decision-cases", + "revision": "sha256:49e195212a299d9551a4d13b6d6ff6455d2b05053181ce491d0bb5de8f7389b7" + }, + "mechanisms": { + "ref": "checkout:rsi-evidence.mechanisms", + "revision": "sha256:77f19cd5b5c1888471a31080c45cf465ae6907f054dcf1f209ea5545bbbb6d9f" + }, + "source-ledger": { + "ref": "checkout:rsi-evidence.source-ledger", + "revision": "sha256:e5b5ffda7a73de20b30593ec591922b3f2f579cb9bb0e569488b0d5bb35d56b6" + }, + "omni-experiments": { + "ref": "checkout:rsi-evidence.omni-experiments", + "revision": "sha256:d9a3e28875876aa26b0d66700ddf9455b00807c9bb38b362eb33b173f1b79980" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "decision" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure" + ] + }, + "originals": { + "layer": "L3", + "required": [ + "original", + "license", + "license-mit", + "notice", + "readme", + "decision-cases", + "mechanisms", + "source-ledger", + "omni-experiments" + ] + } + } + } + }, + "directory_resources": { + "workflows/governance/rsi-evidence/SKILL.md": "original", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/LICENSE": "license", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/LICENSE-MIT.md": "license-mit", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/NOTICE.md": "notice", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/README.md": "readme", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/decision-cases.md": "decision-cases", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/mechanisms.md": "mechanisms", + "workflows/governance/rsi-evidence/references/loopx-goal-governance/source-ledger.json": "source-ledger", + "workflows/governance/rsi-evidence/references/omni-experiments.md": "omni-experiments" + } +} diff --git a/src/inferrsi/knowledge/compositions/skill-evolution-playbook.json b/src/inferrsi/knowledge/compositions/skill-evolution-playbook.json new file mode 100644 index 000000000..16df171ba --- /dev/null +++ b/src/inferrsi/knowledge/compositions/skill-evolution-playbook.json @@ -0,0 +1,113 @@ +{ + "authority": "checkout", + "metadata": { + "id": "skill-evolution-playbook", + "kind": "skill", + "entrypoint": "workflows/maintenance/skill-evolution-playbook/SKILL.md", + "title": "Practical design choices for evolving agent skills from execution traces: when one trajectory should update a skill, how conflicting lessons are handled, how negative evidence is preserved, how large an edit should be, and when skills should split or merge. Drawn from Trace2Skill and SkillOpt. Use when designing or operating a skill evolution pipeline.\n", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/workflows/maintenance/skill-evolution-playbook/SKILL.md", + "sha256": "f988a0569be93fec550da52484d22d970b0a6c31394ea463ad6ee40e0877ede6" + }, + { + "type": "unknown", + "note": "Legacy provenance remains in procedure/readsets" + } + ], + "applicability": { + "scope": "Design choices for evolving agent skills from execution traces, drawn from Trace2Skill and SkillOpt: when a trajectory should update a skill, how conflicting lessons are handled, how negative evidence is preserved, how large an edit should be and when skills split or merge; for designing or operating a skill evolution pipeline", + "prerequisites": "A final-test partition kept outside edit selection and the incumbent skill retained for rollback; changing a skill's scope first needs explicit review of its identity and consumers", + "input_contract": "Execution trajectories or trace IDs with the diagnosed causal failure and the successful behavior an amendment must preserve; the incumbent skill and its revision lineage; held-out evaluation results for candidate edits", + "produced_artifact": "A scoped case or amendment proposal, or a consolidated candidate edit, with rejection records and the versioned revision lineage; a candidate for independently evaluated acceptance, not a replacement decision or an efficacy claim", + "failure_modes": [ + "An anecdote, or agreement among analysts, is taken as efficacy", + "Consolidation output is treated as a replacement decision instead of a candidate awaiting independent acceptance", + "A tie or uncertain result is reported as improvement", + "A conflict is resolved by voting for whichever outcome appeared more often in the pool", + "A rejection is applied to every future use of an idea instead of the comparison it constrains", + "Paper-specific section counts or length budgets are used as universal defaults, or a skill is split on length alone", + "A stronger task solver is assumed to be a stronger improver, or replay rankings and private inner scores are read as outer generalization" + ], + "refusal_point": "Records a conflict that conditioning cannot resolve, where the same context produces different outcomes across runs, as INCONCLUSIVE and flags it for human review instead of choosing a lesson; claims no universal minimum trace count, paper-to-code equivalence or local efficacy" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Original typed source inventory is not normalized; retain source identities and limits in the procedure/readsets.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [], + "empirical_validation": "not_run", + "required_resources": [ + "workflows/maintenance/skill-evolution-playbook/SKILL.md" + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "checkout:skill-evolution-playbook.original.navigation", + "revision": "sha256:71c75dd0054b9ae8dfc152c1104c992a6a398d52c8d2d6b3eee84cf8ad1e97d4" + }, + "decision": { + "ref": "checkout:skill-evolution-playbook.original.decision", + "revision": "sha256:72c952b6f4153775d65cda7160a153ee00c449c0049bd6d8d535f5c6f704b769" + }, + "procedure": { + "ref": "checkout:skill-evolution-playbook.original.procedure", + "revision": "sha256:1bb67a476f20d6d15675bc24088a780b79e0c2a9e96e28885c0af86af11e5d93", + "requires": [ + "decision" + ] + }, + "original": { + "ref": "checkout:skill-evolution-playbook.original", + "revision": "sha256:c527116d08710c491fdcb143dbfcb3615b3857255c76c58d9287b56349bd749d" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "decision" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure" + ] + }, + "originals": { + "layer": "L3", + "required": [ + "original" + ] + } + } + } + }, + "directory_resources": { + "workflows/maintenance/skill-evolution-playbook/SKILL.md": "original" + } +} diff --git a/tests/knowledge/test_atomic_workflows.py b/tests/knowledge/test_atomic_workflows.py index 7420cdd7b..02b49f6eb 100644 --- a/tests/knowledge/test_atomic_workflows.py +++ b/tests/knowledge/test_atomic_workflows.py @@ -11,23 +11,23 @@ from inferrsi.knowledge.catalog import _skill_search_source from inferrsi.knowledge.decision_cards import DecisionSource from tests.knowledge.test_atomic_casebooks import assert_empty, canonical, digest, select -from tests.knowledge.test_atomic_generation import RELEASE_ROOT, make_author_root +from tests.knowledge.test_atomic_generation import RELEASE_ROOT, make_author_root, write_json from tests.knowledge.test_atomic_reader import allow FIXTURE = Path(__file__).resolve().parents[1] / "fixtures/atomic-reader/workflow-domain-v0.3.4.json" RELEASE = json.loads(FIXTURE.read_bytes()) KNOWLEDGE = FIXTURE.parents[3] / "src/inferrsi/knowledge" GUIDES = ("cite-check-downstream-pr", "claim-contract", "competitor-scan", "npu-skill-factory") +LINKED_GUIDES = ("draft-acceptance-issue", "repository-evolution-analysis", "rsi-evidence", + "skill-evolution-playbook") LIBRARY = "src/inferrsi/knowledge/data/skill_library/" -@pytest.fixture(scope="module") -def workflow_installation(tmp_path_factory): - root = tmp_path_factory.mktemp("workflows") +def workflow_sources(root, names): author = make_author_root(root) pinned = root / "release" shutil.copytree(RELEASE_ROOT, pinned) - for name in GUIDES: + for name in names: row = RELEASE["refs"]["checkout:" + name] composition = Path("compositions", name + ".json") shutil.copyfile(KNOWLEDGE / composition, author / composition) @@ -50,28 +50,38 @@ def workflow_installation(tmp_path_factory): original = pinned / (LIBRARY + path) original.parent.mkdir(parents=True, exist_ok=True) original.write_bytes(data) + return author, pinned + + +@pytest.fixture(scope="module") +def workflow_installation(tmp_path_factory): + root = tmp_path_factory.mktemp("workflows") + author, pinned = workflow_sources(root, (*GUIDES, *LINKED_GUIDES)) target = root / "installed" generation = build_generation(author, target, permits=allow, source_roots={RELEASE["source_commit"]: pinned}) return InstalledGeneration(target, expected=generation), target -@pytest.mark.parametrize("name", GUIDES) -def test_checkout_host_and_layered_selection_preserve_workflow_guide(workflow_installation, name): +@pytest.mark.parametrize("name", (*GUIDES, *LINKED_GUIDES)) +def test_checkout_layered_selection_preserves_workflow_guide(workflow_installation, name): installed, target = workflow_installation ref = "checkout:" + name row = RELEASE["refs"][ref] guide = row["entry_source"] - assert installed.skills[name] == ref revision = installed.catalog[ref]["revision"] _, bundle = installed.read_resolved(ref, revision=revision) - host = target / "skills" / name - raw = (host / "SKILL.md").read_bytes() - directory = PurePosixPath(guide).parent - files = {(directory / p.relative_to(host).as_posix()).as_posix(): p.read_bytes() - for p in host.rglob("*") if p.is_file()} + files = bundle.content + raw = files[guide] assert {path: digest(data) for path, data in files.items()} == row["required_resources"] - assert bundle.content == files and bundle.dependencies == row["dependencies"] == {} + assert bundle.dependencies == row["dependencies"] + if name in GUIDES or name in installed.skills: + assert installed.skills[name] == ref + host = target / "skills" / name + directory = PurePosixPath(guide).parent + exported = {(directory / p.relative_to(host).as_posix()).as_posix(): p.read_bytes() + for p in host.rglob("*") if p.is_file()} + assert exported == files assert bundle.metadata["required_resources"] == sorted(files) assert digest(raw) == row["entry_sha256"] == row["guide_sha256"] assert digest(canonical(bundle.view()["resources"])) == row["resource_set"] @@ -93,7 +103,9 @@ def test_checkout_host_and_layered_selection_preserve_workflow_guide(workflow_in assert item["source"]["commit"] == RELEASE["source_commit"] path = item["source_path"].removeprefix(LIBRARY) assert item["source_path"] == LIBRARY + path - if layer != "L3": + if layer == "L2": + assert path == guide or path in row["dependencies"] + elif layer != "L3": assert path == guide assert item["source_range_verification"] == "verified_at_build" assert body == files[path][lo:hi] and digest(body) == item["source_sha256"] @@ -115,8 +127,12 @@ def test_checkout_host_and_layered_selection_preserve_workflow_guide(workflow_in assert digest(canonical(compared)) == row["card_sha256"] assert len(canonical(compared)) == row["card_bytes"] assert compared["status"] == row["status"] == "partial" - assert compared["missing_fields"] == row["missing_fields"] == ["validation"] - assert results["L2"][0] == decision and b"".join(results["L2"]) == raw + assert compared["missing_fields"] == row["missing_fields"] + assert "validation" in compared["missing_fields"] + assert results["L2"][0] == decision and b"".join(results["L2"][:2]) == raw + assert results["L2"][2:] == tuple(files[path] for path in row["dependencies"]) + for path, revision in row["dependencies"].items(): + assert revision == "sha256:" + digest(files[path]) assert results["L3"] == tuple(files[path] for path in sorted(files)) @@ -168,3 +184,80 @@ def test_package_baseline_has_its_own_card_and_shared_dependency(workflow_instal assert row["card_sha256"] != checkout["card_sha256"] short = old.project(max_bytes=row["card_bytes"] - 1) assert short["status"] == "over_budget" and "card" not in short + + +def test_loopx_originals_keep_upstream_terms_and_attribution(workflow_installation): + installed, _ = workflow_installation + ref = "checkout:rsi-evidence" + _, bundle = installed.read_resolved(ref, revision=installed.catalog[ref]["revision"]) + ledger_path = next(path for path in bundle.content if path.endswith("/source-ledger.json")) + ledger = json.loads(bundle.content[ledger_path]) + assert ledger["source"]["license"] == "Apache-2.0" + assert ledger["source"]["commit"] == "f094b2cfb2acde7a4a0d4d875bba52f64ac31ba9" + originals = {row["resource"]: row for row in ledger["preserved_originals"]} + assert originals.keys() == {"LICENSE", "LICENSE-MIT.md", "NOTICE.md"} + directory = PurePosixPath(ledger_path).parent + attached = {p: body for p, body in bundle.content.items() + if PurePosixPath(p).parent == directory} + assert len(attached) == 7 + for path, body in attached.items(): + filename = PurePosixPath(path) + atom_ref = ref + "." + filename.stem.lower() + revision = installed.catalog[atom_ref]["revision"] + _, atom = installed.read_resolved(atom_ref, revision=revision) + credit, = atom.metadata["attribution"] + assert credit["url"] == ledger["source"]["url"] + assert credit["commit"] == ledger["source"]["commit"] + assert credit in atom.metadata["sources"] + assert atom.metadata["empirical_validation"] == "not_run" + assert dict(atom.content) == {filename.name: body} + expected_license = "MIT" if filename.name == "LICENSE-MIT.md" else "Apache-2.0" + assert atom.metadata["atom"]["license"] == expected_license + if filename.name in originals: + old = originals[filename.name] + assert credit["path"] == old["source_path"] + assert credit["sha256"] == old["sha256"] == digest(body) + assert len(body) == old["bytes"] + + +@pytest.mark.parametrize(("change", "error"), [ + ("missing required guide", "L2 must deliver"), ("optional guide", "unconditional delivery"), + ("different attachment", "L2 must deliver"), ("undeclared extra", "L2 must deliver"), + ("unbound checkout", "requires checked"), ("unbound navigation", "requires checked"), + ("invented dependency revision", "source-declared dependencies"), + ("remove resource", "complete original directory"), +]) +def test_checkout_requires_the_released_dependency(tmp_path, change, error): + name = "repository-evolution-analysis" + author, pinned = workflow_sources(tmp_path, [name]) + path = author / "compositions" / (name + ".json") + spec = json.loads(path.read_bytes()) + meta = spec["metadata"] + route = meta["composition"]["routes"]["procedure"] + attachment = "rtk-consumer-path-transition" + original = next(p for p, node in spec["directory_resources"].items() if node == attachment) + if change == "missing required guide": + route["required"].remove(attachment) + elif change == "optional guide": + route["required"].remove(attachment) + route["optional"] = [attachment] + elif change == "different attachment": + route["required"] = ["procedure", "capability-presence-audit"] + elif change == "undeclared extra": + route["required"].append("capability-presence-audit") + elif change.startswith("unbound"): + del spec["directory_resources"] + if change == "unbound navigation": + del meta["entrypoint"] + del meta["required_resources"] + elif change == "invented dependency revision": + spec["dependencies"] = {original: "sha256:" + "0" * 64} + else: + del spec["directory_resources"][original] + meta["required_resources"].remove(original) + write_json(path, spec) + target = tmp_path / "installed" + with pytest.raises(ValueError, match=error): + build_generation(author, target, permits=allow, + source_roots={RELEASE["source_commit"]: pinned}) + assert not target.exists()