geloforge 0.0.0-stage → 0.6.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/LICENSE +21 -0
- package/README.md +140 -2
- package/THIRD_PARTY_NOTICES.md +33 -0
- package/VERSION +1 -0
- package/core/adopt-project.mjs +458 -0
- package/core/checkpoint.mjs +438 -0
- package/core/codebase-map.mjs +886 -0
- package/core/compatibility.json +16 -0
- package/core/compatibility.mjs +123 -0
- package/core/context-compiler.mjs +1315 -0
- package/core/evidence-capture.mjs +326 -0
- package/core/git-utils.mjs +167 -0
- package/core/handoff.mjs +815 -0
- package/core/json-schema-lite.mjs +119 -0
- package/core/mcp-init.mjs +248 -0
- package/core/mcp-server.mjs +915 -0
- package/core/path-safety.mjs +508 -0
- package/core/project-locator.mjs +231 -0
- package/core/project-lock.mjs +438 -0
- package/core/project-status.mjs +609 -0
- package/core/project-validator.mjs +544 -0
- package/core/skills-history.mjs +572 -0
- package/core/skills-lifecycle.mjs +2225 -0
- package/core/skills-lint.mjs +365 -0
- package/core/skills.mjs +1449 -0
- package/core/task-manager.mjs +1042 -0
- package/core/template-utils.mjs +190 -0
- package/core/text-utils.mjs +48 -0
- package/core/verify-task.mjs +48 -0
- package/core/yaml-subset.mjs +572 -0
- package/package.json +47 -4
- package/policies/approval-boundaries.md +42 -0
- package/policies/memory-policy.md +53 -0
- package/policies/token-efficiency.md +30 -0
- package/schemas/README.md +43 -0
- package/schemas/adr.schema.json +64 -0
- package/schemas/agent-handoff.schema.json +139 -0
- package/schemas/approval-record.schema.json +101 -0
- package/schemas/conflict-record.schema.json +60 -0
- package/schemas/context-pack-manifest.schema.json +194 -0
- package/schemas/evidence-manifest.schema.json +83 -0
- package/schemas/incident-record.schema.json +53 -0
- package/schemas/project-manifest.schema.json +90 -0
- package/schemas/project-state.schema.json +64 -0
- package/schemas/recovery-checkpoint.schema.json +49 -0
- package/schemas/research-record.schema.json +76 -0
- package/schemas/task-contract.schema.json +95 -0
- package/scripts/bootstrap-project.mjs +357 -0
- package/scripts/geloforge.mjs +2291 -0
- package/templates/profiles/README.md +19 -0
- package/templates/profiles/ai-system/brain/profile.md +21 -0
- package/templates/profiles/ai-system/gitignore.append +5 -0
- package/templates/profiles/ai-system/profile.json +6 -0
- package/templates/profiles/automation/brain/profile.md +19 -0
- package/templates/profiles/automation/gitignore.append +5 -0
- package/templates/profiles/automation/profile.json +6 -0
- package/templates/profiles/desktop/brain/profile.md +21 -0
- package/templates/profiles/desktop/gitignore.append +7 -0
- package/templates/profiles/desktop/profile.json +6 -0
- package/templates/profiles/mobile/brain/profile.md +20 -0
- package/templates/profiles/mobile/gitignore.append +8 -0
- package/templates/profiles/mobile/profile.json +6 -0
- package/templates/profiles/web/brain/profile.md +21 -0
- package/templates/profiles/web/gitignore.append +6 -0
- package/templates/profiles/web/profile.json +6 -0
- package/templates/project-starter/AGENTS.md +26 -0
- package/templates/project-starter/GEMINI.md +16 -0
- package/templates/project-starter/README.md +26 -0
- package/templates/project-starter/brain/INDEX.md +40 -0
- package/templates/project-starter/brain/architecture/overview.md +30 -0
- package/templates/project-starter/brain/decisions/.gitkeep +0 -0
- package/templates/project-starter/brain/manifest.yaml +36 -0
- package/templates/project-starter/brain/requirements/constraints.md +29 -0
- package/templates/project-starter/brain/requirements/prd.md +37 -0
- package/templates/project-starter/brain/state/current.yaml +19 -0
- package/templates/project-starter/gitignore.template +25 -0
- package/templates/project-starter/src/.gitkeep +0 -0
- package/templates/project-starter/tasks/.gitkeep +0 -0
- package/templates/project-starter/tests/.gitkeep +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Memory Architecture, Knowledge Authority, and Write Ownership Policy
|
|
2
|
+
|
|
3
|
+
> **Status:** Governance Specification (`Documented only`) for write ownership and automated promotion.
|
|
4
|
+
> **Important:** **No OS/filesystem-level write enforcement exists in Phase 1.** Local schema, duplicate-ID, and reference validation is provided by [scripts/validate-project.mjs](../scripts/validate-project.mjs).
|
|
5
|
+
|
|
6
|
+
## 1. Provider-Independent Second Brain
|
|
7
|
+
|
|
8
|
+
Project knowledge (`brain/` and `tasks/`) is stored as plain Markdown and YAML inside each project repository—independent of any AI provider's chat history. Entrypoints such as `AGENTS.md` and `GEMINI.md` point to shared project files without duplicating content.
|
|
9
|
+
|
|
10
|
+
## 2. Four Memory Layers
|
|
11
|
+
|
|
12
|
+
| Layer | Enum ID | Contents | Canonical Locations |
|
|
13
|
+
| :--- | :--- | :--- | :--- |
|
|
14
|
+
| **Layer 1** | `L1_AUTHORITATIVE` | Owner-approved requirements, accepted ADRs, constraints, standards | `brain/manifest.yaml`, `brain/requirements/`, `brain/architecture/`, `brain/decisions/`, harness `policies/` |
|
|
15
|
+
| **Layer 2** | `L2_OPERATIONAL` | Active tasks, verified state, blockers, pending approvals, conflicts, incidents, checkpoints | `brain/state/current.yaml`, `tasks/`, optional `brain/conflicts/`, `brain/incidents/`, `proposals/` |
|
|
16
|
+
| **Layer 3** | `L3_RESEARCH_EVIDENCE` | Source-backed findings, lessons learned, verification evidence manifests | Optional `brain/research/`, `brain/lessons/`, `evidence/`, `proposals/` |
|
|
17
|
+
| **Layer 4** | `L4_TEMPORARY_CONTEXT` | Task-specific compiled context packets and source revision references | `<workspace-root>/local-runtime/context-cache/` (**NOT IMPLEMENTED**) |
|
|
18
|
+
|
|
19
|
+
## 3. Knowledge Authority Hierarchy (`A0`–`A6`)
|
|
20
|
+
|
|
21
|
+
| Level | Trust Class | Examples |
|
|
22
|
+
| :--- | :--- | :--- |
|
|
23
|
+
| **A0** | Global harness security rules | [approval-boundaries.md](./approval-boundaries.md), [token-efficiency.md](./token-efficiency.md), [memory-policy.md](./memory-policy.md) |
|
|
24
|
+
| **A1** | Owner-approved requirements | Approved `brain/requirements/prd.md` and `constraints.md` |
|
|
25
|
+
| **A2** | Approved architecture decisions | Accepted `ADR-NNNN` records (`approved_by` + `decided_at`) and approved `brain/architecture/overview.md` |
|
|
26
|
+
| **A3** | Verified implementation & test evidence | Verified `EVID-NNNN` manifests linked to real commands and revisions |
|
|
27
|
+
| **A4** | Operational records | `TASK-NNNN`, `HANDOFF-NNNN`, `brain/state/current.yaml`, `APPR-NNNN`, `CONF-NNNN`, `INC-NNNN`, `CHKPT-NNNN` |
|
|
28
|
+
| **A5** | External research | `RES-NNNN` summaries of external docs or benchmarks (never automatically authoritative) |
|
|
29
|
+
| **A6** | Unverified agent observations | Unchecked notes, hypotheses, or draft proposals lacking `A3` verification |
|
|
30
|
+
|
|
31
|
+
> **CRITICAL RULE:** Authority levels (`A0`–`A6`) represent **trust classes, NOT automatic permission to ignore contradictory evidence**. Any credible contradiction against an `A1`–`A4` record must be logged as a `CONF-NNNN` conflict (`schemas/conflict-record.schema.json`) and reviewed rather than discarded.
|
|
32
|
+
|
|
33
|
+
## 4. Write Ownership Rules (Documented Only — Not Filesystem-Enforced)
|
|
34
|
+
|
|
35
|
+
| Role / Component | Authorized Future Write Scope | Prohibited Direct Canonical Writes |
|
|
36
|
+
| :--- | :--- | :--- |
|
|
37
|
+
| **Researcher** | Drafts `RES-NNNN` and lessons in `proposals/` or `brain/research/` | Must NOT alter `A0`–`A2` records or mark `EVID-NNNN` verified |
|
|
38
|
+
| **Software Architect** | Drafts `ADR-NNNN` and architecture proposals in `proposals/` | Must NOT self-approve `A2` ADRs (`approved_by` requires owner) |
|
|
39
|
+
| **Developer** | Updates assigned `TASK-NNNN`, writes `src/` / `tests/`, emits `HANDOFF-NNNN` | Must NOT alter `A0`–`A2` canonical records or self-certify QA evidence |
|
|
40
|
+
| **QA / Security Reviewer** | Proposes `EVID-NNNN` verification manifests, `CONF-NNNN` conflicts, `INC-NNNN` incidents | Must NOT modify `A1` requirements or grant `APPR-NNNN` approvals |
|
|
41
|
+
| **Orchestrator** | Coordinates `TASK-NNNN`, `HANDOFF-NNNN`, and `proposals/` transitions | Must NOT self-approve `A1`/`A2` changes or skip `APPR-NNNN` |
|
|
42
|
+
| **Restricted Integration Controller** *(**NOT IMPLEMENTED**)* | Sole automated gatekeeper validating approved promotions into `L1`/`L2` | Not built yet; human owner integrates canonical changes manually |
|
|
43
|
+
| **Project Owner** | Approves `A1` requirements, `A2` ADRs, `APPR-NNNN` records, and `CONF-NNNN` resolutions | — |
|
|
44
|
+
|
|
45
|
+
## 5. Future Knowledge Lifecycle (Automatic Promotion NOT Implemented)
|
|
46
|
+
|
|
47
|
+
1. **Propose:** Draft `RES-NNNN`, `ADR-NNNN`, or updates in `proposals/`.
|
|
48
|
+
2. **Validate Evidence:** QA verifies reproducible commands, environment, and limitations in `EVID-NNNN`.
|
|
49
|
+
3. **Detect Contradictions:** Log `CONF-NNNN` whenever evidence or sources contradict existing records.
|
|
50
|
+
4. **Request Approval:** Create `APPR-NNNN` (`pending`) for boundary-crossing or `A1`/`A2` changes.
|
|
51
|
+
5. **Promote Accepted Knowledge:** Manual in Phase 1 (future controller requires approved `APPR-NNNN` + schema pass).
|
|
52
|
+
6. **Preserve History:** Transition outdated ADRs to `status: "superseded"` with bidirectional `supersedes`/`superseded_by` links instead of deleting history.
|
|
53
|
+
7. **Revalidate Stale Records:** Flag expired `RES-NNNN` (`valid_until`) via `validate-project.mjs` warnings before reuse.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Token Efficiency Policy
|
|
2
|
+
|
|
3
|
+
> **Status:** Foundation structural optimizations (`AGENTS.md`/`GEMINI.md` minimal entrypoints, `brain/INDEX.md`, compact handoff/context schemas) are **Implemented**; automated runtime enforcement, token counters, and provider routing are **NOT IMPLEMENTED**.
|
|
4
|
+
> **Measurement Rule:** **No token savings percentages are claimed without empirical measurement** from future provider execution logs.
|
|
5
|
+
|
|
6
|
+
## Structural Efficiencies Established in Phase 1.2
|
|
7
|
+
|
|
8
|
+
1. **Minimal Provider Entrypoints:** `AGENTS.md` and `GEMINI.md` stay under ~25 lines and point to shared `brain/` files instead of repeating full project specifications.
|
|
9
|
+
2. **Relevant-Document Indexing:** `brain/INDEX.md` provides a structured index across layers so future agents locate scoped files without scanning entire repositories.
|
|
10
|
+
3. **No Duplicate Knowledge Across Agents:** Shared Second Brain files are read by reference across all roles and future providers.
|
|
11
|
+
4. **Compact Handoffs & Evidence References:** [agent-handoff.schema.json](../schemas/agent-handoff.schema.json) and [evidence-manifest.schema.json](../schemas/evidence-manifest.schema.json) transfer concise summaries, file paths, and `EVID-NNNN` IDs rather than raw logs or conversation transcripts.
|
|
12
|
+
5. **Task-Specific Context Assembly & Invalidation Contracts:** [context-pack-manifest.schema.json](../schemas/context-pack-manifest.schema.json) and [context-compiler-spec.md](../context/context-compiler-spec.md) specify selective retrieval (`required_inputs`), `omitted_candidates` logging, and `invalidation_triggers` so full-project history loading is unnecessary.
|
|
13
|
+
|
|
14
|
+
## Future Runtime Policy Rules (Not Implemented Yet)
|
|
15
|
+
|
|
16
|
+
- **Avoid Duplicate Research:** Check existing `RES-NNNN` (`status !== "stale"`) before re-investigating; revalidate only past `valid_until` or on conflict (`CONF-NNNN`).
|
|
17
|
+
- **Filter Long Terminal Output:** Future runners should retain raw command logs in `<workspace-root>/local-runtime/logs/` and pass only exit codes, failing assertions, and concise error excerpts into context.
|
|
18
|
+
- **Context Compaction:** Summarize completed milestones into `brain/state/current.yaml`, `HANDOFF-NNNN`, and `CHKPT-NNNN` instead of carrying growing chat transcripts.
|
|
19
|
+
- **Model / Task Routing & Usage Measurement:** Route narrow edits/checks to lighter models where verified and record per-task input/cached/output token counts before claiming efficiency gains.
|
|
20
|
+
|
|
21
|
+
## Starting Context Budget Targets & Proposed Defaults (Policy Targets Only)
|
|
22
|
+
|
|
23
|
+
| Control / Target | Starting Target | Phase 1 Status |
|
|
24
|
+
| :--- | :--- | :--- |
|
|
25
|
+
| `quick` context pack | ~2,000 tokens (starting target, not hard truncation) | **Documented only** (**NOT IMPLEMENTED**) |
|
|
26
|
+
| `working` context pack | ~8,000 tokens (starting target, not hard truncation) | **Documented only** (**NOT IMPLEMENTED**) |
|
|
27
|
+
| `deep` context pack | Task-driven expansion per requirements | **Documented only** (**NOT IMPLEMENTED**) |
|
|
28
|
+
| Concurrent specialist agents | Max 2 active specialists; no unlimited nested delegation | **Documented only** (**NOT IMPLEMENTED**) |
|
|
29
|
+
| Automatic repair retries | Max 2 automatic retries before escalating | **Documented only** (**NOT IMPLEMENTED**) |
|
|
30
|
+
| Paid API / external spend | Disabled without explicit owner `APPR-NNNN` | **Documented only** (**NOT IMPLEMENTED**) |
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Memory and Contract Schemas
|
|
2
|
+
|
|
3
|
+
This directory contains machine-validatable JSON Schema (Draft 2020-12) definitions for all Second Brain records, operational contracts, and future context/recovery manifests.
|
|
4
|
+
|
|
5
|
+
## Schema Inventory
|
|
6
|
+
|
|
7
|
+
| Schema File | Record Type | ID Pattern | Primary Memory Layer |
|
|
8
|
+
| :--- | :--- | :--- | :--- |
|
|
9
|
+
| [project-manifest.schema.json](./project-manifest.schema.json) | Project manifest (`brain/manifest.yaml`, `1.0` / `1.1`) | `^proj-[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$` | `L1_AUTHORITATIVE` |
|
|
10
|
+
| [adr.schema.json](./adr.schema.json) | Architecture Decision Record frontmatter | `^ADR-\d{4}$` | `L1_AUTHORITATIVE` |
|
|
11
|
+
| [task-contract.schema.json](./task-contract.schema.json) | Task contract | `^TASK-\d{4}$` | `L2_OPERATIONAL` |
|
|
12
|
+
| [agent-handoff.schema.json](./agent-handoff.schema.json) | Agent handoff | `^HANDOFF-\d{4}$` | `L2_OPERATIONAL` |
|
|
13
|
+
| [research-record.schema.json](./research-record.schema.json) | Research record frontmatter | `^RES-\d{4}$` | `L3_RESEARCH_EVIDENCE` |
|
|
14
|
+
| [evidence-manifest.schema.json](./evidence-manifest.schema.json) | Evidence manifest | `^EVID-\d{4}$` | `L3_RESEARCH_EVIDENCE` |
|
|
15
|
+
| [project-state.schema.json](./project-state.schema.json) | Project state (`brain/state/current.yaml`, `1.0` / `1.1`) | `project_id` + `state_revision` | `L2_OPERATIONAL` |
|
|
16
|
+
| [approval-record.schema.json](./approval-record.schema.json) | Approval record | `^APPR-\d{4}$` | `L1_AUTHORITATIVE` or `L2_OPERATIONAL` |
|
|
17
|
+
| [conflict-record.schema.json](./conflict-record.schema.json) | Conflict record | `^CONF-\d{4}$` | `L2_OPERATIONAL` |
|
|
18
|
+
| [incident-record.schema.json](./incident-record.schema.json) | Optional incident/postmortem record | `^INC-\d{4}$` | `L2_OPERATIONAL` or `L3_RESEARCH_EVIDENCE` |
|
|
19
|
+
| [recovery-checkpoint.schema.json](./recovery-checkpoint.schema.json) | Recovery checkpoint | `^CHKPT-\d{4}$` | `L2_OPERATIONAL` |
|
|
20
|
+
| [context-pack-manifest.schema.json](./context-pack-manifest.schema.json) | Context-pack manifest | `^CPACK-\d{4}$` | `L4_TEMPORARY_CONTEXT` |
|
|
21
|
+
|
|
22
|
+
## Conventions
|
|
23
|
+
|
|
24
|
+
### Memory Layers (`memory_layer`)
|
|
25
|
+
- `L1_AUTHORITATIVE` — Owner-approved requirements, accepted architecture decisions, constraints, and standards.
|
|
26
|
+
- `L2_OPERATIONAL` — Active tasks, verified project state, dependencies, blockers, conflicts, incidents, checkpoints, and pending approvals.
|
|
27
|
+
- `L3_RESEARCH_EVIDENCE` — Research findings, sources, experiments, verification evidence manifests, and lessons learned.
|
|
28
|
+
- `L4_TEMPORARY_CONTEXT` — Task-specific compiled context packets and source revision references.
|
|
29
|
+
|
|
30
|
+
### Authority Levels (`authority_level`)
|
|
31
|
+
`A0` (Global harness security rules) through `A6` (Unverified agent observations). See [memory-policy.md](../policies/memory-policy.md) for semantics.
|
|
32
|
+
|
|
33
|
+
### Strict Property Control
|
|
34
|
+
All schemas set `"additionalProperties": false` so stray or misspelled keys fail validation immediately.
|
|
35
|
+
|
|
36
|
+
### YAML Placeholder Quoting Rule
|
|
37
|
+
When a template file contains `{{PLACEHOLDER}}` tokens inside YAML (or Markdown YAML frontmatter), wrap the placeholder in double quotes (`"{{TASK_ID}}"`). Unquoted `{{...}}` is treated as nested flow mappings by YAML parsers and will fail strict YAML parsing.
|
|
38
|
+
|
|
39
|
+
### Example Record Rule
|
|
40
|
+
Every example file in [contracts/examples/](../contracts/examples/README.md) must set `"is_example": true` and `"example_notice"` explicitly marking it as an example, not real evidence or an approved decision.
|
|
41
|
+
|
|
42
|
+
### Local Validation Scope
|
|
43
|
+
Schemas are validated locally using [json-schema-lite.mjs](../core/json-schema-lite.mjs) and [validate-project.mjs](../scripts/validate-project.mjs). Automated knowledge promotion and Restricted Integration Controller runtime enforcement remain **NOT IMPLEMENTED**.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ai-workspace.local/schemas/adr.schema.json",
|
|
4
|
+
"title": "Architecture Decision Record",
|
|
5
|
+
"description": "YAML frontmatter schema for ADR-NNNN-*.md records in brain/decisions/.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"schema_version",
|
|
10
|
+
"id",
|
|
11
|
+
"title",
|
|
12
|
+
"status",
|
|
13
|
+
"memory_layer",
|
|
14
|
+
"authority_level",
|
|
15
|
+
"owner",
|
|
16
|
+
"proposed_by",
|
|
17
|
+
"approved_by",
|
|
18
|
+
"created_at",
|
|
19
|
+
"updated_at",
|
|
20
|
+
"decided_at",
|
|
21
|
+
"review_by",
|
|
22
|
+
"supersedes",
|
|
23
|
+
"superseded_by",
|
|
24
|
+
"related_requirements",
|
|
25
|
+
"related_research",
|
|
26
|
+
"approval_ref",
|
|
27
|
+
"tags"
|
|
28
|
+
],
|
|
29
|
+
"properties": {
|
|
30
|
+
"schema_version": { "type": "string", "enum": ["1.0", "1.1"] },
|
|
31
|
+
"id": { "type": "string", "pattern": "^ADR-\\d{4}$" },
|
|
32
|
+
"title": { "type": "string", "minLength": 3 },
|
|
33
|
+
"status": { "type": "string", "enum": ["proposed", "accepted", "deprecated", "superseded", "rejected"] },
|
|
34
|
+
"memory_layer": { "type": "string", "enum": ["L1_AUTHORITATIVE"] },
|
|
35
|
+
"authority_level": { "type": "string", "enum": ["A0", "A1", "A2", "A3", "A4", "A5", "A6"] },
|
|
36
|
+
"owner": { "type": "string", "minLength": 1 },
|
|
37
|
+
"proposed_by": { "type": "string", "minLength": 1 },
|
|
38
|
+
"approved_by": { "type": ["string", "null"] },
|
|
39
|
+
"created_at": { "type": "string", "minLength": 10 },
|
|
40
|
+
"updated_at": { "type": "string", "minLength": 10 },
|
|
41
|
+
"decided_at": { "type": ["string", "null"] },
|
|
42
|
+
"review_by": { "type": ["string", "null"] },
|
|
43
|
+
"supersedes": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": { "type": "string", "pattern": "^ADR-\\d{4}$" }
|
|
46
|
+
},
|
|
47
|
+
"superseded_by": { "type": ["string", "null"], "pattern": "^ADR-\\d{4}$" },
|
|
48
|
+
"related_requirements": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"items": { "type": "string", "minLength": 1 }
|
|
51
|
+
},
|
|
52
|
+
"related_research": {
|
|
53
|
+
"type": "array",
|
|
54
|
+
"items": { "type": "string", "pattern": "^RES-\\d{4}$" }
|
|
55
|
+
},
|
|
56
|
+
"approval_ref": { "type": ["string", "null"], "pattern": "^APPR-\\d{4}$" },
|
|
57
|
+
"tags": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"items": { "type": "string", "minLength": 1 }
|
|
60
|
+
},
|
|
61
|
+
"is_example": { "type": "boolean" },
|
|
62
|
+
"example_notice": { "type": "string" }
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ai-workspace.local/schemas/agent-handoff.schema.json",
|
|
4
|
+
"title": "Agent Handoff",
|
|
5
|
+
"description": "Compact structured handoff between agent roles for a specific task.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"schema_version",
|
|
10
|
+
"id",
|
|
11
|
+
"task_id",
|
|
12
|
+
"from_role",
|
|
13
|
+
"to_role",
|
|
14
|
+
"status",
|
|
15
|
+
"memory_layer",
|
|
16
|
+
"authority_level",
|
|
17
|
+
"created_at",
|
|
18
|
+
"summary",
|
|
19
|
+
"completed_items",
|
|
20
|
+
"open_items",
|
|
21
|
+
"artifacts_produced",
|
|
22
|
+
"evidence_refs",
|
|
23
|
+
"unresolved_risks",
|
|
24
|
+
"conflicts_detected",
|
|
25
|
+
"recommended_next_action",
|
|
26
|
+
"context_pack_ref"
|
|
27
|
+
],
|
|
28
|
+
"properties": {
|
|
29
|
+
"schema_version": { "type": "string", "enum": ["1.0", "1.1"] },
|
|
30
|
+
"id": { "type": "string", "pattern": "^HANDOFF-\\d{4}$" },
|
|
31
|
+
"task_id": { "type": ["string", "null"], "pattern": "^TASK-\\d{4}$" },
|
|
32
|
+
"from_role": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"enum": ["orchestrator", "researcher", "software-architect", "developer", "qa-security-reviewer"]
|
|
35
|
+
},
|
|
36
|
+
"to_role": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": ["orchestrator", "researcher", "software-architect", "developer", "qa-security-reviewer"]
|
|
39
|
+
},
|
|
40
|
+
"from_tool": { "type": ["string", "null"] },
|
|
41
|
+
"to_tool": { "type": ["string", "null"] },
|
|
42
|
+
"status": { "type": "string", "enum": ["draft", "submitted", "acknowledged", "rejected", "superseded"] },
|
|
43
|
+
"memory_layer": { "type": "string", "enum": ["L2_OPERATIONAL"] },
|
|
44
|
+
"authority_level": { "type": "string", "enum": ["A0", "A1", "A2", "A3", "A4", "A5", "A6"] },
|
|
45
|
+
"created_at": { "type": "string", "minLength": 10 },
|
|
46
|
+
"summary": { "type": "string", "minLength": 1 },
|
|
47
|
+
"completed_items": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"items": { "type": "string", "minLength": 1 }
|
|
50
|
+
},
|
|
51
|
+
"open_items": {
|
|
52
|
+
"type": "array",
|
|
53
|
+
"items": { "type": "string", "minLength": 1 }
|
|
54
|
+
},
|
|
55
|
+
"artifacts_produced": {
|
|
56
|
+
"type": "array",
|
|
57
|
+
"items": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": false,
|
|
60
|
+
"required": ["path", "purpose", "status"],
|
|
61
|
+
"properties": {
|
|
62
|
+
"path": { "type": "string", "minLength": 1 },
|
|
63
|
+
"purpose": { "type": "string", "minLength": 1 },
|
|
64
|
+
"status": { "type": "string", "enum": ["draft", "proposed", "verified", "rejected"] }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"evidence_refs": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"items": { "type": "string", "pattern": "^EVID-\\d{4}$" }
|
|
71
|
+
},
|
|
72
|
+
"unresolved_risks": {
|
|
73
|
+
"type": "array",
|
|
74
|
+
"items": { "type": "string", "minLength": 1 }
|
|
75
|
+
},
|
|
76
|
+
"conflicts_detected": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"items": { "type": "string", "pattern": "^CONF-\\d{4}$" }
|
|
79
|
+
},
|
|
80
|
+
"recommended_next_action": { "type": "string", "minLength": 1 },
|
|
81
|
+
"context_pack_ref": { "type": ["string", "null"], "pattern": "^CPACK-\\d{4}$" },
|
|
82
|
+
"git_state": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"additionalProperties": false,
|
|
85
|
+
"required": ["available", "branch", "head", "dirty", "changed_files"],
|
|
86
|
+
"properties": {
|
|
87
|
+
"available": { "type": "boolean" },
|
|
88
|
+
"branch": { "type": ["string", "null"] },
|
|
89
|
+
"head": { "type": ["string", "null"] },
|
|
90
|
+
"dirty": { "type": "boolean" },
|
|
91
|
+
"changed_files": {
|
|
92
|
+
"type": "array",
|
|
93
|
+
"items": { "type": "string", "minLength": 1 }
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"relevant_requirements": {
|
|
98
|
+
"type": "array",
|
|
99
|
+
"items": { "type": "string", "minLength": 1 }
|
|
100
|
+
},
|
|
101
|
+
"relevant_decisions": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"items": { "type": "string", "pattern": "^ADR-\\d{4}$" }
|
|
104
|
+
},
|
|
105
|
+
"verified_evidence": {
|
|
106
|
+
"type": "array",
|
|
107
|
+
"items": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"additionalProperties": false,
|
|
110
|
+
"required": ["id", "path", "status", "verified_by", "checks_summary"],
|
|
111
|
+
"properties": {
|
|
112
|
+
"id": { "type": "string", "pattern": "^EVID-\\d{4}$" },
|
|
113
|
+
"path": { "type": "string", "minLength": 1 },
|
|
114
|
+
"status": { "type": "string", "enum": ["verified"] },
|
|
115
|
+
"verified_by": { "type": ["string", "null"] },
|
|
116
|
+
"checks_summary": { "type": "string", "minLength": 1 }
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"unverified_claims": {
|
|
121
|
+
"type": "array",
|
|
122
|
+
"items": { "type": "string", "minLength": 1 }
|
|
123
|
+
},
|
|
124
|
+
"blockers": {
|
|
125
|
+
"type": "array",
|
|
126
|
+
"items": { "type": "string", "minLength": 1 }
|
|
127
|
+
},
|
|
128
|
+
"open_questions": {
|
|
129
|
+
"type": "array",
|
|
130
|
+
"items": { "type": "string", "minLength": 1 }
|
|
131
|
+
},
|
|
132
|
+
"contradiction_warnings": {
|
|
133
|
+
"type": "array",
|
|
134
|
+
"items": { "type": "string", "minLength": 1 }
|
|
135
|
+
},
|
|
136
|
+
"is_example": { "type": "boolean" },
|
|
137
|
+
"example_notice": { "type": "string" }
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ai-workspace.local/schemas/approval-record.schema.json",
|
|
4
|
+
"title": "Approval Record",
|
|
5
|
+
"description": "Explicit owner approval record for boundary-crossing decisions or actions.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"schema_version",
|
|
10
|
+
"id",
|
|
11
|
+
"title",
|
|
12
|
+
"status",
|
|
13
|
+
"memory_layer",
|
|
14
|
+
"authority_level",
|
|
15
|
+
"boundary_category",
|
|
16
|
+
"requested_by",
|
|
17
|
+
"requested_at",
|
|
18
|
+
"decided_by",
|
|
19
|
+
"decided_at",
|
|
20
|
+
"expires_at",
|
|
21
|
+
"target_records",
|
|
22
|
+
"rationale",
|
|
23
|
+
"risk_assessment",
|
|
24
|
+
"conditions"
|
|
25
|
+
],
|
|
26
|
+
"properties": {
|
|
27
|
+
"schema_version": { "type": "string", "enum": ["1.0", "1.1"] },
|
|
28
|
+
"id": { "type": "string", "pattern": "^APPR-\\d{4}$" },
|
|
29
|
+
"title": { "type": "string", "minLength": 3 },
|
|
30
|
+
"status": { "type": "string", "enum": ["pending", "approved", "rejected", "expired", "revoked"] },
|
|
31
|
+
"memory_layer": { "type": "string", "enum": ["L1_AUTHORITATIVE", "L2_OPERATIONAL"] },
|
|
32
|
+
"authority_level": { "type": "string", "enum": ["A0", "A1", "A2", "A3", "A4", "A5", "A6"] },
|
|
33
|
+
"boundary_category": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"enum": [
|
|
36
|
+
"requirements_change",
|
|
37
|
+
"architecture_change",
|
|
38
|
+
"security_boundary",
|
|
39
|
+
"spend_or_paid_api",
|
|
40
|
+
"external_mutation",
|
|
41
|
+
"destructive_action",
|
|
42
|
+
"policy_exception"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"requested_by": { "type": "string", "minLength": 1 },
|
|
46
|
+
"requested_at": { "type": "string", "minLength": 10 },
|
|
47
|
+
"decided_by": { "type": ["string", "null"] },
|
|
48
|
+
"decided_at": { "type": ["string", "null"] },
|
|
49
|
+
"expires_at": { "type": ["string", "null"] },
|
|
50
|
+
"target_records": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"minItems": 1,
|
|
53
|
+
"items": { "type": "string", "minLength": 1 }
|
|
54
|
+
},
|
|
55
|
+
"rationale": { "type": "string", "minLength": 1 },
|
|
56
|
+
"risk_assessment": { "type": "string", "minLength": 1 },
|
|
57
|
+
"conditions": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"items": { "type": "string", "minLength": 1 }
|
|
60
|
+
},
|
|
61
|
+
"skill_authorization": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"required": ["action", "skill_name", "content_sha256", "authorization_tier"],
|
|
65
|
+
"properties": {
|
|
66
|
+
"action": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"enum": ["promote_new", "promote_update", "rollback"]
|
|
69
|
+
},
|
|
70
|
+
"skill_name": { "type": "string", "minLength": 1 },
|
|
71
|
+
"proposal_id": { "type": ["string", "null"] },
|
|
72
|
+
"target_revision": { "type": ["string", "null"] },
|
|
73
|
+
"content_sha256": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
76
|
+
},
|
|
77
|
+
"base_sha256": {
|
|
78
|
+
"type": ["string", "null"],
|
|
79
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
80
|
+
},
|
|
81
|
+
"evidence_digests": {
|
|
82
|
+
"type": "array",
|
|
83
|
+
"items": { "type": "string", "minLength": 1 }
|
|
84
|
+
},
|
|
85
|
+
"authorization_tier": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"enum": ["cryptographic_ed25519", "git_pr_review_pending", "local_interactive_tty"]
|
|
88
|
+
},
|
|
89
|
+
"approver_id": { "type": ["string", "null"] },
|
|
90
|
+
"key_fingerprint": { "type": ["string", "null"] },
|
|
91
|
+
"signature_algorithm": {
|
|
92
|
+
"type": ["string", "null"],
|
|
93
|
+
"enum": ["ed25519", null]
|
|
94
|
+
},
|
|
95
|
+
"signature_base64": { "type": ["string", "null"] }
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"is_example": { "type": "boolean" },
|
|
99
|
+
"example_notice": { "type": "string" }
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ai-workspace.local/schemas/conflict-record.schema.json",
|
|
4
|
+
"title": "Conflict Record",
|
|
5
|
+
"description": "Tracks contradictions between Second Brain records, evidence, or requirements.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"schema_version",
|
|
10
|
+
"id",
|
|
11
|
+
"title",
|
|
12
|
+
"status",
|
|
13
|
+
"memory_layer",
|
|
14
|
+
"authority_level",
|
|
15
|
+
"severity",
|
|
16
|
+
"detected_at",
|
|
17
|
+
"detected_by",
|
|
18
|
+
"conflicting_records",
|
|
19
|
+
"description",
|
|
20
|
+
"impact",
|
|
21
|
+
"resolution_strategy",
|
|
22
|
+
"resolved_by",
|
|
23
|
+
"resolved_at",
|
|
24
|
+
"approval_ref"
|
|
25
|
+
],
|
|
26
|
+
"properties": {
|
|
27
|
+
"schema_version": { "type": "string", "enum": ["1.0", "1.1"] },
|
|
28
|
+
"id": { "type": "string", "pattern": "^CONF-\\d{4}$" },
|
|
29
|
+
"title": { "type": "string", "minLength": 3 },
|
|
30
|
+
"status": { "type": "string", "enum": ["open", "under_review", "resolved", "deferred"] },
|
|
31
|
+
"memory_layer": { "type": "string", "enum": ["L2_OPERATIONAL"] },
|
|
32
|
+
"authority_level": { "type": "string", "enum": ["A0", "A1", "A2", "A3", "A4", "A5", "A6"] },
|
|
33
|
+
"severity": { "type": "string", "enum": ["low", "medium", "high", "critical"] },
|
|
34
|
+
"detected_at": { "type": "string", "minLength": 10 },
|
|
35
|
+
"detected_by": { "type": "string", "minLength": 1 },
|
|
36
|
+
"conflicting_records": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"minItems": 2,
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"required": ["record_id", "path", "authority_level", "claim"],
|
|
43
|
+
"properties": {
|
|
44
|
+
"record_id": { "type": "string", "minLength": 1 },
|
|
45
|
+
"path": { "type": "string", "minLength": 1 },
|
|
46
|
+
"authority_level": { "type": "string", "enum": ["A0", "A1", "A2", "A3", "A4", "A5", "A6"] },
|
|
47
|
+
"claim": { "type": "string", "minLength": 1 }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"description": { "type": "string", "minLength": 1 },
|
|
52
|
+
"impact": { "type": "string", "minLength": 1 },
|
|
53
|
+
"resolution_strategy": { "type": ["string", "null"] },
|
|
54
|
+
"resolved_by": { "type": ["string", "null"] },
|
|
55
|
+
"resolved_at": { "type": ["string", "null"] },
|
|
56
|
+
"approval_ref": { "type": ["string", "null"], "pattern": "^APPR-\\d{4}$" },
|
|
57
|
+
"is_example": { "type": "boolean" },
|
|
58
|
+
"example_notice": { "type": "string" }
|
|
59
|
+
}
|
|
60
|
+
}
|