@gitgov/core 2.1.2 → 2.3.0
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 +70 -8
- package/dist/src/{agent_runner-ByOUWOt6.d.ts → agent_runner-D7JahEKk.d.ts} +8 -1198
- package/dist/src/fs.d.ts +34 -22
- package/dist/src/fs.js +66 -14
- package/dist/src/fs.js.map +1 -1
- package/dist/src/github.d.ts +473 -0
- package/dist/src/github.js +1281 -0
- package/dist/src/github.js.map +1 -0
- package/dist/src/{index--ahcnsG3.d.ts → index-Bhc341pf.d.ts} +6 -265
- package/dist/src/index.d.ts +54 -60
- package/dist/src/index.js +5048 -5047
- package/dist/src/index.js.map +1 -1
- package/dist/src/key_provider-CRpHFGjN.d.ts +227 -0
- package/dist/src/memory.d.ts +27 -5
- package/dist/src/memory.js +31 -2
- package/dist/src/memory.js.map +1 -1
- package/dist/src/{memory_file_lister-BkQ_C3ZU.d.ts → memory_file_lister-C978PA8g.d.ts} +2 -1
- package/dist/src/prisma.d.ts +71 -0
- package/dist/src/prisma.js +67 -0
- package/dist/src/prisma.js.map +1 -0
- package/dist/src/record_projection.types-B8AM7u8U.d.ts +1207 -0
- package/dist/src/record_store-BXKWqon5.d.ts +64 -0
- package/package.json +10 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I as ISessionManager, S as SessionStore, G as GitGovSession, A as ActorState, a as SyncPreferencesUpdate, K as KeyProvider } from './key_provider-CRpHFGjN.js';
|
|
2
|
+
import { k as IConfigManager, C as ConfigStore, G as GitGovConfig, S as SyncConfig, l as SyncDefaults, A as AuditState, j as AuditStateUpdate, g as FileLister, F as FsFileListerOptions, h as FileListOptions, i as FileStats, I as IGitModule } from './index-Bhc341pf.js';
|
|
3
|
+
import { R as RecordStore } from './record_store-BXKWqon5.js';
|
|
4
|
+
import { Q as BaseEvent, X as EventHandler, Z as EventSubscription, a0 as GitGovEvent, G as GitGovRecord, v as GitGovRecordType, I as IRecordProjector, A as ActorPayload, c as ActorRecord, R as RecordStores$1, l as ExecutionRecord, e as AgentRecord } from './record_projection.types-B8AM7u8U.js';
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* ConfigManager - Project Configuration Manager
|
|
@@ -269,1017 +272,6 @@ declare class FsFileLister implements FileLister {
|
|
|
269
272
|
private validatePath;
|
|
270
273
|
}
|
|
271
274
|
|
|
272
|
-
/**
|
|
273
|
-
* This file was automatically generated from actor_record_schema.json.
|
|
274
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source schema,
|
|
275
|
-
* and run 'pnpm compile:types' to regenerate this file.
|
|
276
|
-
*/
|
|
277
|
-
/**
|
|
278
|
-
* Canonical schema for actor records as defined in actor_protocol.md
|
|
279
|
-
*/
|
|
280
|
-
interface ActorRecord {
|
|
281
|
-
/**
|
|
282
|
-
* Unique, human-readable identifier for the actor.
|
|
283
|
-
*/
|
|
284
|
-
id: string;
|
|
285
|
-
/**
|
|
286
|
-
* The type of actor.
|
|
287
|
-
*/
|
|
288
|
-
type: 'human' | 'agent';
|
|
289
|
-
/**
|
|
290
|
-
* The name of the actor to be used in user interfaces.
|
|
291
|
-
*/
|
|
292
|
-
displayName: string;
|
|
293
|
-
/**
|
|
294
|
-
* The Ed25519 public key (base64 encoded, 44 characters) for verifying the actor's signatures.
|
|
295
|
-
*/
|
|
296
|
-
publicKey: string;
|
|
297
|
-
/**
|
|
298
|
-
* List of capacity roles defining the actor's skills and permissions. Uses hierarchical format with colons.
|
|
299
|
-
*
|
|
300
|
-
* @minItems 1
|
|
301
|
-
*/
|
|
302
|
-
roles: [string, ...string[]];
|
|
303
|
-
/**
|
|
304
|
-
* Optional. The lifecycle status of the actor. Defaults to 'active' if not specified.
|
|
305
|
-
*/
|
|
306
|
-
status?: 'active' | 'revoked';
|
|
307
|
-
/**
|
|
308
|
-
* Optional. The ID of the actor that replaces this one.
|
|
309
|
-
*/
|
|
310
|
-
supersededBy?: string;
|
|
311
|
-
/**
|
|
312
|
-
* An optional field for additional, non-canonical metadata.
|
|
313
|
-
*/
|
|
314
|
-
metadata?: {};
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* This file was automatically generated from agent_record_schema.json.
|
|
319
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source schema,
|
|
320
|
-
* and run 'pnpm compile:types' to regenerate this file.
|
|
321
|
-
*/
|
|
322
|
-
/**
|
|
323
|
-
* Canonical schema for agent operational manifests.
|
|
324
|
-
*/
|
|
325
|
-
interface AgentRecord<TMetadata = object> {
|
|
326
|
-
/**
|
|
327
|
-
* Unique identifier for the agent, linking to an ActorRecord.
|
|
328
|
-
*/
|
|
329
|
-
id: string;
|
|
330
|
-
status?: 'active' | 'archived';
|
|
331
|
-
/**
|
|
332
|
-
* Optional list of triggers that activate the agent.
|
|
333
|
-
* Additional fields are allowed and depend on trigger type:
|
|
334
|
-
* - webhook triggers: 'event' (event identifier), 'filter' (condition)
|
|
335
|
-
* - scheduled triggers: 'cron' (cron expression)
|
|
336
|
-
* - manual triggers: 'command' (example CLI command)
|
|
337
|
-
*
|
|
338
|
-
*/
|
|
339
|
-
triggers?: {
|
|
340
|
-
/**
|
|
341
|
-
* Type of trigger that activates the agent
|
|
342
|
-
*/
|
|
343
|
-
type: 'manual' | 'webhook' | 'scheduled';
|
|
344
|
-
[k: string]: unknown | undefined;
|
|
345
|
-
}[];
|
|
346
|
-
knowledge_dependencies?: string[];
|
|
347
|
-
prompt_engine_requirements?: {
|
|
348
|
-
roles?: string[];
|
|
349
|
-
skills?: string[];
|
|
350
|
-
};
|
|
351
|
-
/**
|
|
352
|
-
* Optional framework-specific or deployment-specific metadata for agent extensions.
|
|
353
|
-
* Common use cases: framework identification (langchain, google-adk), deployment info (provider, image, region),
|
|
354
|
-
* cost tracking (cost_per_invocation, currency), tool capabilities, maintainer info.
|
|
355
|
-
* This field does NOT affect agent execution - it is purely informational.
|
|
356
|
-
*
|
|
357
|
-
*/
|
|
358
|
-
metadata?: TMetadata;
|
|
359
|
-
engine: {
|
|
360
|
-
type: 'local';
|
|
361
|
-
/**
|
|
362
|
-
* Runtime environment (typescript, python, etc.)
|
|
363
|
-
*/
|
|
364
|
-
runtime?: string;
|
|
365
|
-
/**
|
|
366
|
-
* Path to the agent entry file
|
|
367
|
-
*/
|
|
368
|
-
entrypoint?: string;
|
|
369
|
-
/**
|
|
370
|
-
* Function name to invoke
|
|
371
|
-
*/
|
|
372
|
-
function?: string;
|
|
373
|
-
} | {
|
|
374
|
-
type: 'api';
|
|
375
|
-
/**
|
|
376
|
-
* HTTP endpoint for the agent
|
|
377
|
-
*/
|
|
378
|
-
url: string;
|
|
379
|
-
method?: 'POST' | 'GET' | 'PUT';
|
|
380
|
-
/**
|
|
381
|
-
* Authentication configuration for API requests
|
|
382
|
-
*/
|
|
383
|
-
auth?: {
|
|
384
|
-
/**
|
|
385
|
-
* Authentication type. 'actor-signature' uses the agent's ActorRecord keypair to sign requests.
|
|
386
|
-
*/
|
|
387
|
-
type?: 'bearer' | 'oauth' | 'api-key' | 'actor-signature';
|
|
388
|
-
/**
|
|
389
|
-
* Reference to secret in Secret Manager (for bearer/api-key/oauth auth types)
|
|
390
|
-
*/
|
|
391
|
-
secret_key?: string;
|
|
392
|
-
/**
|
|
393
|
-
* Direct token value (not recommended for production, use secret_key instead)
|
|
394
|
-
*/
|
|
395
|
-
token?: string;
|
|
396
|
-
[k: string]: unknown | undefined;
|
|
397
|
-
};
|
|
398
|
-
} | {
|
|
399
|
-
type: 'mcp';
|
|
400
|
-
/**
|
|
401
|
-
* MCP server endpoint
|
|
402
|
-
*/
|
|
403
|
-
url: string;
|
|
404
|
-
/**
|
|
405
|
-
* Name of the MCP tool to invoke. If not specified, defaults to agentId without 'agent:' prefix.
|
|
406
|
-
*/
|
|
407
|
-
tool?: string;
|
|
408
|
-
/**
|
|
409
|
-
* Authentication configuration for MCP server
|
|
410
|
-
*/
|
|
411
|
-
auth?: {
|
|
412
|
-
/**
|
|
413
|
-
* Authentication type. 'actor-signature' uses the agent's ActorRecord keypair to sign requests.
|
|
414
|
-
*/
|
|
415
|
-
type?: 'bearer' | 'oauth' | 'api-key' | 'actor-signature';
|
|
416
|
-
/**
|
|
417
|
-
* Reference to secret in Secret Manager (for bearer/api-key/oauth auth types)
|
|
418
|
-
*/
|
|
419
|
-
secret_key?: string;
|
|
420
|
-
/**
|
|
421
|
-
* Direct token value (not recommended for production, use secret_key instead)
|
|
422
|
-
*/
|
|
423
|
-
token?: string;
|
|
424
|
-
[k: string]: unknown | undefined;
|
|
425
|
-
};
|
|
426
|
-
} | {
|
|
427
|
-
type: 'custom';
|
|
428
|
-
/**
|
|
429
|
-
* Custom protocol identifier (e.g., 'a2a', 'grpc')
|
|
430
|
-
*/
|
|
431
|
-
protocol?: string;
|
|
432
|
-
/**
|
|
433
|
-
* Protocol-specific configuration
|
|
434
|
-
*/
|
|
435
|
-
config?: {};
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
/**
|
|
440
|
-
* This file was automatically generated from changelog_record_schema.json.
|
|
441
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source schema,
|
|
442
|
-
* and run 'pnpm compile:types' to regenerate this file.
|
|
443
|
-
*/
|
|
444
|
-
/**
|
|
445
|
-
* Canonical schema for changelog records - aggregates N tasks into 1 release note
|
|
446
|
-
*/
|
|
447
|
-
interface ChangelogRecord {
|
|
448
|
-
/**
|
|
449
|
-
* Unique identifier for the changelog entry
|
|
450
|
-
*/
|
|
451
|
-
id: string;
|
|
452
|
-
/**
|
|
453
|
-
* Executive title of the deliverable
|
|
454
|
-
*/
|
|
455
|
-
title: string;
|
|
456
|
-
/**
|
|
457
|
-
* Detailed description of the value delivered, including key decisions and impact
|
|
458
|
-
*/
|
|
459
|
-
description: string;
|
|
460
|
-
/**
|
|
461
|
-
* IDs of tasks that compose this deliverable (minimum 1 required)
|
|
462
|
-
*
|
|
463
|
-
* @minItems 1
|
|
464
|
-
*/
|
|
465
|
-
relatedTasks: [string, ...string[]];
|
|
466
|
-
/**
|
|
467
|
-
* Unix timestamp in seconds when the deliverable was completed
|
|
468
|
-
*/
|
|
469
|
-
completedAt: number;
|
|
470
|
-
/**
|
|
471
|
-
* Optional IDs of cycles related to this deliverable
|
|
472
|
-
*/
|
|
473
|
-
relatedCycles?: string[];
|
|
474
|
-
/**
|
|
475
|
-
* Optional IDs of key execution records related to this work
|
|
476
|
-
*/
|
|
477
|
-
relatedExecutions?: string[];
|
|
478
|
-
/**
|
|
479
|
-
* Optional version or release identifier (e.g., 'v1.0.0', 'sprint-24')
|
|
480
|
-
*/
|
|
481
|
-
version?: string;
|
|
482
|
-
/**
|
|
483
|
-
* Optional tags for categorization (e.g., 'feature:auth', 'bugfix', 'security')
|
|
484
|
-
*/
|
|
485
|
-
tags?: string[];
|
|
486
|
-
/**
|
|
487
|
-
* Optional list of git commit hashes related to this deliverable
|
|
488
|
-
*/
|
|
489
|
-
commits?: string[];
|
|
490
|
-
/**
|
|
491
|
-
* Optional list of main files that were created or modified
|
|
492
|
-
*/
|
|
493
|
-
files?: string[];
|
|
494
|
-
/**
|
|
495
|
-
* Optional additional context, decisions, or learnings
|
|
496
|
-
*/
|
|
497
|
-
notes?: string;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* This file was automatically generated from cycle_record_schema.json.
|
|
502
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source schema,
|
|
503
|
-
* and run 'pnpm compile:types' to regenerate this file.
|
|
504
|
-
*/
|
|
505
|
-
/**
|
|
506
|
-
* Canonical schema for cycle records - strategic grouping of work
|
|
507
|
-
*/
|
|
508
|
-
interface CycleRecord {
|
|
509
|
-
/**
|
|
510
|
-
* Unique identifier for the cycle (10 timestamp + 1 dash + 5 'cycle' + 1 dash + max 50 slug = 67 max)
|
|
511
|
-
*/
|
|
512
|
-
id: string;
|
|
513
|
-
/**
|
|
514
|
-
* Human-readable title for the cycle (e.g., 'Sprint 24', 'Auth v2.0', 'Q4 2025')
|
|
515
|
-
*/
|
|
516
|
-
title: string;
|
|
517
|
-
/**
|
|
518
|
-
* The lifecycle status of the cycle
|
|
519
|
-
*/
|
|
520
|
-
status: 'planning' | 'active' | 'completed' | 'archived';
|
|
521
|
-
/**
|
|
522
|
-
* Optional array of Task IDs that belong to this cycle. Can be empty for cycles that only contain child cycles. (10 timestamp + 1 dash + 4 'task' + 1 dash + max 50 slug = 66 max)
|
|
523
|
-
*/
|
|
524
|
-
taskIds?: string[];
|
|
525
|
-
/**
|
|
526
|
-
* Optional array of Cycle IDs that are children of this cycle, allowing for hierarchies (e.g., Q1 containing Sprint 1, Sprint 2, Sprint 3). (10 timestamp + 1 dash + 5 'cycle' + 1 dash + max 50 slug = 67 max)
|
|
527
|
-
*/
|
|
528
|
-
childCycleIds?: string[];
|
|
529
|
-
/**
|
|
530
|
-
* Optional list of key:value tags for categorization (e.g., 'roadmap:q4', 'team:alpha', 'okr:growth').
|
|
531
|
-
*/
|
|
532
|
-
tags?: string[];
|
|
533
|
-
/**
|
|
534
|
-
* Optional description of the cycle's goals, objectives, and context
|
|
535
|
-
*/
|
|
536
|
-
notes?: string;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* This file was automatically generated from execution_record_schema.json.
|
|
541
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source schema,
|
|
542
|
-
* and run 'pnpm compile:types' to regenerate this file.
|
|
543
|
-
*/
|
|
544
|
-
/**
|
|
545
|
-
* Canonical schema for execution log records - the universal event stream
|
|
546
|
-
*/
|
|
547
|
-
interface ExecutionRecord<TMetadata = object> {
|
|
548
|
-
/**
|
|
549
|
-
* Unique identifier for the execution log entry (10 timestamp + 1 dash + 4 'exec' + 1 dash + max 50 slug = 66 max)
|
|
550
|
-
*/
|
|
551
|
-
id: string;
|
|
552
|
-
/**
|
|
553
|
-
* ID of the parent task this execution belongs to (10 timestamp + 1 dash + 4 'task' + 1 dash + max 50 slug = 66 max)
|
|
554
|
-
*/
|
|
555
|
-
taskId: string;
|
|
556
|
-
/**
|
|
557
|
-
* Semantic classification of the execution event
|
|
558
|
-
*/
|
|
559
|
-
type: 'analysis' | 'progress' | 'blocker' | 'completion' | 'info' | 'correction';
|
|
560
|
-
/**
|
|
561
|
-
* Human-readable title for the execution (used to generate ID)
|
|
562
|
-
*/
|
|
563
|
-
title: string;
|
|
564
|
-
/**
|
|
565
|
-
* The tangible, verifiable output or result of the execution.
|
|
566
|
-
* This is the "WHAT" - evidence of work or event summary.
|
|
567
|
-
*
|
|
568
|
-
*/
|
|
569
|
-
result: string;
|
|
570
|
-
/**
|
|
571
|
-
* Optional narrative, context and decisions behind the execution.
|
|
572
|
-
* This is the "HOW" and "WHY" - the story behind the result.
|
|
573
|
-
*
|
|
574
|
-
*/
|
|
575
|
-
notes?: string;
|
|
576
|
-
/**
|
|
577
|
-
* Optional list of typed references to relevant commits, files, PRs, or external documents.
|
|
578
|
-
* Should use typed prefixes for clarity and trazabilidad (see execution_protocol_appendix.md):
|
|
579
|
-
* - commit: Git commit SHA
|
|
580
|
-
* - pr: Pull Request number
|
|
581
|
-
* - file: File path (relative to repo root)
|
|
582
|
-
* - url: External URL
|
|
583
|
-
* - issue: GitHub Issue number
|
|
584
|
-
* - task: TaskRecord ID
|
|
585
|
-
* - exec: ExecutionRecord ID (for corrections or dependencies)
|
|
586
|
-
* - changelog: ChangelogRecord ID
|
|
587
|
-
*
|
|
588
|
-
*/
|
|
589
|
-
references?: string[];
|
|
590
|
-
/**
|
|
591
|
-
* Optional structured data for machine consumption.
|
|
592
|
-
* Use this field for data that needs to be programmatically processed (e.g., audit findings,
|
|
593
|
-
* performance metrics, scan results). This complements result (human-readable WHAT) and
|
|
594
|
-
* notes (narrative HOW/WHY) by providing structured, queryable data.
|
|
595
|
-
* Common use cases: audit findings arrays, performance metrics, tool outputs, scan summaries.
|
|
596
|
-
*
|
|
597
|
-
*/
|
|
598
|
-
metadata?: TMetadata;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
* This file was automatically generated from feedback_record_schema.json.
|
|
603
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source schema,
|
|
604
|
-
* and run 'pnpm compile:types' to regenerate this file.
|
|
605
|
-
*/
|
|
606
|
-
/**
|
|
607
|
-
* Canonical schema for feedback records - structured conversation about work
|
|
608
|
-
*/
|
|
609
|
-
interface FeedbackRecord<TMetadata = object> {
|
|
610
|
-
/**
|
|
611
|
-
* Unique identifier for the feedback entry
|
|
612
|
-
*/
|
|
613
|
-
id: string;
|
|
614
|
-
/**
|
|
615
|
-
* The type of entity this feedback refers to
|
|
616
|
-
*/
|
|
617
|
-
entityType: 'task' | 'execution' | 'changelog' | 'feedback' | 'cycle';
|
|
618
|
-
/**
|
|
619
|
-
* The ID of the entity this feedback refers to.
|
|
620
|
-
* Must match the pattern for its entityType:
|
|
621
|
-
* - task: ^\d{10}-task-[a-z0-9-]{1,50}$
|
|
622
|
-
* - execution: ^\d{10}-exec-[a-z0-9-]{1,50}$
|
|
623
|
-
* - changelog: ^\d{10}-changelog-[a-z0-9-]{1,50}$
|
|
624
|
-
* - feedback: ^\d{10}-feedback-[a-z0-9-]{1,50}$
|
|
625
|
-
* - cycle: ^\d{10}-cycle-[a-z0-9-]{1,50}$
|
|
626
|
-
*
|
|
627
|
-
*/
|
|
628
|
-
entityId: string;
|
|
629
|
-
/**
|
|
630
|
-
* The semantic intent of the feedback
|
|
631
|
-
*/
|
|
632
|
-
type: 'blocking' | 'suggestion' | 'question' | 'approval' | 'clarification' | 'assignment';
|
|
633
|
-
/**
|
|
634
|
-
* The lifecycle status of the feedback.
|
|
635
|
-
* Note: FeedbackRecords are immutable. To change status, create a new feedback
|
|
636
|
-
* that references this one using entityType: "feedback" and resolvesFeedbackId.
|
|
637
|
-
*
|
|
638
|
-
*/
|
|
639
|
-
status: 'open' | 'acknowledged' | 'resolved' | 'wontfix';
|
|
640
|
-
/**
|
|
641
|
-
* The content of the feedback. Reduced from 10000 to 5000 chars for practical use.
|
|
642
|
-
*/
|
|
643
|
-
content: string;
|
|
644
|
-
/**
|
|
645
|
-
* Optional. The Actor ID responsible for addressing the feedback (e.g., 'human:maria', 'agent:camilo:cursor')
|
|
646
|
-
*/
|
|
647
|
-
assignee?: string;
|
|
648
|
-
/**
|
|
649
|
-
* Optional. The ID of another feedback record that this one resolves or responds to
|
|
650
|
-
*/
|
|
651
|
-
resolvesFeedbackId?: string;
|
|
652
|
-
/**
|
|
653
|
-
* Optional structured data for machine consumption.
|
|
654
|
-
* Use this field for domain-specific data that needs to be programmatically processed.
|
|
655
|
-
* Common use cases: waiver details (fingerprint, ruleId, file, line), approval context, assignment metadata.
|
|
656
|
-
*
|
|
657
|
-
*/
|
|
658
|
-
metadata?: TMetadata;
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
/**
|
|
662
|
-
* This file was automatically generated from task_record_schema.json.
|
|
663
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source schema,
|
|
664
|
-
* and run 'pnpm compile:types' to regenerate this file.
|
|
665
|
-
*/
|
|
666
|
-
/**
|
|
667
|
-
* Canonical schema for task records as defined in task_protocol.md
|
|
668
|
-
*/
|
|
669
|
-
interface TaskRecord {
|
|
670
|
-
/**
|
|
671
|
-
* Unique identifier for the task (10 timestamp + 1 dash + 4 'task' + 1 dash + max 50 slug = 66 max)
|
|
672
|
-
*/
|
|
673
|
-
id: string;
|
|
674
|
-
/**
|
|
675
|
-
* A brief, human-readable title for the task. Used to generate the ID slug.
|
|
676
|
-
*/
|
|
677
|
-
title: string;
|
|
678
|
-
/**
|
|
679
|
-
* Optional. The IDs of the strategic cycles this task belongs to. (10 timestamp + 1 dash + 5 'cycle' + 1 dash + max 50 slug = 67 max)
|
|
680
|
-
*/
|
|
681
|
-
cycleIds?: string[];
|
|
682
|
-
/**
|
|
683
|
-
* Current state of the task in the institutional flow
|
|
684
|
-
*/
|
|
685
|
-
status: 'draft' | 'review' | 'ready' | 'active' | 'done' | 'archived' | 'paused' | 'discarded';
|
|
686
|
-
/**
|
|
687
|
-
* Strategic or tactical priority level
|
|
688
|
-
*/
|
|
689
|
-
priority: 'low' | 'medium' | 'high' | 'critical';
|
|
690
|
-
/**
|
|
691
|
-
* Functional, technical or strategic summary of the objective
|
|
692
|
-
*/
|
|
693
|
-
description: string;
|
|
694
|
-
/**
|
|
695
|
-
* Optional. List of key:value tags for categorization and role suggestion (e.g., 'skill:react', 'role:agent:developer').
|
|
696
|
-
*/
|
|
697
|
-
tags?: string[];
|
|
698
|
-
/**
|
|
699
|
-
* Valid links or files, when mentioned
|
|
700
|
-
*/
|
|
701
|
-
references?: string[];
|
|
702
|
-
/**
|
|
703
|
-
* Additional comments, decisions made or added context
|
|
704
|
-
*/
|
|
705
|
-
notes?: string;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
/**
|
|
709
|
-
* This file was automatically generated from embedded_metadata_schema.json.
|
|
710
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source schema,
|
|
711
|
-
* and run 'pnpm compile:types' to regenerate this file.
|
|
712
|
-
*/
|
|
713
|
-
/**
|
|
714
|
-
* Canonical schema for the wrapper structure of all GitGovernance records.
|
|
715
|
-
*/
|
|
716
|
-
type EmbeddedMetadataRecord$1 = {
|
|
717
|
-
header: {
|
|
718
|
-
/**
|
|
719
|
-
* Version of the embedded metadata format.
|
|
720
|
-
*/
|
|
721
|
-
version: '1.0';
|
|
722
|
-
/**
|
|
723
|
-
* The type of the record contained in the payload.
|
|
724
|
-
*/
|
|
725
|
-
type: 'actor' | 'agent' | 'task' | 'execution' | 'changelog' | 'feedback' | 'cycle' | 'custom';
|
|
726
|
-
/**
|
|
727
|
-
* Optional URL to a custom schema for the payload.
|
|
728
|
-
*/
|
|
729
|
-
schemaUrl?: string;
|
|
730
|
-
/**
|
|
731
|
-
* Optional SHA-256 checksum of the custom schema.
|
|
732
|
-
*/
|
|
733
|
-
schemaChecksum?: string;
|
|
734
|
-
/**
|
|
735
|
-
* SHA-256 checksum of the canonically serialized payload.
|
|
736
|
-
*/
|
|
737
|
-
payloadChecksum: string;
|
|
738
|
-
/**
|
|
739
|
-
* An array of one or more signature objects.
|
|
740
|
-
*
|
|
741
|
-
* @minItems 1
|
|
742
|
-
*/
|
|
743
|
-
signatures: [
|
|
744
|
-
{
|
|
745
|
-
/**
|
|
746
|
-
* The Actor ID of the signer (must match ActorRecord.id pattern).
|
|
747
|
-
*/
|
|
748
|
-
keyId: string;
|
|
749
|
-
/**
|
|
750
|
-
* The context role of the signature (e.g., 'author', 'reviewer', 'auditor', or 'custom:*').
|
|
751
|
-
*/
|
|
752
|
-
role: string;
|
|
753
|
-
/**
|
|
754
|
-
* Human-readable note from the signer. Part of the signature digest.
|
|
755
|
-
*/
|
|
756
|
-
notes: string;
|
|
757
|
-
/**
|
|
758
|
-
* The Ed25519 signature (base64 encoded, 88 chars with padding) of the signature digest.
|
|
759
|
-
*/
|
|
760
|
-
signature: string;
|
|
761
|
-
/**
|
|
762
|
-
* Unix timestamp of the signature.
|
|
763
|
-
*/
|
|
764
|
-
timestamp: number;
|
|
765
|
-
},
|
|
766
|
-
...{
|
|
767
|
-
/**
|
|
768
|
-
* The Actor ID of the signer (must match ActorRecord.id pattern).
|
|
769
|
-
*/
|
|
770
|
-
keyId: string;
|
|
771
|
-
/**
|
|
772
|
-
* The context role of the signature (e.g., 'author', 'reviewer', 'auditor', or 'custom:*').
|
|
773
|
-
*/
|
|
774
|
-
role: string;
|
|
775
|
-
/**
|
|
776
|
-
* Human-readable note from the signer. Part of the signature digest.
|
|
777
|
-
*/
|
|
778
|
-
notes: string;
|
|
779
|
-
/**
|
|
780
|
-
* The Ed25519 signature (base64 encoded, 88 chars with padding) of the signature digest.
|
|
781
|
-
*/
|
|
782
|
-
signature: string;
|
|
783
|
-
/**
|
|
784
|
-
* Unix timestamp of the signature.
|
|
785
|
-
*/
|
|
786
|
-
timestamp: number;
|
|
787
|
-
}[]
|
|
788
|
-
];
|
|
789
|
-
};
|
|
790
|
-
/**
|
|
791
|
-
* The specific record data, validated against the schema defined by header.type.
|
|
792
|
-
*/
|
|
793
|
-
payload: {};
|
|
794
|
-
} & {
|
|
795
|
-
[k: string]: unknown | undefined;
|
|
796
|
-
};
|
|
797
|
-
|
|
798
|
-
/**
|
|
799
|
-
* Extract Signature type from the auto-generated base type.
|
|
800
|
-
* This is hardcoded solution but avoids duplication and uses the generated type as source of truth.
|
|
801
|
-
*/
|
|
802
|
-
type Signature = EmbeddedMetadataRecord$1['header']['signatures'][0];
|
|
803
|
-
/**
|
|
804
|
-
* Extract Header type from the auto-generated base type.
|
|
805
|
-
* This is the complete header structure for EmbeddedMetadata.
|
|
806
|
-
*/
|
|
807
|
-
type EmbeddedMetadataHeader = EmbeddedMetadataRecord$1['header'];
|
|
808
|
-
/**
|
|
809
|
-
* Generic version of EmbeddedMetadataRecord that accepts any payload type T.
|
|
810
|
-
* This extends the auto-generated base type but makes the payload generic.
|
|
811
|
-
* We need to explicitly preserve the header structure due to the index signature in the base type.
|
|
812
|
-
*/
|
|
813
|
-
type EmbeddedMetadataRecord<T extends GitGovRecordPayload> = {
|
|
814
|
-
header: EmbeddedMetadataHeader;
|
|
815
|
-
payload: T;
|
|
816
|
-
};
|
|
817
|
-
|
|
818
|
-
/**
|
|
819
|
-
* A custom record type for testing purposes.
|
|
820
|
-
*/
|
|
821
|
-
type CustomRecord = {
|
|
822
|
-
type: 'custom';
|
|
823
|
-
data: unknown;
|
|
824
|
-
};
|
|
825
|
-
/**
|
|
826
|
-
* Defines the possible 'type' values for any record in the system.
|
|
827
|
-
*/
|
|
828
|
-
type GitGovRecordType = "actor" | "agent" | "cycle" | "task" | "execution" | "changelog" | "feedback" | "custom";
|
|
829
|
-
/**
|
|
830
|
-
* The canonical payload for any GitGovernance record.
|
|
831
|
-
*/
|
|
832
|
-
type GitGovRecordPayload = ActorRecord | AgentRecord | CycleRecord | TaskRecord | ExecutionRecord | ChangelogRecord | FeedbackRecord | CustomRecord;
|
|
833
|
-
/**
|
|
834
|
-
* The canonical type for any record in GitGovernance, wrapping a payload with metadata.
|
|
835
|
-
*/
|
|
836
|
-
type GitGovRecord = EmbeddedMetadataRecord<GitGovRecordPayload>;
|
|
837
|
-
/**
|
|
838
|
-
* Specific GitGov record types with full metadata (header + payload).
|
|
839
|
-
* These types provide clean, type-safe access to records with their signatures and checksums.
|
|
840
|
-
*
|
|
841
|
-
* @example
|
|
842
|
-
* const taskRecord: GitGovTaskRecord = await taskStore.read(taskId);
|
|
843
|
-
* const authorId = taskRecord.header.signatures[0].keyId;
|
|
844
|
-
*/
|
|
845
|
-
type GitGovTaskRecord = EmbeddedMetadataRecord<TaskRecord>;
|
|
846
|
-
type GitGovCycleRecord = EmbeddedMetadataRecord<CycleRecord>;
|
|
847
|
-
type GitGovFeedbackRecord = EmbeddedMetadataRecord<FeedbackRecord>;
|
|
848
|
-
type GitGovExecutionRecord = EmbeddedMetadataRecord<ExecutionRecord>;
|
|
849
|
-
type GitGovChangelogRecord = EmbeddedMetadataRecord<ChangelogRecord>;
|
|
850
|
-
type GitGovActorRecord = EmbeddedMetadataRecord<ActorRecord>;
|
|
851
|
-
type GitGovAgentRecord = EmbeddedMetadataRecord<AgentRecord>;
|
|
852
|
-
type ActorPayload = Partial<ActorRecord>;
|
|
853
|
-
type AgentPayload = Partial<AgentRecord>;
|
|
854
|
-
type CyclePayload = Partial<CycleRecord>;
|
|
855
|
-
type TaskPayload = Partial<TaskRecord>;
|
|
856
|
-
type ExecutionPayload = Partial<ExecutionRecord>;
|
|
857
|
-
type ChangelogPayload = Partial<ChangelogRecord>;
|
|
858
|
-
type FeedbackPayload = Partial<FeedbackRecord>;
|
|
859
|
-
/**
|
|
860
|
-
* Base class for all GitGovernance-specific errors.
|
|
861
|
-
* Centralized here as it's used across multiple modules (schemas, validation, etc.)
|
|
862
|
-
*/
|
|
863
|
-
declare class GitGovError extends Error {
|
|
864
|
-
readonly code: string;
|
|
865
|
-
constructor(message: string, code: string);
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
/**
|
|
869
|
-
* RecordStores - Typed container for all stores
|
|
870
|
-
*
|
|
871
|
-
* Allows injecting multiple stores to modules that need them.
|
|
872
|
-
* Keys correspond to directory names in .gitgov/
|
|
873
|
-
*
|
|
874
|
-
* All stores are OPTIONAL.
|
|
875
|
-
* Reason: LintModule.lint(stores) can receive only relevant stores.
|
|
876
|
-
* Example: To validate only tasks, pass { tasks: taskStore }.
|
|
877
|
-
* The module iterates over Object.entries(stores) and skips undefined.
|
|
878
|
-
*/
|
|
879
|
-
type RecordStores$1 = {
|
|
880
|
-
actors?: RecordStore<GitGovActorRecord>;
|
|
881
|
-
agents?: RecordStore<GitGovAgentRecord>;
|
|
882
|
-
tasks?: RecordStore<GitGovTaskRecord>;
|
|
883
|
-
cycles?: RecordStore<GitGovCycleRecord>;
|
|
884
|
-
executions?: RecordStore<GitGovExecutionRecord>;
|
|
885
|
-
feedbacks?: RecordStore<GitGovFeedbackRecord>;
|
|
886
|
-
changelogs?: RecordStore<GitGovChangelogRecord>;
|
|
887
|
-
};
|
|
888
|
-
|
|
889
|
-
/**
|
|
890
|
-
* MetricsAdapter Dependencies - Facade + Dependency Injection Pattern
|
|
891
|
-
*/
|
|
892
|
-
type MetricsAdapterDependencies = {
|
|
893
|
-
stores: Required<Pick<RecordStores$1, 'tasks' | 'cycles' | 'feedbacks' | 'executions' | 'actors'>>;
|
|
894
|
-
platformApi?: IPlatformApi;
|
|
895
|
-
};
|
|
896
|
-
interface IPlatformApi {
|
|
897
|
-
getTokenConsumption(timeframe: string): Promise<TokenConsumption[]>;
|
|
898
|
-
}
|
|
899
|
-
type TokenConsumption = {
|
|
900
|
-
agentId: string;
|
|
901
|
-
tokens: number;
|
|
902
|
-
cost: number;
|
|
903
|
-
timestamp: number;
|
|
904
|
-
};
|
|
905
|
-
type SystemStatus = {
|
|
906
|
-
tasks: {
|
|
907
|
-
total: number;
|
|
908
|
-
byStatus: Record<string, number>;
|
|
909
|
-
byPriority: Record<string, number>;
|
|
910
|
-
};
|
|
911
|
-
cycles: {
|
|
912
|
-
total: number;
|
|
913
|
-
active: number;
|
|
914
|
-
completed: number;
|
|
915
|
-
};
|
|
916
|
-
health: {
|
|
917
|
-
overallScore: number;
|
|
918
|
-
blockedTasks: number;
|
|
919
|
-
staleTasks: number;
|
|
920
|
-
};
|
|
921
|
-
};
|
|
922
|
-
type TaskHealthReport = {
|
|
923
|
-
taskId: string;
|
|
924
|
-
healthScore: number;
|
|
925
|
-
timeInCurrentStage: number;
|
|
926
|
-
stalenessIndex: number;
|
|
927
|
-
blockingFeedbacks: number;
|
|
928
|
-
lastActivity: number;
|
|
929
|
-
recommendations: string[];
|
|
930
|
-
};
|
|
931
|
-
type ProductivityMetrics = {
|
|
932
|
-
throughput: number;
|
|
933
|
-
leadTime: number;
|
|
934
|
-
cycleTime: number;
|
|
935
|
-
tasksCompleted7d: number;
|
|
936
|
-
averageCompletionTime: number;
|
|
937
|
-
};
|
|
938
|
-
type CollaborationMetrics = {
|
|
939
|
-
activeAgents: number;
|
|
940
|
-
totalAgents: number;
|
|
941
|
-
agentUtilization: number;
|
|
942
|
-
humanAgentRatio: number;
|
|
943
|
-
collaborationIndex: number;
|
|
944
|
-
};
|
|
945
|
-
/**
|
|
946
|
-
* MetricsAdapter Interface - The System Analyst
|
|
947
|
-
*/
|
|
948
|
-
interface IMetricsAdapter {
|
|
949
|
-
getSystemStatus(): Promise<SystemStatus>;
|
|
950
|
-
getTaskHealth(taskId: string): Promise<TaskHealthReport>;
|
|
951
|
-
getProductivityMetrics(): Promise<ProductivityMetrics>;
|
|
952
|
-
getCollaborationMetrics(): Promise<CollaborationMetrics>;
|
|
953
|
-
calculateTimeInCurrentStage(task: TaskRecord): number;
|
|
954
|
-
calculateStalenessIndex(tasks: TaskRecord[]): number;
|
|
955
|
-
calculateBlockingFeedbackAge(feedback: FeedbackRecord[]): number;
|
|
956
|
-
calculateHealth(tasks: TaskRecord[]): number;
|
|
957
|
-
calculateBacklogDistribution(tasks: TaskRecord[]): Record<string, number>;
|
|
958
|
-
calculateTasksCreatedToday(tasks: TaskRecord[]): number;
|
|
959
|
-
calculateThroughput(tasks: TaskRecord[]): number;
|
|
960
|
-
calculateLeadTime(tasks: TaskRecord[]): number;
|
|
961
|
-
calculateCycleTime(tasks: TaskRecord[]): number;
|
|
962
|
-
calculateActiveAgents(actors: ActorRecord[], executions: ExecutionRecord[]): number;
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
/**
|
|
966
|
-
* MetricsAdapter - The System Analyst
|
|
967
|
-
*
|
|
968
|
-
* Implements Facade + Dependency Injection Pattern for testeable and configurable orchestration.
|
|
969
|
-
* Acts as Mediator between analytics system and multi-store data sources.
|
|
970
|
-
*/
|
|
971
|
-
declare class MetricsAdapter implements IMetricsAdapter {
|
|
972
|
-
private stores;
|
|
973
|
-
private platformApi;
|
|
974
|
-
constructor(dependencies: MetricsAdapterDependencies);
|
|
975
|
-
/**
|
|
976
|
-
* [EARS-A1] Gets aggregated system status using Tier 1 metrics.
|
|
977
|
-
*/
|
|
978
|
-
getSystemStatus(): Promise<SystemStatus>;
|
|
979
|
-
/**
|
|
980
|
-
* [EARS-A2] Gets task health analysis using Tier 1 metrics.
|
|
981
|
-
*/
|
|
982
|
-
getTaskHealth(taskId: string): Promise<TaskHealthReport>;
|
|
983
|
-
/**
|
|
984
|
-
* [EARS-E1] Gets productivity metrics using Tier 2 calculations.
|
|
985
|
-
*/
|
|
986
|
-
getProductivityMetrics(): Promise<ProductivityMetrics>;
|
|
987
|
-
/**
|
|
988
|
-
* [EARS-E2] Gets collaboration metrics with agent activity analysis.
|
|
989
|
-
*/
|
|
990
|
-
getCollaborationMetrics(): Promise<CollaborationMetrics>;
|
|
991
|
-
/**
|
|
992
|
-
* [EARS-B1] Calculates exact days since last state change.
|
|
993
|
-
*/
|
|
994
|
-
calculateTimeInCurrentStage(task: TaskRecord): number;
|
|
995
|
-
/**
|
|
996
|
-
* [EARS-B2] Calculates days since last ExecutionRecord.
|
|
997
|
-
*/
|
|
998
|
-
calculateStalenessIndex(tasks: TaskRecord[]): number;
|
|
999
|
-
/**
|
|
1000
|
-
* [EARS-B3] Calculates days of oldest active blocking feedback.
|
|
1001
|
-
*/
|
|
1002
|
-
calculateBlockingFeedbackAge(feedback: FeedbackRecord[]): number;
|
|
1003
|
-
/**
|
|
1004
|
-
* [EARS-B4] Calculates health percentage using improved protocol formula.
|
|
1005
|
-
*/
|
|
1006
|
-
calculateHealth(tasks: TaskRecord[]): number;
|
|
1007
|
-
/**
|
|
1008
|
-
* [EARS-B5] Returns status distribution with percentages.
|
|
1009
|
-
*/
|
|
1010
|
-
calculateBacklogDistribution(tasks: TaskRecord[]): Record<string, number>;
|
|
1011
|
-
/**
|
|
1012
|
-
* [EARS-B6] Counts tasks created in last 24 hours.
|
|
1013
|
-
*/
|
|
1014
|
-
calculateTasksCreatedToday(tasks: TaskRecord[]): number;
|
|
1015
|
-
/**
|
|
1016
|
-
* [EARS-D1] Counts tasks moved to 'done' in last 7 days.
|
|
1017
|
-
*/
|
|
1018
|
-
calculateThroughput(tasks: TaskRecord[]): number;
|
|
1019
|
-
/**
|
|
1020
|
-
* [EARS-D2] Calculates average done-draft time for lead time.
|
|
1021
|
-
*/
|
|
1022
|
-
calculateLeadTime(tasks: TaskRecord[]): number;
|
|
1023
|
-
/**
|
|
1024
|
-
* [EARS-D3] Calculates average done-active time for cycle time.
|
|
1025
|
-
*/
|
|
1026
|
-
calculateCycleTime(tasks: TaskRecord[]): number;
|
|
1027
|
-
/**
|
|
1028
|
-
* [EARS-D4] Counts unique agents with executions in 24h.
|
|
1029
|
-
*/
|
|
1030
|
-
calculateActiveAgents(actors: ActorRecord[], executions: ExecutionRecord[]): number;
|
|
1031
|
-
/**
|
|
1032
|
-
* Extracts timestamp from ID (format: {timestamp}-{type}-{slug})
|
|
1033
|
-
*/
|
|
1034
|
-
private getTimestampFromId;
|
|
1035
|
-
/**
|
|
1036
|
-
* Counts tasks by status
|
|
1037
|
-
*/
|
|
1038
|
-
private countTasksByStatus;
|
|
1039
|
-
/**
|
|
1040
|
-
* Counts tasks by priority
|
|
1041
|
-
*/
|
|
1042
|
-
private countTasksByPriority;
|
|
1043
|
-
/**
|
|
1044
|
-
* [EARS-C3] Throws NotImplementedError for Tier 3 functions.
|
|
1045
|
-
*/
|
|
1046
|
-
calculateQuality(_tasks: TaskRecord[]): number;
|
|
1047
|
-
calculateReworkRate(_tasks: TaskRecord[]): number;
|
|
1048
|
-
calculateCompletionRate(_tasks: TaskRecord[]): number;
|
|
1049
|
-
calculateAuditScoreDistribution(_tasks: TaskRecord[]): Record<string, number>;
|
|
1050
|
-
calculateEpicPromotionRate(_tasks: TaskRecord[]): number;
|
|
1051
|
-
calculateTaskRefinementRate(_tasks: TaskRecord[]): number;
|
|
1052
|
-
calculatePlanningAccuracy(_tasks: TaskRecord[]): number;
|
|
1053
|
-
calculateDependencyDiscoveryRate(_tasks: TaskRecord[]): number;
|
|
1054
|
-
/**
|
|
1055
|
-
* [EARS-C4] Returns null for Premium metrics without Platform API.
|
|
1056
|
-
*/
|
|
1057
|
-
calculateCostBurnRate(_consumption: TokenConsumption[]): number;
|
|
1058
|
-
calculateTokenConsumption(_consumption: TokenConsumption[]): number;
|
|
1059
|
-
calculateTokenConsumptionByAgent(_consumption: TokenConsumption[]): Record<string, number>;
|
|
1060
|
-
calculateAiAccuracyRate(_tasks: TaskRecord[], _feedback: FeedbackRecord[]): number;
|
|
1061
|
-
calculateAgentExecutionTime(_executions: ExecutionRecord[]): number;
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
/**
|
|
1065
|
-
* Event Bus types for GitGovernance event-driven architecture
|
|
1066
|
-
*/
|
|
1067
|
-
/**
|
|
1068
|
-
* Event metadata for ordering and debugging
|
|
1069
|
-
*/
|
|
1070
|
-
type EventMetadata = {
|
|
1071
|
-
/** Unique event identifier */
|
|
1072
|
-
eventId: string;
|
|
1073
|
-
/** Event creation timestamp */
|
|
1074
|
-
timestamp: number;
|
|
1075
|
-
/** Event processing timestamp (set by handlers) */
|
|
1076
|
-
processedAt?: number;
|
|
1077
|
-
/** Source adapter that emitted the event */
|
|
1078
|
-
sourceAdapter: string;
|
|
1079
|
-
/** Sequence number for ordering (optional) */
|
|
1080
|
-
sequenceNumber?: number;
|
|
1081
|
-
};
|
|
1082
|
-
/**
|
|
1083
|
-
* Base event structure
|
|
1084
|
-
*/
|
|
1085
|
-
type BaseEvent = {
|
|
1086
|
-
/** Event type identifier */
|
|
1087
|
-
type: string;
|
|
1088
|
-
/** Event timestamp */
|
|
1089
|
-
timestamp: number;
|
|
1090
|
-
/** Event payload */
|
|
1091
|
-
payload: unknown;
|
|
1092
|
-
/** Source that emitted the event */
|
|
1093
|
-
source: string;
|
|
1094
|
-
/** Event metadata for ordering and debugging */
|
|
1095
|
-
metadata?: EventMetadata;
|
|
1096
|
-
};
|
|
1097
|
-
|
|
1098
|
-
type TaskCreatedEvent = BaseEvent & {
|
|
1099
|
-
type: 'task.created';
|
|
1100
|
-
payload: {
|
|
1101
|
-
taskId: string;
|
|
1102
|
-
triggeredBy: string;
|
|
1103
|
-
};
|
|
1104
|
-
};
|
|
1105
|
-
type TaskStatusChangedEvent = BaseEvent & {
|
|
1106
|
-
type: 'task.status.changed';
|
|
1107
|
-
payload: {
|
|
1108
|
-
taskId: string;
|
|
1109
|
-
oldStatus: TaskRecord['status'];
|
|
1110
|
-
newStatus: TaskRecord['status'];
|
|
1111
|
-
triggeredBy: string;
|
|
1112
|
-
reason?: string;
|
|
1113
|
-
};
|
|
1114
|
-
};
|
|
1115
|
-
|
|
1116
|
-
type CycleCreatedEvent = BaseEvent & {
|
|
1117
|
-
type: 'cycle.created';
|
|
1118
|
-
payload: {
|
|
1119
|
-
cycleId: string;
|
|
1120
|
-
triggeredBy: string;
|
|
1121
|
-
};
|
|
1122
|
-
};
|
|
1123
|
-
type CycleStatusChangedEvent = BaseEvent & {
|
|
1124
|
-
type: 'cycle.status.changed';
|
|
1125
|
-
payload: {
|
|
1126
|
-
cycleId: string;
|
|
1127
|
-
oldStatus: CycleRecord['status'];
|
|
1128
|
-
newStatus: CycleRecord['status'];
|
|
1129
|
-
triggeredBy: string;
|
|
1130
|
-
};
|
|
1131
|
-
};
|
|
1132
|
-
|
|
1133
|
-
type ExecutionCreatedEvent = BaseEvent & {
|
|
1134
|
-
type: 'execution.created';
|
|
1135
|
-
payload: Pick<ExecutionRecord, 'taskId' | 'type' | 'title'> & {
|
|
1136
|
-
executionId: string;
|
|
1137
|
-
triggeredBy: string;
|
|
1138
|
-
isFirstExecution: boolean;
|
|
1139
|
-
};
|
|
1140
|
-
};
|
|
1141
|
-
|
|
1142
|
-
type FeedbackCreatedEvent = BaseEvent & {
|
|
1143
|
-
type: 'feedback.created';
|
|
1144
|
-
payload: Pick<FeedbackRecord, 'entityType' | 'entityId' | 'type' | 'status' | 'content' | 'assignee' | 'resolvesFeedbackId'> & {
|
|
1145
|
-
feedbackId: string;
|
|
1146
|
-
triggeredBy: string;
|
|
1147
|
-
};
|
|
1148
|
-
};
|
|
1149
|
-
|
|
1150
|
-
type ChangelogCreatedEvent = BaseEvent & {
|
|
1151
|
-
type: 'changelog.created';
|
|
1152
|
-
payload: Pick<ChangelogRecord, 'relatedTasks' | 'title' | 'version'> & {
|
|
1153
|
-
changelogId: string;
|
|
1154
|
-
};
|
|
1155
|
-
};
|
|
1156
|
-
|
|
1157
|
-
type ActorCreatedEvent = BaseEvent & {
|
|
1158
|
-
type: 'identity.actor.created';
|
|
1159
|
-
payload: Pick<ActorRecord, 'type' | 'publicKey' | 'roles'> & {
|
|
1160
|
-
actorId: string;
|
|
1161
|
-
isBootstrap: boolean;
|
|
1162
|
-
};
|
|
1163
|
-
};
|
|
1164
|
-
type ActorRevokedEvent = BaseEvent & {
|
|
1165
|
-
type: 'identity.actor.revoked';
|
|
1166
|
-
payload: Pick<ActorRecord, 'supersededBy'> & {
|
|
1167
|
-
actorId: string;
|
|
1168
|
-
revokedBy: string;
|
|
1169
|
-
revocationReason: 'compromised' | 'rotation' | 'manual';
|
|
1170
|
-
};
|
|
1171
|
-
};
|
|
1172
|
-
type AgentRegisteredEvent = BaseEvent & {
|
|
1173
|
-
type: 'identity.agent.registered';
|
|
1174
|
-
payload: Pick<AgentRecord, 'engine'> & {
|
|
1175
|
-
agentId: string;
|
|
1176
|
-
correspondingActorId: string;
|
|
1177
|
-
};
|
|
1178
|
-
};
|
|
1179
|
-
/**
|
|
1180
|
-
* System events
|
|
1181
|
-
*/
|
|
1182
|
-
type SystemDailyTickEvent = BaseEvent & {
|
|
1183
|
-
type: 'system.daily_tick';
|
|
1184
|
-
payload: {
|
|
1185
|
-
date: string;
|
|
1186
|
-
};
|
|
1187
|
-
};
|
|
1188
|
-
/**
|
|
1189
|
-
* Union type of all possible events
|
|
1190
|
-
*/
|
|
1191
|
-
type GitGovEvent = TaskCreatedEvent | TaskStatusChangedEvent | CycleCreatedEvent | CycleStatusChangedEvent | ExecutionCreatedEvent | FeedbackCreatedEvent | ChangelogCreatedEvent | ActorCreatedEvent | ActorRevokedEvent | AgentRegisteredEvent | SystemDailyTickEvent;
|
|
1192
|
-
/**
|
|
1193
|
-
* Event handler function type
|
|
1194
|
-
*/
|
|
1195
|
-
type EventHandler<T extends BaseEvent = BaseEvent> = (event: T) => void | Promise<void>;
|
|
1196
|
-
/**
|
|
1197
|
-
* Event subscription
|
|
1198
|
-
*/
|
|
1199
|
-
type EventSubscription = {
|
|
1200
|
-
/** Unique subscription ID */
|
|
1201
|
-
id: string;
|
|
1202
|
-
/** Event type being subscribed to */
|
|
1203
|
-
eventType: string;
|
|
1204
|
-
/** Handler function */
|
|
1205
|
-
handler: EventHandler;
|
|
1206
|
-
/** Subscription metadata */
|
|
1207
|
-
metadata?: {
|
|
1208
|
-
subscriberName?: string;
|
|
1209
|
-
createdAt: number;
|
|
1210
|
-
};
|
|
1211
|
-
};
|
|
1212
|
-
/**
|
|
1213
|
-
* Activity Event for IndexerAdapter activity tracking
|
|
1214
|
-
* Uses discriminated unions for type-safe metadata per event type
|
|
1215
|
-
*/
|
|
1216
|
-
type ActivityEvent = {
|
|
1217
|
-
timestamp: number;
|
|
1218
|
-
type: "task_created";
|
|
1219
|
-
entityId: string;
|
|
1220
|
-
entityTitle: string;
|
|
1221
|
-
actorId?: string;
|
|
1222
|
-
metadata?: {
|
|
1223
|
-
priority?: string;
|
|
1224
|
-
status?: string;
|
|
1225
|
-
};
|
|
1226
|
-
} | {
|
|
1227
|
-
timestamp: number;
|
|
1228
|
-
type: "cycle_created";
|
|
1229
|
-
entityId: string;
|
|
1230
|
-
entityTitle: string;
|
|
1231
|
-
actorId?: string;
|
|
1232
|
-
metadata?: {
|
|
1233
|
-
status?: string;
|
|
1234
|
-
};
|
|
1235
|
-
} | {
|
|
1236
|
-
timestamp: number;
|
|
1237
|
-
type: "feedback_created";
|
|
1238
|
-
entityId: string;
|
|
1239
|
-
entityTitle: string;
|
|
1240
|
-
actorId?: string;
|
|
1241
|
-
metadata?: {
|
|
1242
|
-
type?: string;
|
|
1243
|
-
assignee?: string;
|
|
1244
|
-
resolution?: string;
|
|
1245
|
-
};
|
|
1246
|
-
} | {
|
|
1247
|
-
timestamp: number;
|
|
1248
|
-
type: "changelog_created";
|
|
1249
|
-
entityId: string;
|
|
1250
|
-
entityTitle: string;
|
|
1251
|
-
actorId?: string;
|
|
1252
|
-
metadata?: {
|
|
1253
|
-
version?: string;
|
|
1254
|
-
};
|
|
1255
|
-
} | {
|
|
1256
|
-
timestamp: number;
|
|
1257
|
-
type: "execution_created";
|
|
1258
|
-
entityId: string;
|
|
1259
|
-
entityTitle: string;
|
|
1260
|
-
actorId?: string;
|
|
1261
|
-
metadata?: {
|
|
1262
|
-
executionType?: string;
|
|
1263
|
-
taskId?: string;
|
|
1264
|
-
};
|
|
1265
|
-
} | {
|
|
1266
|
-
timestamp: number;
|
|
1267
|
-
type: "actor_created";
|
|
1268
|
-
entityId: string;
|
|
1269
|
-
entityTitle: string;
|
|
1270
|
-
actorId?: string;
|
|
1271
|
-
metadata?: {
|
|
1272
|
-
type?: string;
|
|
1273
|
-
};
|
|
1274
|
-
} | {
|
|
1275
|
-
timestamp: number;
|
|
1276
|
-
type: "agent_registered";
|
|
1277
|
-
entityId: string;
|
|
1278
|
-
entityTitle: string;
|
|
1279
|
-
actorId?: string;
|
|
1280
|
-
metadata?: Record<string, never>;
|
|
1281
|
-
};
|
|
1282
|
-
|
|
1283
275
|
/**
|
|
1284
276
|
* Event Stream interface - Contract for both Local and Global bus implementations
|
|
1285
277
|
*/
|
|
@@ -1418,188 +410,6 @@ declare function publishEvent(event: GitGovEvent): void;
|
|
|
1418
410
|
*/
|
|
1419
411
|
declare function subscribeToEvent<T extends GitGovEvent>(eventType: T['type'], handler: EventHandler<T>): EventSubscription;
|
|
1420
412
|
|
|
1421
|
-
/**
|
|
1422
|
-
* Collection of all records with full GitGov metadata (headers + payloads).
|
|
1423
|
-
* This allows access to signatures, checksums, and other metadata for enrichment.
|
|
1424
|
-
*
|
|
1425
|
-
* @see GitGovTaskRecord - Full record type with header.signatures for author/lastModifier extraction
|
|
1426
|
-
*/
|
|
1427
|
-
type AllRecords = {
|
|
1428
|
-
tasks: GitGovTaskRecord[];
|
|
1429
|
-
cycles: GitGovCycleRecord[];
|
|
1430
|
-
feedback: GitGovFeedbackRecord[];
|
|
1431
|
-
executions: GitGovExecutionRecord[];
|
|
1432
|
-
changelogs: GitGovChangelogRecord[];
|
|
1433
|
-
actors: GitGovActorRecord[];
|
|
1434
|
-
};
|
|
1435
|
-
/**
|
|
1436
|
-
* System-wide derived states for dashboard analytics and filtering.
|
|
1437
|
-
* Calculated by calculateDerivedStates() during index generation.
|
|
1438
|
-
*
|
|
1439
|
-
* @see derived_data_protocol.md for calculation algorithms
|
|
1440
|
-
*/
|
|
1441
|
-
type DerivedStates = {
|
|
1442
|
-
stalledTasks: string[];
|
|
1443
|
-
atRiskTasks: string[];
|
|
1444
|
-
needsClarificationTasks: string[];
|
|
1445
|
-
blockedByDependencyTasks: string[];
|
|
1446
|
-
};
|
|
1447
|
-
/**
|
|
1448
|
-
* Optimized version of DerivedStates using Sets for O(1) lookup performance.
|
|
1449
|
-
* Used internally by enrichTaskRecord() to efficiently check task membership.
|
|
1450
|
-
*
|
|
1451
|
-
* Conversion from DerivedStates (arrays) to DerivedStateSets (Sets) happens once
|
|
1452
|
-
* in generateIndex() before processing multiple tasks, avoiding repeated O(n) lookups.
|
|
1453
|
-
*/
|
|
1454
|
-
type DerivedStateSets = {
|
|
1455
|
-
stalledTasks: Set<string>;
|
|
1456
|
-
atRiskTasks: Set<string>;
|
|
1457
|
-
needsClarificationTasks: Set<string>;
|
|
1458
|
-
blockedByDependencyTasks: Set<string>;
|
|
1459
|
-
};
|
|
1460
|
-
/**
|
|
1461
|
-
* Enhanced Task Record with complete intelligence layer.
|
|
1462
|
-
* Calculated by enrichTaskRecord() with relationships, metrics, and derived states.
|
|
1463
|
-
*
|
|
1464
|
-
* @see indexer_adapter.md Section 3.6 - EnrichedTaskRecord Specification (EARS 25-48)
|
|
1465
|
-
*/
|
|
1466
|
-
type EnrichedTaskRecord = TaskRecord & {
|
|
1467
|
-
derivedState: {
|
|
1468
|
-
isStalled: boolean;
|
|
1469
|
-
isAtRisk: boolean;
|
|
1470
|
-
needsClarification: boolean;
|
|
1471
|
-
isBlockedByDependency: boolean;
|
|
1472
|
-
healthScore: number;
|
|
1473
|
-
timeInCurrentStage: number;
|
|
1474
|
-
};
|
|
1475
|
-
relationships: {
|
|
1476
|
-
author?: {
|
|
1477
|
-
actorId: string;
|
|
1478
|
-
timestamp: number;
|
|
1479
|
-
};
|
|
1480
|
-
lastModifier?: {
|
|
1481
|
-
actorId: string;
|
|
1482
|
-
timestamp: number;
|
|
1483
|
-
};
|
|
1484
|
-
assignedTo: Array<{
|
|
1485
|
-
actorId: string;
|
|
1486
|
-
assignedAt?: number;
|
|
1487
|
-
}>;
|
|
1488
|
-
dependsOn: string[];
|
|
1489
|
-
blockedBy: string[];
|
|
1490
|
-
cycles: Array<{
|
|
1491
|
-
id: string;
|
|
1492
|
-
title: string;
|
|
1493
|
-
}>;
|
|
1494
|
-
};
|
|
1495
|
-
metrics: {
|
|
1496
|
-
executionCount: number;
|
|
1497
|
-
blockingFeedbackCount: number;
|
|
1498
|
-
openQuestionCount: number;
|
|
1499
|
-
timeToResolution?: number;
|
|
1500
|
-
};
|
|
1501
|
-
release: {
|
|
1502
|
-
isReleased: boolean;
|
|
1503
|
-
lastReleaseVersion?: string;
|
|
1504
|
-
};
|
|
1505
|
-
lastUpdated: number;
|
|
1506
|
-
lastActivityType: 'task_modified' | 'feedback_received' | 'execution_added' | 'changelog_created' | 'task_created';
|
|
1507
|
-
recentActivity?: string;
|
|
1508
|
-
};
|
|
1509
|
-
/**
|
|
1510
|
-
* IndexData - Complete cached index structure.
|
|
1511
|
-
* Generated by generateIndex() and consumed by CLI/Dashboard.
|
|
1512
|
-
*/
|
|
1513
|
-
type IndexData = {
|
|
1514
|
-
metadata: {
|
|
1515
|
-
generatedAt: string;
|
|
1516
|
-
lastCommitHash: string;
|
|
1517
|
-
integrityStatus: 'valid' | 'warnings' | 'errors';
|
|
1518
|
-
recordCounts: Record<string, number>;
|
|
1519
|
-
generationTime: number;
|
|
1520
|
-
};
|
|
1521
|
-
metrics: SystemStatus & ProductivityMetrics & CollaborationMetrics;
|
|
1522
|
-
derivedStates: DerivedStates;
|
|
1523
|
-
activityHistory: ActivityEvent[];
|
|
1524
|
-
tasks: GitGovTaskRecord[];
|
|
1525
|
-
enrichedTasks: EnrichedTaskRecord[];
|
|
1526
|
-
cycles: GitGovCycleRecord[];
|
|
1527
|
-
actors: GitGovActorRecord[];
|
|
1528
|
-
feedback: GitGovFeedbackRecord[];
|
|
1529
|
-
};
|
|
1530
|
-
/**
|
|
1531
|
-
* Integrity validation error types.
|
|
1532
|
-
*/
|
|
1533
|
-
type IntegrityError = {
|
|
1534
|
-
type: 'schema_violation' | 'checksum_failure' | 'signature_invalid';
|
|
1535
|
-
recordId: string;
|
|
1536
|
-
message: string;
|
|
1537
|
-
};
|
|
1538
|
-
/**
|
|
1539
|
-
* Integrity validation warning types.
|
|
1540
|
-
*/
|
|
1541
|
-
type IntegrityWarning = {
|
|
1542
|
-
type: 'missing_reference' | 'deprecated_field' | 'performance_issue';
|
|
1543
|
-
recordId: string;
|
|
1544
|
-
message: string;
|
|
1545
|
-
};
|
|
1546
|
-
/**
|
|
1547
|
-
* Result of validateIntegrity() operation.
|
|
1548
|
-
*/
|
|
1549
|
-
type IntegrityReport = {
|
|
1550
|
-
status: 'valid' | 'warnings' | 'errors';
|
|
1551
|
-
recordsScanned: number;
|
|
1552
|
-
errorsFound: IntegrityError[];
|
|
1553
|
-
warningsFound: IntegrityWarning[];
|
|
1554
|
-
validationTime: number;
|
|
1555
|
-
checksumFailures: number;
|
|
1556
|
-
signatureFailures: number;
|
|
1557
|
-
};
|
|
1558
|
-
/**
|
|
1559
|
-
* Result of generateIndex() operation.
|
|
1560
|
-
*/
|
|
1561
|
-
type IndexGenerationReport = {
|
|
1562
|
-
success: boolean;
|
|
1563
|
-
recordsProcessed: number;
|
|
1564
|
-
metricsCalculated: number;
|
|
1565
|
-
derivedStatesApplied: number;
|
|
1566
|
-
generationTime: number;
|
|
1567
|
-
errors: string[];
|
|
1568
|
-
performance: {
|
|
1569
|
-
readTime: number;
|
|
1570
|
-
calculationTime: number;
|
|
1571
|
-
writeTime: number;
|
|
1572
|
-
};
|
|
1573
|
-
};
|
|
1574
|
-
/**
|
|
1575
|
-
* IndexerAdapter Dependencies - Facade + Dependency Injection Pattern.
|
|
1576
|
-
*
|
|
1577
|
-
* @see indexer_adapter.md Section 2 - Architecture
|
|
1578
|
-
*/
|
|
1579
|
-
type IndexerAdapterDependencies = {
|
|
1580
|
-
metricsAdapter: MetricsAdapter;
|
|
1581
|
-
stores: Required<Pick<RecordStores$1, 'tasks' | 'cycles' | 'feedbacks' | 'executions' | 'changelogs' | 'actors'>>;
|
|
1582
|
-
cacheStore: RecordStore<IndexData>;
|
|
1583
|
-
};
|
|
1584
|
-
/**
|
|
1585
|
-
* IndexerAdapter Interface - The Cache Engine.
|
|
1586
|
-
*/
|
|
1587
|
-
interface IIndexerAdapter {
|
|
1588
|
-
generateIndex(): Promise<IndexGenerationReport>;
|
|
1589
|
-
getIndexData(): Promise<IndexData | null>;
|
|
1590
|
-
validateIntegrity(): Promise<IntegrityReport>;
|
|
1591
|
-
calculateDerivedStates(allRecords: AllRecords): Promise<DerivedStates>;
|
|
1592
|
-
calculateActivityHistory(allRecords: AllRecords): Promise<ActivityEvent[]>;
|
|
1593
|
-
calculateLastUpdated(task: GitGovTaskRecord, relatedRecords: AllRecords): Promise<{
|
|
1594
|
-
lastUpdated: number;
|
|
1595
|
-
lastActivityType: EnrichedTaskRecord['lastActivityType'];
|
|
1596
|
-
recentActivity: string;
|
|
1597
|
-
}>;
|
|
1598
|
-
enrichTaskRecord(task: GitGovTaskRecord, relatedRecords: AllRecords, derivedStateSets: DerivedStateSets): Promise<EnrichedTaskRecord>;
|
|
1599
|
-
isIndexUpToDate(): Promise<boolean>;
|
|
1600
|
-
invalidateCache(): Promise<void>;
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
413
|
/**
|
|
1604
414
|
* Public interface for pure LintModule operations (no I/O).
|
|
1605
415
|
*
|
|
@@ -1701,7 +511,7 @@ interface LintModuleDependencies {
|
|
|
1701
511
|
* Indexing adapter for advanced reference resolution (OPTIONAL)
|
|
1702
512
|
* If not present, reference validations will be limited.
|
|
1703
513
|
*/
|
|
1704
|
-
|
|
514
|
+
projector?: IRecordProjector;
|
|
1705
515
|
}
|
|
1706
516
|
/**
|
|
1707
517
|
* Options for pure record fix operation.
|
|
@@ -2071,8 +881,8 @@ type SyncStateModuleDependencies = {
|
|
|
2071
881
|
identity: IIdentityAdapter;
|
|
2072
882
|
/** Lint module for record validation (required) */
|
|
2073
883
|
lint: ILintModule;
|
|
2074
|
-
/**
|
|
2075
|
-
indexer:
|
|
884
|
+
/** Record projector for automatic re-indexing after pull/resolve (required) */
|
|
885
|
+
indexer: IRecordProjector;
|
|
2076
886
|
};
|
|
2077
887
|
/**
|
|
2078
888
|
* Options for pushState operation
|
|
@@ -2577,4 +1387,4 @@ interface RuntimeHandlerRegistry {
|
|
|
2577
1387
|
*/
|
|
2578
1388
|
type RuntimeHandler = (engine: LocalEngine, ctx: AgentExecutionContext) => Promise<AgentOutput>;
|
|
2579
1389
|
|
|
2580
|
-
export { type
|
|
1390
|
+
export { type ExpectedFilesScope as $, type AuditStateOptions as A, eventBus as B, ConfigManager as C, publishEvent as D, type EnvironmentValidation as E, type FixRecordOptions as F, subscribeToEvent as G, type IIdentityAdapter as H, type ILintModule as I, IdentityAdapter as J, type IdentityAdapterDependencies as K, type LintOptions as L, type LintModuleDependencies as M, type FixResult as N, type LintSummary as O, type ProtocolHandlerRegistry as P, type RecordEntry as Q, type RecordStores as R, SessionManager as S, type ValidatorType as T, type IExecutionAdapter as U, type ValidationContext as V, type ExecutionAdapterDependencies as W, type AuditScope as X, type ConflictFileDiff as Y, type ConflictInfo as Z, type ConflictType as _, type LintReport as a, type AgentExecutionContext as a0, type AgentOutput as a1, type AgentRunnerEvent as a2, type ApiEngine as a3, type AuthConfig as a4, type AuthType as a5, type CustomEngine as a6, type Engine as a7, type EngineType as a8, type IAgentLoader as a9, type LocalEngine as aa, type McpEngine as ab, type ProtocolHandler as ac, type RuntimeHandler as ad, type RuntimeHandlerRegistry as ae, type FixReport as b, type LintRecordContext as c, type LintResult as d, type IProjectInitializer as e, type ISyncStateModule as f, type SyncStateModuleDependencies as g, type StateDeltaFile as h, type ConflictDiff as i, type IntegrityViolation as j, type AuditStateReport as k, type SyncStatePushOptions as l, type SyncStatePushResult as m, type SyncStatePullOptions as n, type SyncStatePullResult as o, type SyncStateResolveOptions as p, type SyncStateResolveResult as q, type IEventStream as r, type IAgentRunner as s, type AgentRunnerDependencies as t, type RunOptions as u, type AgentResponse as v, FsKeyProvider as w, type FsKeyProviderOptions as x, FsFileLister as y, EventBus as z };
|