@@ -14,7 +14,6 @@ import * as PstackPack from "./PstackPack.ts";
1414import * as ServerSettings from "../serverSettings.ts" ;
1515import { ProjectId , ProviderInstanceId , type ServerProvider } from "@t3tools/contracts" ;
1616import { claudeProvider , makeFixture } from "./PstackPack.testkit.ts" ;
17- import { BUILT_IN_DRIVERS } from "../provider/builtInDrivers.ts" ;
1817
1918it . layer ( NodeServices . layer ) ( "PstackPack" , ( it ) => {
2019 it . effect ( "resolves the development source beside the monorepo packages" , ( ) =>
@@ -76,6 +75,7 @@ it.layer(NodeServices.layer)("PstackPack", (it) => {
7675 assert . lengthOf ( catalog ! , 2 ) ;
7776 const packDir = `${ fixture . stateDir } /pstack/pack` ;
7877 assert . isFalse ( yield * fs . exists ( `${ packDir } /.gitignore` ) ) ;
78+ assert . isFalse ( yield * fs . exists ( `${ packDir } /docs/harness/t3-code.md` ) ) ;
7979 assert . equal (
8080 yield * fs . readFileString ( `${ packDir } /skills/poteto-mode/scripts/bun.lock` ) ,
8181 "lockfile\n" ,
@@ -114,17 +114,25 @@ it.layer(NodeServices.layer)("PstackPack", (it) => {
114114 return `${ fixture . stateDir } /pstack/pack` ;
115115 } ) . pipe ( Effect . provide ( fixture . layer ) ) ;
116116 assert . equal ( first , second ) ;
117- yield * fs . writeFileString ( `${ fixture . sourceRoot } /t3-code.md` , "Changed adapter" ) ;
117+ yield * fs . makeDirectory ( `${ first } /docs/harness` , { recursive : true } ) ;
118+ yield * fs . writeFileString ( `${ first } /docs/harness/t3-code.md` , "Legacy adapter" ) ;
119+ yield * fs . writeFileString (
120+ `${ fixture . sourceRoot } /upstream/scripts/helper.sh` ,
121+ "Changed helper" ,
122+ ) ;
123+ const manifest = yield * fs . readFileString ( `${ fixture . sourceRoot } /UPSTREAM.json` ) ;
124+ yield * fs . writeFileString (
125+ `${ fixture . sourceRoot } /UPSTREAM.json` ,
126+ manifest . replace ( "b" . repeat ( 40 ) , "d" . repeat ( 40 ) ) ,
127+ ) ;
118128 const changed = yield * Effect . gen ( function * ( ) {
119129 yield * ( yield * PstackPack . PstackPack ) . catalog ;
120130 return `${ fixture . stateDir } /pstack/pack` ;
121131 } ) . pipe ( Effect . provide ( fixture . layer ) ) ;
122132 assert . equal ( changed , first ) ;
123133 assert . equal ( changed , `${ fixture . stateDir } /pstack/pack` ) ;
124- assert . equal (
125- yield * fs . readFileString ( `${ changed } /docs/harness/t3-code.md` ) ,
126- "Changed adapter" ,
127- ) ;
134+ assert . equal ( yield * fs . readFileString ( `${ changed } /scripts/helper.sh` ) , "Changed helper" ) ;
135+ assert . isFalse ( yield * fs . exists ( `${ changed } /docs/harness/t3-code.md` ) ) ;
128136 } ) ,
129137 ) ;
130138 it . effect ( "materializes archive-backed bytes with manifest executable flags" , ( ) =>
@@ -157,7 +165,7 @@ it.layer(NodeServices.layer)("PstackPack", (it) => {
157165 yield * Effect . gen ( function * ( ) {
158166 const pack = yield * PstackPack . PstackPack ;
159167 const first = yield * pack . catalog ;
160- yield * fs . remove ( `${ fixture . sourceRoot } /t3-code.md ` ) ;
168+ yield * fs . remove ( `${ fixture . sourceRoot } /UPSTREAM.json ` ) ;
161169 assert . deepEqual ( yield * pack . catalog , first ) ;
162170 assert . lengthOf ( ( yield * pack . catalog ) ! , 2 ) ;
163171 } ) . pipe ( Effect . provide ( fixture . layer ) ) ;
@@ -307,12 +315,12 @@ it.layer(NodeServices.layer)("PstackPack", (it) => {
307315 Effect . gen ( function * ( ) {
308316 const fixture = yield * makeFixture ( ) ;
309317 const fs = yield * FileSystem . FileSystem ;
310- const adapter = yield * fs . readFileString ( `${ fixture . sourceRoot } /t3-code.md ` ) ;
311- yield * fs . remove ( `${ fixture . sourceRoot } /t3-code.md ` ) ;
318+ const manifest = yield * fs . readFileString ( `${ fixture . sourceRoot } /UPSTREAM.json ` ) ;
319+ yield * fs . remove ( `${ fixture . sourceRoot } /UPSTREAM.json ` ) ;
312320 yield * Effect . gen ( function * ( ) {
313321 const pack = yield * PstackPack . PstackPack ;
314322 assert . equal ( yield * pack . catalog , undefined ) ;
315- yield * fs . writeFileString ( `${ fixture . sourceRoot } /t3-code.md ` , adapter ) ;
323+ yield * fs . writeFileString ( `${ fixture . sourceRoot } /UPSTREAM.json ` , manifest ) ;
316324 assert . lengthOf ( ( yield * pack . catalog ) ! , 2 ) ;
317325 } ) . pipe ( Effect . provide ( fixture . layer ) ) ;
318326 } ) ,
@@ -571,16 +579,24 @@ it.layer(NodeServices.layer)("PstackPack", (it) => {
571579 assert . lengthOf ( ( yield * read . pipe ( Effect . provide ( fixture . layer ) ) ) ! , 2 ) ;
572580 const packDir = `${ fixture . stateDir } /pstack/pack` ;
573581 const oldStamp = yield * fs . readFileString ( `${ packDir } /.t3-pstack-hash` ) ;
574- yield * fs . writeFileString ( `${ fixture . sourceRoot } /t3-code.md` , "Next version" ) ;
582+ yield * fs . writeFileString (
583+ `${ fixture . sourceRoot } /upstream/scripts/helper.sh` ,
584+ "Next version" ,
585+ ) ;
586+ const manifest = yield * fs . readFileString ( `${ fixture . sourceRoot } /UPSTREAM.json` ) ;
587+ yield * fs . writeFileString (
588+ `${ fixture . sourceRoot } /UPSTREAM.json` ,
589+ manifest . replace ( "b" . repeat ( 40 ) , "d" . repeat ( 40 ) ) ,
590+ ) ;
575591 let blocked = true ;
576592 const result = yield * Effect . gen ( function * ( ) {
577593 const pack = yield * PstackPack . PstackPack ;
578594 const stale = yield * pack . catalog ;
579595 assert . lengthOf ( stale ! , 2 ) ;
580596 assert . equal ( yield * fs . readFileString ( `${ packDir } /.t3-pstack-hash` ) , oldStamp ) ;
581597 assert . equal (
582- yield * fs . readFileString ( `${ packDir } /docs/harness/t3-code.md ` ) ,
583- "# T3 harness " ,
598+ yield * fs . readFileString ( `${ packDir } /scripts/helper.sh ` ) ,
599+ "#!/bin/sh\nexit 0\n " ,
584600 ) ;
585601 blocked = false ;
586602 const fresh = yield * pack . catalog ;
@@ -614,26 +630,8 @@ it.layer(NodeServices.layer)("PstackPack", (it) => {
614630 yield * fs . readFileString ( `${ packDir } /.t3-pstack-hash` ) ,
615631 pstackContentHash ( fixture . sourceRoot ) ,
616632 ) ;
617- assert . equal (
618- yield * fs . readFileString ( `${ packDir } /docs/harness/t3-code.md` ) ,
619- "Next version" ,
620- ) ;
633+ assert . equal ( yield * fs . readFileString ( `${ packDir } /scripts/helper.sh` ) , "Next version" ) ;
621634 assert . deepEqual ( yield * fs . readDirectory ( `${ fixture . stateDir } /pstack` ) , [ "pack" ] ) ;
622635 } ) ,
623636 ) ;
624- it . effect ( "adapter Harnesses rows cover every built-in driver kind" , ( ) =>
625- Effect . gen ( function * ( ) {
626- const fs = yield * FileSystem . FileSystem ;
627- const path = yield * Path . Path ;
628- const adapter = path . resolve (
629- import . meta. dirname ,
630- "../../../.." ,
631- "packages/pstack/t3-code.md" ,
632- ) ;
633- const text = yield * fs . readFileString ( adapter ) ;
634- const table = text . split ( / ^ # # H a r n e s s e s \s * $ / m) [ 1 ] ?. split ( / ^ # # / m) [ 0 ] ?? "" ;
635- const kinds = [ ...table . matchAll ( / ^ \| \s * ` ( [ ^ ` ] + ) ` \s * \| / gm) ] . map ( ( match ) => match [ 1 ] ) . sort ( ) ;
636- assert . deepEqual ( kinds , BUILT_IN_DRIVERS . map ( ( driver ) => driver . driverKind ) . sort ( ) ) ;
637- } ) ,
638- ) ;
639637} ) ;
0 commit comments