@@ -10,24 +10,30 @@ function buildGovernanceExpertChecks(ctx) {
1010 } = ctx
1111 const { collectChangelogSources, hasChangelogEvidence } = buildGovernanceHelpers ( ctx )
1212
13+ function collectActiveProfileCorpus ( names ) {
14+ const files = names . map ( name => path . join ( ACTIVE_DEVCODEX_ROOT , 'profile' , name ) )
15+ if ( ! files . every ( file => fs . existsSync ( file ) ) ) return null
16+ return files . map ( file => read ( file ) ) . join ( '\n' )
17+ }
18+
19+ function appendActiveProfileProbe ( probes , profileCorpus , needles , probeId ) {
20+ if ( profileCorpus !== null ) probes . push ( { file : 'active profile corpus' , content : profileCorpus , needles } )
21+ else console . log ( `[${ probeId } ] active Profile corpus unavailable — repository consumers remain authoritative` )
22+ }
23+
1324 function checkV83 ( ) {
1425 const gates = [
1526 'ProfileTierStandardGate' ,
1627 'ProfileLifecycleClassificationGate' ,
1728 'AllDevCodexProfileValidationGate'
1829 ]
1930
20- const profileCorpus = [
31+ const profileCorpus = collectActiveProfileCorpus ( [
2132 'README.md' ,
2233 '01-项目信息.md' ,
2334 '06-功能清单.md' ,
2435 '07-用户文档与契约规范.md'
25- ]
26- . map ( name => {
27- const file = path . join ( ACTIVE_DEVCODEX_ROOT , 'profile' , name )
28- return fs . existsSync ( file ) ? read ( file ) : ''
29- } )
30- . join ( '\n' )
36+ ] )
3137 const changelogCorpus = collectChangelogSources ( )
3238 . map ( source => source . content )
3339 . join ( '\n' )
@@ -45,9 +51,9 @@ function buildGovernanceExpertChecks(ctx) {
4551 { file : 'skills/report/SKILL.md' , needles : [ 'ProfileTierValidation' , 'AllDevCodexProfileValidation' ] . concat ( gates ) } ,
4652 { file : 'README.md' , needles : [ 'profile-lite' , 'profile-standard' , 'profile-closed-loop' , 'AllDevCodexProfileValidationGate' ] . concat ( gates ) } ,
4753 { file : 'website/docs/guide/development.md' , needles : [ 'profile-lite' , 'profile-standard' , 'profile-closed-loop' , 'AllDevCodexProfileValidationGate' ] . concat ( gates ) } ,
48- { file : 'active profile corpus' , content : profileCorpus , needles : [ 'profile-closed-loop' , '06-功能清单' , '07-用户文档与契约规范' , '稳定基线' , '活文档' ] . concat ( gates ) } ,
4954 { file : 'changelog corpus' , content : changelogCorpus , needles : [ 'V83' ] . concat ( gates ) }
5055 ]
56+ appendActiveProfileProbe ( probes , profileCorpus , [ 'profile-closed-loop' , '06-功能清单' , '07-用户文档与契约规范' , '稳定基线' , '活文档' ] . concat ( gates ) , 'V83' )
5157
5258 for ( const probe of probes ) {
5359 const content = probe . content || read ( path . join ( ROOT , probe . file ) )
@@ -78,16 +84,11 @@ function buildGovernanceExpertChecks(ctx) {
7884 'ExpertEvidenceMatrixGate'
7985 ]
8086
81- const profileCorpus = [
87+ const profileCorpus = collectActiveProfileCorpus ( [
8288 '01-项目信息.md' ,
8389 '02-架构约束.md' ,
8490 '06-功能清单.md'
85- ]
86- . map ( name => {
87- const file = path . join ( ACTIVE_DEVCODEX_ROOT , 'profile' , name )
88- return fs . existsSync ( file ) ? read ( file ) : ''
89- } )
90- . join ( '\n' )
91+ ] )
9192 const changelogCorpus = collectChangelogSources ( )
9293 . map ( source => source . content )
9394 . join ( '\n' )
@@ -131,9 +132,9 @@ function buildGovernanceExpertChecks(ctx) {
131132 { file : 'website/docs/versions/v1/1.0.1/CHANGELOG.md' , needles : [ 'V84' , 'expert-output-quality' , 'ExpertOutputQualityGate' ] } ,
132133 { file : 'scripts/lib/test-spec-governance-expert.js' , needles : [ 'checkV84' , 'classifyExpertOutputSample' , 'ExpertOutputQualityGate' ] } ,
133134 { file : 'scripts/validate.js' , needles : [ 'createProbeRegistry' , 'expectedProbeIds' , 'runProbeRegistry' ] } ,
134- { file : 'active profile corpus' , content : profileCorpus , needles : [ '76' , 'expert-output-quality' , 'ExpertOutputQualityGate' ] } ,
135135 { file : 'changelog corpus' , content : changelogCorpus , needles : [ 'V84' , 'expert-output-quality' , 'ExpertOutputQualityGate' ] }
136136 ]
137+ appendActiveProfileProbe ( probes , profileCorpus , [ '76' , 'expert-output-quality' , 'ExpertOutputQualityGate' ] , 'V84' )
137138
138139 for ( const probe of probes ) {
139140 const content = probe . content || read ( path . join ( ROOT , probe . file ) )
@@ -204,16 +205,11 @@ function buildGovernanceExpertChecks(ctx) {
204205 }
205206 }
206207
207- const profileCorpus = [
208+ const profileCorpus = collectActiveProfileCorpus ( [
208209 '01-项目信息.md' ,
209210 '02-架构约束.md' ,
210211 '06-功能清单.md'
211- ]
212- . map ( name => {
213- const file = path . join ( ACTIVE_DEVCODEX_ROOT , 'profile' , name )
214- return fs . existsSync ( file ) ? read ( file ) : ''
215- } )
216- . join ( '\n' )
212+ ] )
217213 const changelogCorpus = collectChangelogSources ( )
218214 . map ( source => source . content )
219215 . join ( '\n' )
@@ -240,9 +236,9 @@ function buildGovernanceExpertChecks(ctx) {
240236 { file : 'website/docs/versions/v1/1.0.1/CHANGELOG.md' , needles : [ 'V85' , 'ExpertOwnerSkillGate' ] . concat ( skillNames ) } ,
241237 { file : 'scripts/lib/test-spec-governance-expert.js' , needles : [ 'checkV85' , 'classifyExpertOwnerSample' , 'ExpertOwnerSkillGate' ] } ,
242238 { file : 'scripts/validate.js' , needles : [ 'createProbeRegistry' , 'expectedProbeIds' , 'runProbeRegistry' ] } ,
243- { file : 'active profile corpus' , content : profileCorpus , needles : [ '74' , '21 个专家 Owner Skill' , 'ExpertOwnerSkillGate' , 'V85' ] . concat ( skillNames ) } ,
244239 { file : 'changelog corpus' , content : changelogCorpus , needles : [ 'V85' , 'ExpertOwnerSkillGate' ] . concat ( skillNames ) }
245240 ]
241+ appendActiveProfileProbe ( probes , profileCorpus , [ '74' , '21 个专家 Owner Skill' , 'ExpertOwnerSkillGate' , 'V85' ] . concat ( skillNames ) , 'V85' )
246242
247243 for ( const [ name , gate , fields ] of skillMap ) {
248244 probes . push ( {
@@ -274,16 +270,11 @@ function buildGovernanceExpertChecks(ctx) {
274270 err ( '[V86] positive memory bootstrap sample must be file-truth-required' )
275271 }
276272
277- const profileCorpus = [
273+ const profileCorpus = collectActiveProfileCorpus ( [
278274 '01-项目信息.md' ,
279275 '06-功能清单.md' ,
280276 '07-用户文档与契约规范.md'
281- ]
282- . map ( name => {
283- const file = path . join ( ACTIVE_DEVCODEX_ROOT , 'profile' , name )
284- return fs . existsSync ( file ) ? read ( file ) : ''
285- } )
286- . join ( '\n' )
277+ ] )
287278 const changelogCorpus = collectChangelogSources ( )
288279 . map ( source => source . content )
289280 . join ( '\n' )
@@ -302,9 +293,9 @@ function buildGovernanceExpertChecks(ctx) {
302293 { file : 'website/docs/versions/v1/1.0.1/CHANGELOG.md' , needles : [ gate , 'V86' ] } ,
303294 { file : 'scripts/lib/test-spec-governance-expert.js' , needles : [ 'checkV86' , 'classifyMemoryBootstrapSample' , gate ] } ,
304295 { file : 'scripts/validate.js' , needles : [ 'createProbeRegistry' , 'expectedProbeIds' , 'runProbeRegistry' ] } ,
305- { file : 'active profile corpus' , content : profileCorpus , needles : [ gate , 'V86' ] } ,
306296 { file : 'changelog corpus' , content : changelogCorpus , needles : [ gate , 'V86' ] }
307297 ]
298+ appendActiveProfileProbe ( probes , profileCorpus , [ gate , 'V86' ] , 'V86' )
308299
309300 for ( const probe of probes ) {
310301 const content = probe . content || read ( path . join ( ROOT , probe . file ) )
0 commit comments