@@ -4,8 +4,6 @@ import { readFile } from 'node:fs/promises';
44import { normalizeRegistry , readFallback } from '../scripts/fetch-skill-registry.mjs' ;
55import { createSkillRegistry } from '../src/assets/js/webmcp-registry.js' ;
66
7- // Usage: run with `npm test`; these checks verify registry provenance, the shared curated human/agent catalogue, current WebMCP Document API usage, click-driven human selection, explicit human handoff publication, and the visible remote MCP endpoint without requiring a WebMCP-capable test browser.
8-
97const BOOTSTRAP_SNAPSHOT_COMMIT = '260671303733a45c8f8d5563e41d8854e09856e6' ;
108const SNAPSHOT_PATH = 'src/_data/snapshots/skill-registry.last-known-good.json' ;
119
@@ -18,6 +16,7 @@ const sourceRegistry = JSON.stringify({
1816 { name : 'msdmd' , path : 'msdmd/SKILL.md' , kind : 'metadata-block' , description : 'foundational metadata convention' } ,
1917 { name : 'cap-build' , path : 'cap-build/SKILL.md' , kind : 'metadata-block' , depends_on : [ 'msdmd' ] , description : 'capability inventory' } ,
2018 { name : 'meta' , path : 'meta/SKILL.md' , kind : 'procedural' , description : 'METAPAT consultation router' } ,
19+ { name : 'fresh-making' , path : 'fresh-making/SKILL.md' , kind : 'procedural' , description : 'deterministic restoration of derived artifact consistency' } ,
2120 { name : 'repo-audit-repair' , path : 'repo-audit-repair/SKILL.md' , kind : 'procedural' , description : 'audit and repair a repository' }
2221 ]
2322} ) ;
@@ -64,32 +63,32 @@ test('committed or refreshed fallback snapshot is exact, usable, and retains sou
6463 assert . ok ( snapshot . skills . some ( skill => skill . name === 'repo-audit-repair' ) ) ;
6564} ) ;
6665
67- test ( 'public registry presents the same msdmd-plus- meta catalogue to human and agent surfaces ' , ( ) => {
66+ test ( 'public registry presents msdmd, meta, and fresh-making while hiding unrelated specialist skills ' , ( ) => {
6867 const registry = createSkillRegistry ( sampleProjection ( ) ) ;
69- assert . deepEqual ( registry . listSkills ( ) . map ( skill => skill . name ) , [ 'msdmd' , 'cap-build' , 'meta' ] ) ;
68+ assert . deepEqual ( registry . listSkills ( ) . map ( skill => skill . name ) , [ 'msdmd' , 'cap-build' , 'meta' , 'fresh-making' ] ) ;
7069 assert . equal ( registry . findSkills ( { query : 'audit repository' } ) . length , 0 ) ;
7170 assert . equal ( registry . findSkills ( { query : 'capability' } ) [ 0 ] . name , 'cap-build' ) ;
71+ assert . equal ( registry . findSkills ( { query : 'derived artifact' } ) [ 0 ] . name , 'fresh-making' ) ;
7272 assert . throws ( ( ) => registry . inspectSkill ( { name : 'repo-audit-repair' } ) , / u n k n o w n p u b l i c s k i l l / ) ;
7373
74- const closure = registry . resolveSkillClosure ( { name : 'cap-build' } ) ;
75- assert . deepEqual ( closure . map ( skill => skill . name ) , [ 'msdmd' , 'cap-build '] ) ;
74+ assert . deepEqual ( registry . resolveSkillClosure ( { name : 'cap-build' } ) . map ( skill => skill . name ) , [ 'msdmd' , 'cap-build' ] ) ;
75+ assert . deepEqual ( registry . resolveSkillClosure ( { name : 'fresh-making' } ) . map ( skill => skill . name ) , [ 'fresh-making ' ] ) ;
7676 const status = registry . getRegistryStatus ( ) ;
77- assert . equal ( status . skill_count , 3 ) ;
78- assert . equal ( status . source_skill_count , 4 ) ;
79- assert . equal ( status . public_scope , 'metadata-block plus meta' ) ;
77+ assert . equal ( status . skill_count , 4 ) ;
78+ assert . equal ( status . source_skill_count , 5 ) ;
79+ assert . equal ( status . public_scope , 'metadata-block plus meta plus fresh-making ' ) ;
8080} ) ;
8181
82- test ( 'WebMCP provider registers five base registry tools and one explicit dynamic handoff tool through document.modelContext ' , async ( ) => {
82+ test ( 'WebMCP provider registers five base registry tools and one explicit dynamic browser handoff ' , async ( ) => {
8383 const source = await readFile ( 'src/assets/js/webmcp.js' , 'utf8' ) ;
8484 for ( const name of [
8585 'tiw_registry_status' ,
8686 'tiw_list_skills' ,
8787 'tiw_find_skill' ,
8888 'tiw_inspect_skill' ,
8989 'tiw_resolve_skill_closure'
90- ] ) {
91- assert . match ( source , new RegExp ( `name: '${ name } '` ) ) ;
92- }
90+ ] ) assert . match ( source , new RegExp ( `name: '${ name } '` ) ) ;
91+
9392 assert . match ( source , / H A N D O F F _ T O O L _ N A M E = ' t i w _ h u m a n _ h a n d o f f ' / ) ;
9493 assert . match ( source , / n a m e : H A N D O F F _ T O O L _ N A M E / ) ;
9594 assert . equal ( ( source . match ( / a n n o t a t i o n s : \{ r e a d O n l y H i n t : t r u e / g) || [ ] ) . length , 6 ) ;
@@ -98,34 +97,36 @@ test('WebMCP provider registers five base registry tools and one explicit dynami
9897 assert . match ( source , / \{ s i g n a l : c o n t r o l l e r \. s i g n a l \} / ) ;
9998 assert . match ( source , / g l o b a l T h i s \. d o c u m e n t \? \. m o d e l C o n t e x t / ) ;
10099 assert . doesNotMatch ( source , / n a v i g a t o r \? \. m o d e l C o n t e x t | p r o v i d e C o n t e x t / ) ;
101- assert . doesNotMatch ( source , / i n s t a l l _ s k i l l | p r o p a g a t e _ s k i l l | u p d a t e _ f i l e | c r e a t e _ f i l e / ) ;
100+ assert . doesNotMatch ( source , / \/ h a n d o f f \/ | r e m o t e _ s e s s i o n | w r i t e K e y | i n s t a l l _ s k i l l | p r o p a g a t e _ s k i l l | u p d a t e _ f i l e | c r e a t e _ f i l e / ) ;
102101} ) ;
103102
104- test ( 'human selection carries exact registry identity without typed internal skill names ' , async ( ) => {
103+ test ( 'human selection carries exact skill and repository identity without typed machine identifiers ' , async ( ) => {
105104 const source = await readFile ( 'src/assets/js/webmcp.js' , 'utf8' ) ;
106- assert . match ( source , / b i n d H u m a n C a t a l o g u e \( r e g i s t r y \) / ) ;
107105 assert . match ( source , / d a t a s e t \. s k i l l N a m e / ) ;
108- assert . match ( source , / r e g i s t r y \. i n s p e c t S k i l l \( \{ n a m e \} \) / ) ;
106+ assert . match ( source , / d a t a - h u m a n - r e p o s i t o r y - t a r g e t / ) ;
107+ assert . match ( source , / d a t a s e t \. r e p o s i t o r y H e a d / ) ;
108+ assert . match ( source , / t a r g e t _ r e p o s i t o r y : r e p o s i t o r y / ) ;
109+ assert . match ( source , / o b s e r v e d _ h e a d _ s h a / ) ;
109110 assert . match ( source , / s e a r c h P a r a m s \. s e t \( ' s k i l l ' , s k i l l \. n a m e \) / ) ;
111+ assert . match ( source , / s e a r c h P a r a m s \. s e t \( ' r e p o ' , r e p o s i t o r y \. n a m e \) / ) ;
110112 assert . match ( source , / h i s t o r y \. r e p l a c e S t a t e / ) ;
111- assert . match ( source , / d a t a - s e l e c t e d - a c t i o n / ) ;
112113} ) ;
113114
114- test ( 'human handoff requires explicit submit and carries selected skill, closure, provenance, and human request without persistence ' , async ( ) => {
115+ test ( 'fresh-making supplies an editable default refresh request and still requires explicit Send ' , async ( ) => {
115116 const source = await readFile ( 'src/assets/js/webmcp.js' , 'utf8' ) ;
116- assert . match ( source , / d a t a - h u m a n - h a n d o f f - f o r m / ) ;
117+ assert . match ( source , / F R E S H _ M A K I N G _ I N T E N T / ) ;
118+ assert . match ( source , / n a m e = = = ' f r e s h - m a k i n g ' / ) ;
119+ assert . match ( source , / m i n i m a l a f f e c t e d c l o s u r e / ) ;
117120 assert . match ( source , / n e w F o r m D a t a \( e v e n t \. c u r r e n t T a r g e t \) \. g e t \( ' i n t e n t ' \) / ) ;
118121 assert . match ( source , / r e g i s t r y \. r e s o l v e S k i l l C l o s u r e \( \{ n a m e : s e l e c t e d N a m e \} \) / ) ;
119122 assert . match ( source , / h u m a n _ r e q u e s t : i n t e n t / ) ;
120- assert . match ( source , / r e m o t e _ m c p _ s t o r a g e : f a l s e / ) ;
123+ assert . match ( source , / r e p o s i t o r y _ w r i t e _ a u t h o r i t y : ' n o t g r a n t e d b y t h i s h a n d o f f ' / ) ;
121124 assert . match ( source , / p e r s i s t e n c e : ' p a g e s e s s i o n o n l y ' / ) ;
122125 assert . match ( source , / p u b l i s h H a n d o f f T o o l \( h a n d o f f \) / ) ;
123- assert . match ( source , / c l e a r P u b l i s h e d H a n d o f f \( ' R e q u e s t t e x t c h a n g e d / ) ;
124- assert . match ( source , / c l e a r P u b l i s h e d H a n d o f f \( ' S k i l l s e l e c t i o n c h a n g e d / ) ;
125126 assert . doesNotMatch ( source , / l o c a l S t o r a g e | s e s s i o n S t o r a g e | i n d e x e d D B / ) ;
126127} ) ;
127128
128- test ( 'dedicated WebMCP route presents collapsible click-select cards and one ordinary-language send box' , async ( ) => {
129+ test ( 'dedicated WebMCP route presents collapsible skill cards, every generated repo target, and one send box' , async ( ) => {
129130 const [ page , layout , packageJson ] = await Promise . all ( [
130131 readFile ( 'src/webmcp/index.njk' , 'utf8' ) ,
131132 readFile ( 'src/_includes/layouts/base.njk' , 'utf8' ) ,
@@ -134,22 +135,22 @@ test('dedicated WebMCP route presents collapsible click-select cards and one ord
134135 assert . match ( page , / p e r m a l i n k : \/ w e b m c p \/ / ) ;
135136 assert . match ( page , / w e b m c p : t r u e / ) ;
136137 assert . match ( page , / T h e p a g e i s t h e p r o v i d e r / ) ;
137- assert . match ( page , / h t t p s : \/ \/ t h e - i n t e r d e p e n d e n c y - m c p \. o n r e n d e r \. c o m \/ m c p / ) ;
138138 assert . match ( page , / s k i l l \. k i n d = = " m e t a d a t a - b l o c k " / ) ;
139139 assert . match ( page , / s k i l l \. n a m e = = " m e t a " / ) ;
140+ assert . match ( page , / s k i l l \. n a m e = = " f r e s h - m a k i n g " / ) ;
140141 assert . match ( page , / < d e t a i l s d a t a - s k i l l - d e s c r i p t i o n > / ) ;
141142 assert . match ( page , / < s u m m a r y > D e s c r i p t i o n < \/ s u m m a r y > / ) ;
142- assert . match ( page , / d a t a - s e l e c t - s k i l l / ) ;
143- assert . match ( page , / d a t a - s e l e c t e d - s k i l l / ) ;
144- assert . match ( page , / d a t a - s e l e c t e d - a c t i o n = " i n s p e c t " / ) ;
145- assert . match ( page , / d a t a - s e l e c t e d - a c t i o n = " c l o s u r e " / ) ;
143+ assert . match ( page , / g e n e r a t e d \. r e p o s \. r e p o s i t o r i e s / ) ;
144+ assert . match ( page , / d a t a - h u m a n - r e p o s i t o r y - t a r g e t / ) ;
145+ assert . match ( page , / d a t a - r e p o s i t o r y - h e a d = / ) ;
146+ assert . match ( page , / d a t a - s e l e c t e d - r e p o s i t o r y / ) ;
146147 assert . match ( page , / d a t a - h u m a n - h a n d o f f - f o r m / ) ;
147148 assert . match ( page , / < t e x t a r e a [ ^ > ] + d a t a - h u m a n - h a n d o f f - i n t e n t / ) ;
148149 assert . match ( page , / d a t a - h u m a n - h a n d o f f - s e n d d i s a b l e d / ) ;
149- assert . match ( page , / N o t h i n g i s s e n t m e r e l y b y t y p i n g / ) ;
150- assert . match ( page , / S e n d s e l e c t e d s k i l l \+ r e q u e s t t o a g e n t / ) ;
151- assert . doesNotMatch ( page , / d a t a - w e b m c p - f i n d | d a t a - w e b m c p - i n s p e c t | d a t a - w e b m c p - c l o s u r e / ) ;
152- assert . match ( page , / N o i n t e r n a l s k i l l n a m e n e e d s t o b e t y p e d / ) ;
150+ assert . match ( page , / N o t h i n g i s s e n t m e r e l y b y s e l e c t i n g o r t y p i n g / ) ;
151+ assert . match ( page , / S e n d s k i l l \+ r e p o s i t o r y \+ r e q u e s t t o a g e n t / ) ;
152+ assert . match ( page , / N o i n t e r n a l s k i l l o r r e p o s i t o r y i d e n t i f i e r n e e d s t o b e t y p e d / ) ;
153153 assert . match ( layout , / \{ % i f w e b m c p % \} < s c r i p t s r c = " \/ a s s e t s \/ j s \/ w e b m c p \. j s " t y p e = " m o d u l e " > < \/ s c r i p t > \{ % e n d i f % \} / ) ;
154+ assert . match ( packageJson , / " r e f r e s h : g i t h u b " : " n o d e s c r i p t s \/ f e t c h - g i t h u b - o r g \. m j s " / ) ;
154155 assert . match ( packageJson , / " r e f r e s h : s k i l l s " : " n o d e s c r i p t s \/ f e t c h - s k i l l - r e g i s t r y \. m j s " / ) ;
155156} ) ;
0 commit comments