feat(extensions): update draft-curation with journal reconciliation and fix commit-logger parent-sha

- Add Unique Daily Journal & Reconciliation invariant to draft-curation skill.
- Establish Atomic Curation Boundary: draft-curation relocates/reconciles and hands off to git-commit without mutating git history directly.
- Add journal and decision types to draft-curation classification table.
- Fix commit-logger parent SHA resolution using rev-parse --verify.
This commit is contained in:
kiskaadee committed 2026-10-05 06:17:02 -05:00
1 parent de43014c0c
commit 4bc004da6d
2 files changed
+19 -10

No files matched your search

@@ -37,7 +37,7 @@ fi
# 3. Extract Immutable Git Metadata # 3. Extract Immutable Git Metadata
COMMIT_SHA="$(git rev-parse "${TARGET_REF}")" COMMIT_SHA="$(git rev-parse "${TARGET_REF}")"
PARENT_SHA="$(git rev-parse "${COMMIT_SHA}^" 2>/dev/null || echo "")" PARENT_SHA="$(git rev-parse --verify "${COMMIT_SHA}^" 2>/dev/null || echo "")"
COMMITTED_AT="$(git show -s --format=%cI "${COMMIT_SHA}")" COMMITTED_AT="$(git show -s --format=%cI "${COMMIT_SHA}")"
SUBJECT="$(git show -s --format=%s "${COMMIT_SHA}")" SUBJECT="$(git show -s --format=%s "${COMMIT_SHA}")"
BRANCH="$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "detached")" BRANCH="$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "detached")"
+18 -9
View File
@@ -19,13 +19,16 @@ This extension skill governs the systematic ingestion and curation of unprocesse
1. **Epistemic Classification over Chronology**: Content is sorted by its epistemic nature, never simply by when it was created: 1. **Epistemic Classification over Chronology**: Content is sorted by its epistemic nature, never simply by when it was created:
- Roadmaps, milestones, phased execution $\to$ `01-plans/<project>/` (`type: plan`) - Roadmaps, milestones, phased execution $\to$ `01-plans/<project>/` (`type: plan`)
- Exploratory debates, trade-offs, architecture options $\to$ `02-discussions/<project>/` (`type: discussion`) - Exploratory debates, trade-offs, architecture options $\to$ `02-discussions/<project>/` (`type: discussion`)
- Daily logs & reflections $\to$ `03-records/journal/` (`type: journal`)
- Incidents, regressions, root-cause analyses $\to$ `03-records/debug/` (`type: debug`) - Incidents, regressions, root-cause analyses $\to$ `03-records/debug/` (`type: debug`)
- Architectural decisions $\to$ `03-records/decisions/` (`type: decision`)
- General knowledge, concepts, languages $\to$ `04-learning/knowledge/` (`type: knowledge`) - General knowledge, concepts, languages $\to$ `04-learning/knowledge/` (`type: knowledge`)
- Practical SOPs, runbooks, operation walkthroughs $\to$ `04-learning/guides/<project>/` (`type: guide`) - Practical SOPs, runbooks, operation walkthroughs $\to$ `04-learning/guides/<project>/` (`type: guide`)
2. **The Validation Gate**: If the vault has an automated validator (e.g. `python scripts/validate-brain.py`), a curated document MUST pass before any commit is made. 2. **The Validation Gate**: If the vault has an automated validator (e.g. `python scripts/validate-brain.py`), a curated document MUST pass before any commit is made.
3. **Zero Dangling Drafts**: Once a draft is curated and committed to its destination, the original file in the staging directory must be deleted. 3. **Zero Dangling Drafts**: Once a draft is curated and relocated to its destination, the original file in the staging directory must be deleted.
4. **Interactive Checkpoint**: The agent must present the proposed destination, frontmatter, and rationale to the user before relocating files, unless explicitly instructed to process autonomously. 4. **Interactive Checkpoint**: The agent must present the proposed destination, frontmatter, and rationale to the user before relocating files, unless explicitly instructed to process autonomously.
5. **Atomic Commit Boundary**: Each curated document or cohesive bundle must be committed separately with conventional or vault-specific semantic commit types (`plan`, `discussion`, `knowledge`, `guide`, `debug`). 5. **Atomic Curation Boundary**: Each curated document or cohesive bundle is relocated and validated as an independent unit. Git history is mutated only through `git-commit`.
6. **Unique Daily Journal & Reconciliation**: A daily journal (`03-records/journal/YYYY-MM-DD.md`) is a unique daily artifact. When a curated draft targets a date whose journal already exists, reconcile it with the existing record rather than creating a duplicate file (`-2.md`) or blindly overwriting. Reconciliation must preserve existing human edits and integrate genuinely new wins, artifacts, objectives, and reflections while avoiding duplicate entries.
--- ---
@@ -36,9 +39,9 @@ flowchart TD
S1["1. Preflight Gate<br/>python scripts/validate-brain.py"] --> S2["2. Inventory & Inspection<br/>Scan 00-inbox/ for pending drafts"] S1["1. Preflight Gate<br/>python scripts/validate-brain.py"] --> S2["2. Inventory & Inspection<br/>Scan 00-inbox/ for pending drafts"]
S2 --> S3["3. Epistemic Classification<br/>Determine target directory & metadata"] S2 --> S3["3. Epistemic Classification<br/>Determine target directory & metadata"]
S3 --> S4{"4. Interactive Checkpoint<br/>Present target path & frontmatter"} S3 --> S4{"4. Interactive Checkpoint<br/>Present target path & frontmatter"}
S4 -->|Approved| S5["5. Transform & Relocate<br/>Write formatted file, delete from inbox"] S4 -->|Approved| S5["5. Transform & Relocate<br/>Write/reconcile file, delete from inbox"]
S5 --> S6["6. Validate Integrity<br/>python scripts/validate-brain.py"] S5 --> S6["6. Validate Integrity<br/>python scripts/validate-brain.py"]
S6 --> S7["7. Atomic Semantic Commit<br/>Commit with brain semantic type"] S6 --> S7["7. Hand Off to git-commit<br/>Ready for user review & commit"]
``` ```
### Step 1: Preflight Verification ### Step 1: Preflight Verification
@@ -61,7 +64,9 @@ Select the target directory according to the repository's Directory Contracts:
| :--- | :--- | :--- | :--- | | :--- | :--- | :--- | :--- |
| **Phased Roadmap / Blueprint** | `01-plans/<project>/` | `plan` | `<slug>.md` | | **Phased Roadmap / Blueprint** | `01-plans/<project>/` | `plan` | `<slug>.md` |
| **Exploratory Trade-off / Why** | `02-discussions/<project>/` | `discussion` | `<slug>.md` | | **Exploratory Trade-off / Why** | `02-discussions/<project>/` | `discussion` | `<slug>.md` |
| **Daily Log / Journal** | `03-records/journal/` | `journal` | `YYYY-MM-DD.md` |
| **Incident Root Cause / Bug** | `03-records/debug/` | `debug` | `YYYY-MM-DD-<slug>.md` | | **Incident Root Cause / Bug** | `03-records/debug/` | `debug` | `YYYY-MM-DD-<slug>.md` |
| **Architectural Decision (ADR)** | `03-records/decisions/` | `decision` | `<slug>.md` |
| **Theoretical / Disciplinary Concept** | `04-learning/knowledge/concepts/` | `knowledge` | `<slug>.md` | | **Theoretical / Disciplinary Concept** | `04-learning/knowledge/concepts/` | `knowledge` | `<slug>.md` |
| **Tool / Language Reference** | `04-learning/knowledge/technologies/` | `knowledge` | `<slug>.md` | | **Tool / Language Reference** | `04-learning/knowledge/technologies/` | `knowledge` | `<slug>.md` |
| **Engineering Best Practice** | `04-learning/knowledge/methods/` | `knowledge` | `<slug>.md` | | **Engineering Best Practice** | `04-learning/knowledge/methods/` | `knowledge` | `<slug>.md` |
@@ -78,13 +83,15 @@ Present a 4-point curation checkpoint to the user:
*If the user confirms or if operating in approved autonomous mode, proceed to Step 5.* *If the user confirms or if operating in approved autonomous mode, proceed to Step 5.*
### Step 5: Transformation, Relocation & Cleanup ### Step 5: Transformation, Relocation & Reconciliation
1. **Format Content**: 1. **Format Content**:
- Prepend valid YAML frontmatter. - Prepend valid YAML frontmatter.
- Ensure title is an H1 heading matching document purpose. - Ensure title is an H1 heading matching document purpose.
- Convert any Obsidian `[[double-bracket]]` links to standard relative Markdown links (`[label](../path.md)`). - Convert any Obsidian `[[double-bracket]]` links to standard relative Markdown links (`[label](../path.md)`).
- Ensure external code links use forge Git URLs (never machine-specific `file:///` URIs). - Ensure external code links use forge Git URLs (never machine-specific `file:///` URIs).
2. **Write Target File**: Write the transformed document to the destination path. 2. **Write or Reconcile Target File**:
- *New document*: Write the transformed document directly to the destination path.
- *Existing daily journal*: Perform journal-aware reconciliation. Preserve existing human-authored edits, append new project sections/wins, append new decisions/artifacts, and record new learning edge outcomes without duplicating entries.
3. **Remove Staging File**: Delete the original file from `00-inbox/`. 3. **Remove Staging File**: Delete the original file from `00-inbox/`.
### Step 6: Validation Pass ### Step 6: Validation Pass
@@ -95,12 +102,14 @@ python scripts/test_validator.py
``` ```
Ensure all checks pass cleanly: frontmatter validation, link resolution, code fences, Mermaid syntax, Ruff linting, and Pyright typing. Ensure all checks pass cleanly: frontmatter validation, link resolution, code fences, Mermaid syntax, Ruff linting, and Pyright typing.
### Step 7: Atomic Semantic Commit ### Step 7: Hand Off to `git-commit`
Package the curated file using conventional or vault semantic commit taxonomy: With the staging draft removed and repository validation passing cleanly, hand off to `/git-commit` for inspection and explicit user approval. Propose the conventional or vault-specific semantic commit type:
- `plan(<project>): <description>` - `plan(<project>): <description>`
- `discussion(<project>): <description>` - `discussion(<project>): <description>`
- `journal: record daily log for YYYY-MM-DD`
- `debug(<project>): <description>` - `debug(<project>): <description>`
- `decision(<project>): <description>`
- `knowledge(<topic>): <description>` - `knowledge(<topic>): <description>`
- `guide(<project>): <description>` - `guide(<project>): <description>`
Commit message must reflect the newly curated document, cleanly isolated from unrelated working-tree changes. Do not commit working-tree mutations directly; mutation of Git history belongs strictly to `git-commit`.