@namewta/speculo 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/src/migrations.js +604 -23
- package/dist/src/migrations.js.map +1 -1
- package/package.json +1 -1
- package/template/canonical/canonical-specdev-engineering-cognitive-mentor.md +171 -277
- package/template/canonical/canonical-specdev-goal-plan.md +714 -833
- package/template/canonical/canonical-specdev-grill-with-docs.md +172 -278
- package/template/canonical/canonical-specdev-spec.md +199 -315
- package/template/canonical/canonical-specdev-tickets.md +405 -398
- package/template/canonical/canonical-specdev-wayfinder.md +170 -276
- package/template/skills/migrate-runtime-state/SKILL.md +6 -6
- package/template/skills/migrate-runtime-state/references/migration-contract.md +9 -3
- package/template/skills/migrate-runtime-state/scripts/migrate-runtime-state.mjs +322 -33
- package/template/skills/optimize-codex-config/SKILL.md +81 -0
- package/template/skills/optimize-codex-config/references/configuration-contract.md +103 -0
- package/template/skills/optimize-codex-config/references/troubleshooting.md +79 -0
- package/template/skills/optimize-codex-config/scripts/audit-codex-config.mjs +747 -0
- package/template/workflows/specdev/I-implement/I-implement.md +97 -142
- package/template/workflows/specdev/I-implement/evidence-template.md +60 -48
- package/template/workflows/specdev/I-implement/execution-preflight.md +29 -19
- package/template/workflows/specdev/I-implement/merge-conflict-protocol.md +12 -11
- package/template/workflows/specdev/I-init-setup/I-init-setup.md +4 -5
- package/template/workflows/specdev/I-init-setup/change-status-template.json +14 -1
- package/template/workflows/specdev/I-init-setup/config-template.json +3 -5
- package/template/workflows/specdev/I-init-setup/status-template.json +1 -1
- package/template/workflows/specdev/INDEX.md +12 -8
- package/template/workflows/specdev/P-goal-plan/P-goal-plan.md +76 -93
- package/template/workflows/specdev/P-goal-plan/completion-control.md +26 -44
- package/template/workflows/specdev/P-goal-plan/goal-plan-template.md +43 -31
- package/template/workflows/specdev/P-goal-plan/lead-orchestration.md +34 -0
- package/template/workflows/specdev/P-goal-plan/orchestration-protocol.md +31 -42
- package/template/workflows/specdev/P-goal-plan/planning-modes.md +42 -61
- package/template/workflows/specdev/T-tickets/T-tickets.md +6 -3
- package/template/workflows/specdev/T-tickets/ticket-readiness.md +5 -3
- package/template/workflows/specdev/T-tickets/ticket-template.md +8 -1
- package/template/workflows/specdev/T-tickets/tickets-map-template.md +5 -4
- package/template/workflows/specdev/_state/status.json +1 -1
- package/template/workflows/specdev/common/README.md +2 -2
- package/template/workflows/specdev/common/rules/change-completion.md +17 -19
- package/template/workflows/specdev/common/rules/deviation-control.md +1 -1
- package/template/workflows/specdev/common/rules/evidence-and-verification.md +27 -37
- package/template/workflows/specdev/common/rules/path-ownership.md +21 -23
- package/template/workflows/specdev/common/rules/readiness-and-depth.md +1 -1
- package/template/workflows/specdev/common/schemas/change-status.schema.json +136 -195
- package/template/workflows/specdev/common/schemas/config.schema.json +9 -11
- package/template/workflows/specdev/common/schemas/goal-plan.schema.json +24 -6
- package/template/workflows/specdev/common/schemas/status.schema.json +7 -63
- package/template/workflows/specdev/common/skills/dev-worktree/SKILL.md +42 -21
- package/template/workflows/specdev/common/skills/dev-worktree/references/create.md +48 -18
- package/template/workflows/specdev/common/skills/dev-worktree/references/finalize.md +47 -12
- package/template/workflows/specdev/common/skills/subagent-delivery/SKILL.md +34 -30
- package/template/workflows/specdev/common/skills/subagent-delivery/references/external-web-subagent.md +10 -23
- package/template/workflows/specdev/common/skills/subagent-delivery/references/native-subagent.md +14 -25
- package/template/workflows/specdev/common/tools/validate-specdev.mjs +507 -117
- package/template/workflows/specdev/I-implement/delegated-evidence-template.md +0 -11
- package/template/workflows/specdev/P-goal-plan/delegated-execution-template.md +0 -33
- package/template/workflows/specdev/P-goal-plan/delegated-execution.md +0 -53
|
@@ -324,16 +324,14 @@ resolution: answered
|
|
|
324
324
|
|
|
325
325
|
```json
|
|
326
326
|
{
|
|
327
|
-
"schema_version":
|
|
327
|
+
"schema_version": 4,
|
|
328
328
|
"interaction_language": "zh-CN",
|
|
329
329
|
"artifact_language": "zh-CN",
|
|
330
330
|
"git": {
|
|
331
|
-
"
|
|
332
|
-
"default_branch": null,
|
|
333
|
-
"worktree_for_parallel": true
|
|
331
|
+
"default_branch": null
|
|
334
332
|
},
|
|
335
333
|
"execution": {
|
|
336
|
-
"
|
|
334
|
+
"max_implementation_agents": 3,
|
|
337
335
|
"deep_ticket_human_approval": true,
|
|
338
336
|
"shared_path_owner": "explicit"
|
|
339
337
|
},
|
|
@@ -358,33 +356,31 @@ resolution: answered
|
|
|
358
356
|
```json
|
|
359
357
|
{
|
|
360
358
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
361
|
-
"$id": "urn:speculo:specdev:config:
|
|
359
|
+
"$id": "urn:speculo:specdev:config:v4",
|
|
362
360
|
"title": "SpecDev Configuration",
|
|
363
361
|
"type": "object",
|
|
364
362
|
"required": ["schema_version", "interaction_language", "artifact_language", "git", "execution", "verification", "planning"],
|
|
365
363
|
"properties": {
|
|
366
|
-
"schema_version": {"const":
|
|
364
|
+
"schema_version": {"const": 4},
|
|
367
365
|
"interaction_language": {"type": "string", "minLength": 1},
|
|
368
366
|
"artifact_language": {"type": "string", "minLength": 1},
|
|
369
367
|
"git": {
|
|
370
368
|
"type": "object",
|
|
371
|
-
"required": ["
|
|
369
|
+
"required": ["default_branch"],
|
|
372
370
|
"properties": {
|
|
373
|
-
"
|
|
374
|
-
"default_branch": {"type": ["string", "null"]},
|
|
375
|
-
"worktree_for_parallel": {"type": "boolean"}
|
|
371
|
+
"default_branch": {"type": ["string", "null"]}
|
|
376
372
|
},
|
|
377
|
-
"additionalProperties":
|
|
373
|
+
"additionalProperties": false
|
|
378
374
|
},
|
|
379
375
|
"execution": {
|
|
380
376
|
"type": "object",
|
|
381
|
-
"required": ["
|
|
377
|
+
"required": ["max_implementation_agents", "deep_ticket_human_approval", "shared_path_owner"],
|
|
382
378
|
"properties": {
|
|
383
|
-
"
|
|
379
|
+
"max_implementation_agents": {"type": "integer", "minimum": 1, "maximum": 3},
|
|
384
380
|
"deep_ticket_human_approval": {"type": "boolean"},
|
|
385
381
|
"shared_path_owner": {"type": "string", "minLength": 1}
|
|
386
382
|
},
|
|
387
|
-
"additionalProperties":
|
|
383
|
+
"additionalProperties": false
|
|
388
384
|
},
|
|
389
385
|
"verification": {
|
|
390
386
|
"type": "object",
|
|
@@ -408,7 +404,7 @@ resolution: answered
|
|
|
408
404
|
"additionalProperties": true
|
|
409
405
|
}
|
|
410
406
|
},
|
|
411
|
-
"additionalProperties":
|
|
407
|
+
"additionalProperties": false
|
|
412
408
|
}
|
|
413
409
|
```
|
|
414
410
|
|
|
@@ -418,7 +414,7 @@ resolution: answered
|
|
|
418
414
|
|
|
419
415
|
```json
|
|
420
416
|
{
|
|
421
|
-
"schema_version":
|
|
417
|
+
"schema_version": 5,
|
|
422
418
|
"workflow": "specdev",
|
|
423
419
|
"active": [],
|
|
424
420
|
"archived": []
|
|
@@ -432,83 +428,27 @@ resolution: answered
|
|
|
432
428
|
```json
|
|
433
429
|
{
|
|
434
430
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
435
|
-
"$id": "urn:speculo:specdev:status:
|
|
431
|
+
"$id": "urn:speculo:specdev:status:v5",
|
|
436
432
|
"title": "SpecDev Global Status",
|
|
437
433
|
"type": "object",
|
|
438
|
-
"required": [
|
|
439
|
-
"schema_version",
|
|
440
|
-
"workflow",
|
|
441
|
-
"active",
|
|
442
|
-
"archived"
|
|
443
|
-
],
|
|
434
|
+
"required": ["schema_version", "workflow", "active", "archived"],
|
|
444
435
|
"properties": {
|
|
445
|
-
"schema_version": {
|
|
446
|
-
|
|
447
|
-
},
|
|
448
|
-
"workflow": {
|
|
449
|
-
"const": "specdev"
|
|
450
|
-
},
|
|
436
|
+
"schema_version": {"const": 5},
|
|
437
|
+
"workflow": {"const": "specdev"},
|
|
451
438
|
"active": {
|
|
452
439
|
"type": "array",
|
|
453
440
|
"items": {
|
|
454
441
|
"type": "object",
|
|
455
|
-
"required": [
|
|
456
|
-
"change",
|
|
457
|
-
"current_work",
|
|
458
|
-
"works_run"
|
|
459
|
-
],
|
|
442
|
+
"required": ["change"],
|
|
460
443
|
"properties": {
|
|
461
444
|
"change": {
|
|
462
445
|
"type": "string",
|
|
463
446
|
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"
|
|
464
|
-
},
|
|
465
|
-
"current_work": {
|
|
466
|
-
"type": [
|
|
467
|
-
"string",
|
|
468
|
-
"null"
|
|
469
|
-
],
|
|
470
|
-
"pattern": "^specdev/"
|
|
471
|
-
},
|
|
472
|
-
"works_run": {
|
|
473
|
-
"type": "array",
|
|
474
|
-
"items": {
|
|
475
|
-
"type": "string",
|
|
476
|
-
"pattern": "^specdev/"
|
|
477
|
-
},
|
|
478
|
-
"uniqueItems": true
|
|
479
|
-
},
|
|
480
|
-
"claimed_investigations": {
|
|
481
|
-
"type": "array",
|
|
482
|
-
"items": {
|
|
483
|
-
"type": "object",
|
|
484
|
-
"required": [
|
|
485
|
-
"id",
|
|
486
|
-
"owner",
|
|
487
|
-
"claimed_at"
|
|
488
|
-
],
|
|
489
|
-
"properties": {
|
|
490
|
-
"id": {
|
|
491
|
-
"type": "string"
|
|
492
|
-
},
|
|
493
|
-
"owner": {
|
|
494
|
-
"type": "string"
|
|
495
|
-
},
|
|
496
|
-
"session": {
|
|
497
|
-
"type": [
|
|
498
|
-
"string",
|
|
499
|
-
"null"
|
|
500
|
-
]
|
|
501
|
-
},
|
|
502
|
-
"claimed_at": {
|
|
503
|
-
"type": "string"
|
|
504
|
-
}
|
|
505
|
-
},
|
|
506
|
-
"additionalProperties": false
|
|
507
|
-
}
|
|
508
447
|
}
|
|
509
448
|
},
|
|
510
449
|
"additionalProperties": false
|
|
511
|
-
}
|
|
450
|
+
},
|
|
451
|
+
"uniqueItems": true
|
|
512
452
|
},
|
|
513
453
|
"archived": {
|
|
514
454
|
"type": "array",
|
|
@@ -529,11 +469,24 @@ resolution: answered
|
|
|
529
469
|
|
|
530
470
|
```json
|
|
531
471
|
{
|
|
532
|
-
"schema_version":
|
|
472
|
+
"schema_version": 5,
|
|
533
473
|
"artifact": "change-status",
|
|
534
474
|
"change": "<YYYY-MM-DD-topic>",
|
|
535
475
|
"change_status": "active",
|
|
536
476
|
"current_work": null,
|
|
477
|
+
"works_run": [],
|
|
478
|
+
"claimed_investigations": [],
|
|
479
|
+
"execution_authorization": {
|
|
480
|
+
"implementation_commit": {"status": "not-authorized", "source": null, "granted_at": null, "scope": "Ticket source commits"},
|
|
481
|
+
"local_candidate_integration": {"status": "not-authorized", "source": null, "granted_at": null, "scope": "Lead-owned local parent candidate integration and parent update"},
|
|
482
|
+
"source_cleanup": {"status": "not-authorized", "source": null, "granted_at": null, "scope": "Source worktree and branch cleanup"}
|
|
483
|
+
},
|
|
484
|
+
"leadership": {
|
|
485
|
+
"current": "<owner-or-session-locator>",
|
|
486
|
+
"epoch": 1,
|
|
487
|
+
"assigned_at": "<ISO-8601>",
|
|
488
|
+
"history": []
|
|
489
|
+
},
|
|
537
490
|
"created_at": "<ISO-8601>",
|
|
538
491
|
"updated_at": "<ISO-8601>",
|
|
539
492
|
"completed_at": null,
|
|
@@ -552,216 +505,157 @@ resolution: answered
|
|
|
552
505
|
```json
|
|
553
506
|
{
|
|
554
507
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
555
|
-
"$id": "urn:speculo:specdev:change-status:
|
|
508
|
+
"$id": "urn:speculo:specdev:change-status:v5",
|
|
556
509
|
"title": "SpecDev Change Status",
|
|
557
510
|
"type": "object",
|
|
558
511
|
"required": [
|
|
559
|
-
"schema_version",
|
|
560
|
-
"
|
|
561
|
-
"
|
|
562
|
-
"change_status",
|
|
563
|
-
"current_work",
|
|
564
|
-
"created_at",
|
|
565
|
-
"updated_at",
|
|
566
|
-
"completed_at",
|
|
567
|
-
"archived",
|
|
568
|
-
"archive_path",
|
|
569
|
-
"blockers",
|
|
570
|
-
"deviations"
|
|
512
|
+
"schema_version", "artifact", "change", "change_status", "current_work", "works_run",
|
|
513
|
+
"claimed_investigations", "execution_authorization", "leadership", "created_at", "updated_at",
|
|
514
|
+
"completed_at", "archived", "archive_path", "blockers", "deviations", "worktrees"
|
|
571
515
|
],
|
|
572
516
|
"properties": {
|
|
573
|
-
"schema_version": {
|
|
574
|
-
|
|
575
|
-
},
|
|
576
|
-
"
|
|
577
|
-
|
|
578
|
-
},
|
|
579
|
-
"
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
},
|
|
583
|
-
"
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
"type": "string",
|
|
603
|
-
"minLength": 1
|
|
517
|
+
"schema_version": {"const": 5},
|
|
518
|
+
"artifact": {"const": "change-status"},
|
|
519
|
+
"change": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"},
|
|
520
|
+
"change_status": {"enum": ["active", "blocked", "completed", "archived"]},
|
|
521
|
+
"current_work": {"type": ["string", "null"], "pattern": "^specdev/"},
|
|
522
|
+
"works_run": {"type": "array", "items": {"type": "string", "pattern": "^specdev/"}, "uniqueItems": true},
|
|
523
|
+
"claimed_investigations": {"type": "array", "items": {"$ref": "#/$defs/claim"}},
|
|
524
|
+
"execution_authorization": {"$ref": "#/$defs/authorization"},
|
|
525
|
+
"leadership": {"$ref": "#/$defs/leadership"},
|
|
526
|
+
"created_at": {"type": "string", "minLength": 1},
|
|
527
|
+
"updated_at": {"type": "string", "minLength": 1},
|
|
528
|
+
"completed_at": {"type": ["string", "null"]},
|
|
529
|
+
"archived": {"type": "boolean"},
|
|
530
|
+
"archive_path": {"anyOf": [{"type": "null"}, {"type": "string", "pattern": "^specdev/archive/[0-9]{4}-[0-9]{2}/.+/$"}]},
|
|
531
|
+
"blockers": {"type": "array", "items": {"type": "string"}},
|
|
532
|
+
"deviations": {"type": "array", "items": {"type": "string"}},
|
|
533
|
+
"worktrees": {"type": "array", "items": {"$ref": "#/$defs/worktree"}}
|
|
534
|
+
},
|
|
535
|
+
"$defs": {
|
|
536
|
+
"claim": {
|
|
537
|
+
"type": "object",
|
|
538
|
+
"required": ["id", "owner", "session", "claimed_at"],
|
|
539
|
+
"properties": {
|
|
540
|
+
"id": {"type": "string", "minLength": 1},
|
|
541
|
+
"owner": {"type": "string", "minLength": 1},
|
|
542
|
+
"session": {"type": ["string", "null"]},
|
|
543
|
+
"claimed_at": {"type": "string", "minLength": 1}
|
|
544
|
+
},
|
|
545
|
+
"additionalProperties": false
|
|
604
546
|
},
|
|
605
|
-
"
|
|
606
|
-
"type":
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
547
|
+
"authorization-entry": {
|
|
548
|
+
"type": "object",
|
|
549
|
+
"required": ["status", "source", "granted_at", "scope"],
|
|
550
|
+
"properties": {
|
|
551
|
+
"status": {"enum": ["authorized", "not-authorized", "revoked"]},
|
|
552
|
+
"source": {"type": ["string", "null"]},
|
|
553
|
+
"granted_at": {"type": ["string", "null"]},
|
|
554
|
+
"scope": {"type": "string", "minLength": 1}
|
|
555
|
+
},
|
|
556
|
+
"allOf": [{
|
|
557
|
+
"if": {"properties": {"status": {"const": "authorized"}}, "required": ["status"]},
|
|
558
|
+
"then": {"properties": {"source": {"type": "string", "minLength": 1}, "granted_at": {"type": "string", "minLength": 1}}}
|
|
559
|
+
}],
|
|
560
|
+
"additionalProperties": false
|
|
610
561
|
},
|
|
611
|
-
"
|
|
612
|
-
"type": "
|
|
562
|
+
"authorization": {
|
|
563
|
+
"type": "object",
|
|
564
|
+
"required": ["implementation_commit", "local_candidate_integration", "source_cleanup"],
|
|
565
|
+
"properties": {
|
|
566
|
+
"implementation_commit": {"$ref": "#/$defs/authorization-entry"},
|
|
567
|
+
"local_candidate_integration": {"$ref": "#/$defs/authorization-entry"},
|
|
568
|
+
"source_cleanup": {"$ref": "#/$defs/authorization-entry"}
|
|
569
|
+
},
|
|
570
|
+
"additionalProperties": false
|
|
613
571
|
},
|
|
614
|
-
"
|
|
615
|
-
"
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
},
|
|
619
|
-
{
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
572
|
+
"leadership-history": {
|
|
573
|
+
"type": "object",
|
|
574
|
+
"required": ["owner", "epoch", "assigned_at", "ended_at"],
|
|
575
|
+
"properties": {
|
|
576
|
+
"owner": {"type": "string", "minLength": 1},
|
|
577
|
+
"epoch": {"type": "integer", "minimum": 1},
|
|
578
|
+
"assigned_at": {"type": "string", "minLength": 1},
|
|
579
|
+
"ended_at": {"type": "string", "minLength": 1}
|
|
580
|
+
},
|
|
581
|
+
"additionalProperties": false
|
|
624
582
|
},
|
|
625
|
-
"
|
|
626
|
-
"type": "
|
|
627
|
-
"
|
|
628
|
-
|
|
629
|
-
|
|
583
|
+
"leadership": {
|
|
584
|
+
"type": "object",
|
|
585
|
+
"required": ["current", "epoch", "assigned_at", "history"],
|
|
586
|
+
"properties": {
|
|
587
|
+
"current": {"type": "string", "minLength": 1},
|
|
588
|
+
"epoch": {"type": "integer", "minimum": 1},
|
|
589
|
+
"assigned_at": {"type": "string", "minLength": 1},
|
|
590
|
+
"history": {"type": "array", "items": {"$ref": "#/$defs/leadership-history"}}
|
|
591
|
+
},
|
|
592
|
+
"additionalProperties": false
|
|
630
593
|
},
|
|
631
|
-
"
|
|
632
|
-
"type": "
|
|
633
|
-
"
|
|
634
|
-
|
|
635
|
-
|
|
594
|
+
"full-suite": {
|
|
595
|
+
"type": "object",
|
|
596
|
+
"required": ["required", "status", "reason", "evidence"],
|
|
597
|
+
"properties": {
|
|
598
|
+
"required": {"type": "boolean"},
|
|
599
|
+
"status": {"enum": ["not-required", "pending", "passed", "failed"]},
|
|
600
|
+
"reason": {"type": ["string", "null"]},
|
|
601
|
+
"evidence": {"type": ["string", "null"]}
|
|
602
|
+
},
|
|
603
|
+
"allOf": [{
|
|
604
|
+
"if": {"properties": {"required": {"const": false}}, "required": ["required"]},
|
|
605
|
+
"then": {"properties": {"status": {"const": "not-required"}, "reason": {"type": "string", "minLength": 1}}}
|
|
606
|
+
}],
|
|
607
|
+
"additionalProperties": false
|
|
636
608
|
},
|
|
637
|
-
"
|
|
638
|
-
"type": "
|
|
639
|
-
"
|
|
640
|
-
|
|
641
|
-
"
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
],
|
|
651
|
-
"
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
"pattern": "^T-[0-9]{2,}$"
|
|
655
|
-
},
|
|
656
|
-
"owner": {
|
|
657
|
-
"type": "string",
|
|
658
|
-
"minLength": 1
|
|
659
|
-
},
|
|
660
|
-
"provider": {
|
|
661
|
-
"enum": [
|
|
662
|
-
"native",
|
|
663
|
-
"git",
|
|
664
|
-
"external"
|
|
665
|
-
]
|
|
666
|
-
},
|
|
667
|
-
"base_sha": {
|
|
668
|
-
"type": "string",
|
|
669
|
-
"minLength": 1
|
|
670
|
-
},
|
|
671
|
-
"branch": {
|
|
672
|
-
"type": "string",
|
|
673
|
-
"minLength": 1
|
|
674
|
-
},
|
|
675
|
-
"workspace_ref": {
|
|
676
|
-
"type": "string",
|
|
677
|
-
"minLength": 1,
|
|
678
|
-
"pattern": "^(?!/)(?![A-Za-z]:[\\\\/]).+"
|
|
679
|
-
},
|
|
680
|
-
"status": {
|
|
681
|
-
"enum": [
|
|
682
|
-
"planned",
|
|
683
|
-
"active",
|
|
684
|
-
"review",
|
|
685
|
-
"integrated",
|
|
686
|
-
"removed",
|
|
687
|
-
"blocked"
|
|
688
|
-
]
|
|
689
|
-
},
|
|
690
|
-
"updated_at": {
|
|
691
|
-
"type": "string",
|
|
692
|
-
"minLength": 1
|
|
693
|
-
}
|
|
694
|
-
},
|
|
695
|
-
"additionalProperties": true
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
},
|
|
699
|
-
"allOf": [
|
|
700
|
-
{
|
|
701
|
-
"if": {
|
|
702
|
-
"properties": {
|
|
703
|
-
"worktrees": {
|
|
704
|
-
"contains": {
|
|
705
|
-
"properties": {
|
|
706
|
-
"provider": {
|
|
707
|
-
"const": "git"
|
|
708
|
-
}
|
|
709
|
-
},
|
|
710
|
-
"required": [
|
|
711
|
-
"provider"
|
|
712
|
-
]
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
}
|
|
609
|
+
"worktree": {
|
|
610
|
+
"type": "object",
|
|
611
|
+
"required": ["ticket_id", "owner", "implementation_owner", "integration_owner", "provider", "base_sha", "parent_branch", "branch", "workspace_ref", "source_checkpoint", "integration", "status", "updated_at"],
|
|
612
|
+
"properties": {
|
|
613
|
+
"ticket_id": {"type": "string", "pattern": "^T-[0-9]{2,}$"},
|
|
614
|
+
"owner": {"type": "string", "minLength": 1},
|
|
615
|
+
"implementation_owner": {"type": "string", "minLength": 1},
|
|
616
|
+
"integration_owner": {"type": "string", "minLength": 1},
|
|
617
|
+
"provider": {"const": "git"},
|
|
618
|
+
"base_sha": {"type": "string", "minLength": 1},
|
|
619
|
+
"parent_branch": {"type": "string", "minLength": 1},
|
|
620
|
+
"branch": {"type": "string", "minLength": 1},
|
|
621
|
+
"workspace_ref": {"type": "string", "pattern": "^specdev-worktree/[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*/T-[0-9]{2,}$"},
|
|
622
|
+
"source_checkpoint": {"type": ["string", "null"]},
|
|
623
|
+
"integration": {"$ref": "#/$defs/integration"},
|
|
624
|
+
"status": {"enum": ["planned", "active", "review", "integrating", "integrated", "removed", "blocked"]},
|
|
625
|
+
"updated_at": {"type": "string", "minLength": 1}
|
|
716
626
|
},
|
|
717
|
-
"
|
|
718
|
-
"properties": {
|
|
719
|
-
"worktrees": {
|
|
720
|
-
"items": {
|
|
721
|
-
"if": {
|
|
722
|
-
"properties": {
|
|
723
|
-
"provider": {
|
|
724
|
-
"const": "git"
|
|
725
|
-
}
|
|
726
|
-
},
|
|
727
|
-
"required": [
|
|
728
|
-
"provider"
|
|
729
|
-
]
|
|
730
|
-
},
|
|
731
|
-
"then": {
|
|
732
|
-
"properties": {
|
|
733
|
-
"workspace_ref": {
|
|
734
|
-
"pattern": "^specdev-worktree/T-[0-9]{2,}$"
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
}
|
|
627
|
+
"additionalProperties": false
|
|
742
628
|
},
|
|
743
|
-
{
|
|
744
|
-
"
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
}
|
|
629
|
+
"integration": {
|
|
630
|
+
"type": "object",
|
|
631
|
+
"required": ["status", "parent_ref", "parent_before_sha", "source_sha", "candidate_sha", "candidate_tree_sha", "candidate_branch", "candidate_workspace_ref", "result_sha", "method", "conflict_paths", "verification", "full_suite", "e2e", "evidence", "attempts", "promotion_status"],
|
|
632
|
+
"properties": {
|
|
633
|
+
"status": {"enum": ["pending", "candidate", "passed", "failed", "stale"]},
|
|
634
|
+
"parent_ref": {"type": ["string", "null"]},
|
|
635
|
+
"parent_before_sha": {"type": ["string", "null"]},
|
|
636
|
+
"source_sha": {"type": ["string", "null"]},
|
|
637
|
+
"candidate_sha": {"type": ["string", "null"]},
|
|
638
|
+
"candidate_tree_sha": {"type": ["string", "null"]},
|
|
639
|
+
"candidate_branch": {"type": ["string", "null"]},
|
|
640
|
+
"candidate_workspace_ref": {"anyOf": [{"type": "null"}, {"type": "string", "pattern": "^specdev-worktree/\\.integration/[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*/T-[0-9]{2,}$"}]},
|
|
641
|
+
"result_sha": {"type": ["string", "null"]},
|
|
642
|
+
"method": {"enum": [null, "fast-forward", "merge-commit"]},
|
|
643
|
+
"conflict_paths": {"type": "array", "items": {"type": "string"}},
|
|
644
|
+
"verification": {"enum": ["pending", "passed", "failed"]},
|
|
645
|
+
"full_suite": {"$ref": "#/$defs/full-suite"},
|
|
646
|
+
"e2e": {"$ref": "#/$defs/full-suite"},
|
|
647
|
+
"evidence": {"type": "string", "pattern": "^\\{roots\\.state\\}/specdev/changes/[^<]+/evidence/T-[0-9]{2,}\\.md$"},
|
|
648
|
+
"attempts": {"type": "integer", "minimum": 0},
|
|
649
|
+
"promotion_status": {"enum": ["pending", "applying", "applied", "failed", "stale"]}
|
|
750
650
|
},
|
|
751
|
-
"
|
|
752
|
-
"properties": {
|
|
753
|
-
"archived": {
|
|
754
|
-
"const": true
|
|
755
|
-
},
|
|
756
|
-
"archive_path": {
|
|
757
|
-
"type": "string",
|
|
758
|
-
"pattern": "^specdev/archive/[0-9]{4}-[0-9]{2}/.+/$"
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
651
|
+
"additionalProperties": false
|
|
762
652
|
}
|
|
763
|
-
|
|
764
|
-
"
|
|
653
|
+
},
|
|
654
|
+
"allOf": [{
|
|
655
|
+
"if": {"properties": {"change_status": {"const": "archived"}}, "required": ["change_status"]},
|
|
656
|
+
"then": {"properties": {"archived": {"const": true}, "archive_path": {"type": "string", "pattern": "^specdev/archive/[0-9]{4}-[0-9]{2}/.+/$"}}}
|
|
657
|
+
}],
|
|
658
|
+
"additionalProperties": false
|
|
765
659
|
}
|
|
766
660
|
```
|
|
767
661
|
|
|
@@ -43,25 +43,25 @@ node scripts/migrate-runtime-state.mjs inspect --project-root <project-root>
|
|
|
43
43
|
|
|
44
44
|
### 3. 生成确定性计划
|
|
45
45
|
|
|
46
|
-
生成 schema
|
|
46
|
+
生成 schema v2 JSON plan。`backup_manifest_sha256` 锁定 inspect 现场;`source_decisions` 必须逐项覆盖 manifest 中的每个文件且不得包含 `unresolved`;每个 action 必须以 `source_decision` 显式引用唯一来源决策,且动作、decision disposition 与目标一一对应:
|
|
47
47
|
|
|
48
48
|
```json
|
|
49
49
|
{
|
|
50
|
-
"schema_version":
|
|
50
|
+
"schema_version": 2,
|
|
51
51
|
"backup_manifest_sha256": "<inspect 返回的 sha256>",
|
|
52
52
|
"source_decisions": [
|
|
53
53
|
{"path": "config.json", "disposition": "merge-json", "target": "config.json"},
|
|
54
|
+
{"path": "state/specdev/context.md", "disposition": "restore", "target": ".speculo/specdev/context.md"},
|
|
54
55
|
{"path": "state/workspace.json", "disposition": "keep-current", "target": ".speculo/workspace.json"}
|
|
55
56
|
],
|
|
56
57
|
"actions": [
|
|
57
|
-
{"kind": "copy", "from": "state/specdev/context", "to": ".speculo/specdev/context", "expected_target": "absent"},
|
|
58
|
-
{"kind": "replace-json", "to": ".
|
|
59
|
-
{"kind": "keep-current", "to": "config.json", "expected_target": "file:<sha256>"}
|
|
58
|
+
{"kind": "copy", "source_decision": "state/specdev/context.md", "from": "state/specdev/context.md", "to": ".speculo/specdev/context.md", "expected_target": "absent"},
|
|
59
|
+
{"kind": "replace-json", "source_decision": "config.json", "to": "config.json", "value": {}, "expected_target": "file:<sha256>"}
|
|
60
60
|
]
|
|
61
61
|
}
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
`from`
|
|
64
|
+
`from` 必须与 `source_decision` 相同且相对 backup root;`copy ↔ restore`、`replace-json ↔ merge-json|replace-json`、`keep-current ↔ keep-current`、`remove-current ↔ remove-current`。只有 `keep-current` 决策可省略 action。`to` 只能是 `config.json` 或 `.speculo/` 内非受保护路径。每个 action 都使用 `fingerprint` 输出锁定 `expected_target`;目标相互重叠时拆成不重叠动作。Plan 写入调用方声明的临时位置,报告保存等价 Markdown 表格;正式 state 不保存第二份 plan。
|
|
65
65
|
|
|
66
66
|
**完成标准**:计划可由脚本解析,路径均在授权边界内,受管理静态资产和 `back/` 不会成为目标。
|
|
67
67
|
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
- `active` 从仍位于 `changes/` 且 change 状态为 active/blocked/completed 的真实目录核对;不得创建虚假 change。
|
|
27
27
|
- `archived` 从 `archive/YYYY-MM/<change>/` 核对,active/archived 不得重叠。
|
|
28
28
|
- `config.json` 保留语言、Git、执行、验证与规划偏好,并补入当前 schema 的必需默认值。
|
|
29
|
+
- SpecDev config v3 升级为 v4 时,`execution.max_parallel` 只作为旧并发偏好的输入,收敛到 `execution.max_implementation_agents: 1..3`;删除旧的自动提交和条件 worktree 开关,不把它们解释为授权。
|
|
30
|
+
- change-status v3 只有在 `worktrees` 缺失或为空时才可确定性升级为 v4;存在旧 worktree 记录时,必须逐 Ticket 重建 implementation owner、source commit、candidate/result、E2E disposition 和父分支包含关系。v4 runtime 不得自动升级为 v5:旧状态无法可靠推断 execution authorization 或 Lead leadership,必须保持 pending 并显式对账。
|
|
31
|
+
- active Goal Plan 不是 v5 时必须重新规划固定 Lead、Ticket worktree 和 candidate integration gate;不能只改 frontmatter 版本号。
|
|
32
|
+
- 已声明为 v4 的 SpecDev config,以及已声明为 v5 的 global status、change-status 和 Goal Plan,必须完整满足当前 schema:必需字段、类型、枚举、嵌套对象和 `additionalProperties` 边界都通过后才能自动保留。不得为不完整状态静默补默认值,也不得只扫描少量标记字段。
|
|
33
|
+
- worktree `removed` 只接受为 `integrated` 后的清理终态;source checkpoint、passed candidate/result、验证、E2E disposition 和 Evidence 必须完整保留。
|
|
29
34
|
- `.config/`、`adr/`、`context/`、`research/`、`changes/`、`archive/` 和声明的 sidecar 都是持久项。
|
|
30
35
|
- Command Markdown 报告和具有当前 owner 的 `state.json` 均迁移;未知 command state 保持 unresolved。
|
|
31
36
|
|
|
@@ -49,10 +54,11 @@
|
|
|
49
54
|
|
|
50
55
|
## 验证
|
|
51
56
|
|
|
52
|
-
- backup manifest 的每个 file hash、size
|
|
53
|
-
- plan 的 `backup_manifest_sha256` 与现场一致,`source_decisions` 恰好覆盖 manifest
|
|
57
|
+
- backup manifest 的每个 file hash、size,以及每个 symlink 的类型和 link target 都必须与现场一致;link 本身保留为 pending 事实,不能被自动恢复到 active runtime。
|
|
58
|
+
- plan 的 `backup_manifest_sha256` 与现场一致,`source_decisions` 恰好覆盖 manifest 全部条目;每个 action 必须显式 `source_decision`,且只可实现该 decision 的同目标、同 disposition 动作。除 `keep-current` 外,每个 decision 必须恰有一个 action;每个 action 的 `expected_target` 与 active 现场一致。
|
|
59
|
+
- action 后、删除 staged marker 前、原子替换后都递归拒绝 active runtime 中的 symlink;任何失败均恢复原 active 安装。
|
|
54
60
|
- 所有迁移后 JSON 可解析。
|
|
55
61
|
- workspace、install manifest、项目配置和已安装 workflow 全局状态满足当前版本。
|
|
56
|
-
- SpecDev active/archive 索引与目录一致;person 状态满足 schema v1。
|
|
62
|
+
- SpecDev active/archive 索引与目录一致;SpecDev config 满足 v4 合同,global status、change-status 与 Goal Plan 满足 v5 合同;person 状态满足 schema v1。
|
|
57
63
|
- pending marker 只在全部验证通过后从 staged 安装删除。
|
|
58
64
|
- 执行后 backup manifest 与内容 hash 不变。
|