-
Notifications
You must be signed in to change notification settings - Fork 0
Add T01 vault structure tests with Bats framework #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
p3ob7o
wants to merge
10
commits into
main
Choose a base branch
from
claude/review-assistant-requirements-Pxq4f
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
84e5b28
Add T01 vault structure tests with Bats framework
claude 92c5f30
Update vault.sh
p3ob7o 1a0947a
Update test_helper.bash
p3ob7o 8f387b2
Update t01_vault_structure.bats
p3ob7o a9a0371
Update test_helper.bash
p3ob7o f6e3951
Initial plan
Copilot fb6d5ed
Merge pull request #2 from p3ob7o/copilot/sub-pr-1
p3ob7o 457a0b2
Initial plan
Copilot 9e3de81
Add missing directories to test-vault-populated fixture
Copilot 8637acc
Merge pull request #3 from p3ob7o/copilot/sub-pr-1
p3ob7o File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| #!/usr/bin/env bash | ||
| # Vault Structure & Scaffolding Functions | ||
| # | ||
| # Implements F01: Vault Structure & Scaffolding | ||
| # See requirements/F01-vault-structure.md for specifications. | ||
|
|
||
| # Enable strict mode only when executed directly, not when sourced | ||
| if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then | ||
| set -euo pipefail | ||
| fi | ||
|
|
||
| # ============================================================================= | ||
| # Constants | ||
| # ============================================================================= | ||
|
|
||
| # Expected top-level folders | ||
| readonly VAULT_FOLDERS=( | ||
| ".claude" | ||
| "0_Inbox" | ||
| "1_Fleeting" | ||
| "2_Drafts" | ||
| "3_Projects" | ||
| "4_Areas" | ||
| "5_Resources" | ||
| "6_Archive" | ||
| "7_Assets" | ||
| "8_People" | ||
| "9_Meta" | ||
| ) | ||
|
|
||
| # Expected meta files | ||
| readonly META_FILES=( | ||
| "config.yaml" | ||
| "memory.md" | ||
| "pending.json" | ||
| "state.json" | ||
| ) | ||
|
|
||
| # ============================================================================= | ||
| # scaffold_vault | ||
| # ============================================================================= | ||
| # Creates the complete vault folder structure at the given path. | ||
| # Idempotent: safe to run multiple times without affecting existing files. | ||
| # | ||
| # Arguments: | ||
| # $1 - Path to the vault root directory | ||
| # | ||
| # Returns: | ||
| # 0 on success | ||
| # 1 on failure | ||
| # ============================================================================= | ||
| scaffold_vault() { | ||
| local vault_path="$1" | ||
|
|
||
| # TODO: Implement vault scaffolding | ||
| # 1. Create all top-level folders from VAULT_FOLDERS | ||
| # 2. Create 6_Archive/Daily-Notes/ subfolder | ||
| # 3. Create 9_Meta/prompts/ subfolder | ||
| # 4. Create meta files (config.yaml, memory.md, pending.json, state.json) | ||
| # 5. Must be idempotent - don't overwrite existing files | ||
|
|
||
| echo "scaffold_vault: Not yet implemented" >&2 | ||
| return 1 | ||
| } | ||
|
|
||
| # ============================================================================= | ||
| # validate_vault_structure | ||
| # ============================================================================= | ||
| # Validates that a vault has the correct structure. | ||
| # | ||
| # Arguments: | ||
| # $1 - Path to the vault root directory | ||
| # | ||
| # Returns: | ||
| # 0 if valid, outputs "Vault structure valid" | ||
| # 1 if invalid, outputs list of issues | ||
| # ============================================================================= | ||
| validate_vault_structure() { | ||
| local vault_path="$1" | ||
|
|
||
| # TODO: Implement vault validation | ||
| # 1. Check all expected folders exist | ||
| # 2. Check folder naming convention (N_Name pattern) | ||
| # 3. Check meta files exist | ||
| # 4. Report all missing or invalid items | ||
|
|
||
| echo "validate_vault_structure: Not yet implemented" >&2 | ||
| return 1 | ||
| } | ||
Empty file.
22 changes: 22 additions & 0 deletions
22
tests/fixtures/test-vault-populated/0_Inbox/2025-01-31 Friday.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| --- | ||
| type: daily | ||
| date: 2025-01-31 | ||
| day_of_week: Friday | ||
| status: active | ||
| morning_brief_done: false | ||
| evening_review_done: false | ||
| --- | ||
|
|
||
| # 2025-01-31 Friday | ||
|
|
||
| ## Morning Brief | ||
|
|
||
|
|
||
| ## Captures | ||
|
|
||
|
|
||
| ## Notes | ||
|
|
||
|
|
||
| ## Evening Review | ||
|
|
10 changes: 10 additions & 0 deletions
10
tests/fixtures/test-vault-populated/1_Fleeting/sample-fleeting.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| type: fleeting | ||
| created: 2025-01-31T10:00:00-05:00 | ||
| source: manual | ||
| status: unprocessed | ||
| --- | ||
|
|
||
| # Sample Fleeting Note | ||
|
|
||
| This is a sample fleeting note for testing purposes. |
Empty file.
21 changes: 21 additions & 0 deletions
21
tests/fixtures/test-vault-populated/3_Projects/test-project/test-project.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --- | ||
| type: project | ||
| title: Test Project | ||
| status: active | ||
| created: 2025-01-15T09:00:00-05:00 | ||
| area: "[[test-area]]" | ||
| --- | ||
|
|
||
| # Test Project | ||
|
|
||
| ## Overview | ||
|
|
||
| A sample project for testing vault structure. | ||
|
|
||
| ## Tasks | ||
|
|
||
| - [ ] Sample task 1 | ||
| - [ ] Sample task 2 | ||
|
|
||
| ## Notes | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| type: area | ||
| title: Test Area | ||
| status: active | ||
| created: 2025-01-01T00:00:00-05:00 | ||
| --- | ||
|
|
||
| # Test Area | ||
|
|
||
| An area of responsibility for testing purposes. |
Empty file.
27 changes: 27 additions & 0 deletions
27
...tures/test-vault-populated/6_Archive/Daily-Notes/2025/01/2025-01-30 Thursday.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| type: daily | ||
| date: 2025-01-30 | ||
| day_of_week: Thursday | ||
| status: archived | ||
| morning_brief_done: true | ||
| evening_review_done: true | ||
| archived_at: 2025-01-31T06:00:00-05:00 | ||
| --- | ||
|
|
||
| # 2025-01-30 Thursday | ||
|
|
||
| ## Morning Brief | ||
|
|
||
| Completed morning brief. | ||
|
|
||
| ## Captures | ||
|
|
||
| - Sample capture from yesterday | ||
|
|
||
| ## Notes | ||
|
|
||
| - Notes from the day | ||
|
|
||
| ## Evening Review | ||
|
|
||
| Day completed and reviewed. |
Empty file.
23 changes: 23 additions & 0 deletions
23
tests/fixtures/test-vault-populated/8_People/jane-smith.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| type: person | ||
| name: Jane Smith | ||
| email: jane.smith@example.com | ||
| company: Example Corp | ||
| last_contact: 2025-01-28 | ||
| created: 2025-01-15T00:00:00-05:00 | ||
| --- | ||
|
|
||
| # Jane Smith | ||
|
|
||
| ## Contact Info | ||
|
|
||
| - Email: jane.smith@example.com | ||
| - Company: Example Corp | ||
|
|
||
| ## Notes | ||
|
|
||
| Met at conference in January 2025. | ||
|
|
||
| ## Interactions | ||
|
|
||
| - 2025-01-28: Email exchange about project collaboration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Digital Cortex Configuration | ||
|
|
||
| vault: | ||
| name: "Test Vault" | ||
| timezone: "America/New_York" | ||
|
p3ob7o marked this conversation as resolved.
|
||
|
|
||
| sources: | ||
| gmail: | ||
| enabled: false | ||
| calendar: | ||
| enabled: false | ||
| slack: | ||
| enabled: false | ||
| p2: | ||
| enabled: false | ||
| linear: | ||
| enabled: false | ||
| reminders: | ||
| enabled: false | ||
|
|
||
| features: | ||
| morning_brief: | ||
| enabled: true | ||
| auto_run: false | ||
| evening_review: | ||
| enabled: true | ||
| weekly_review: | ||
| enabled: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Memory | ||
|
|
||
| User preferences and learned patterns. | ||
|
|
||
| ## Preferences | ||
|
|
||
| - Preferred working hours: 9am - 5pm | ||
| - Focus time preference: mornings | ||
|
|
||
| ## Patterns | ||
|
|
||
| (Learned patterns will be recorded here) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "version": 1, | ||
| "pending_operations": [] | ||
| } |
9 changes: 9 additions & 0 deletions
9
tests/fixtures/test-vault-populated/9_Meta/prompts/evening-review.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Evening Review Template | ||
|
|
||
| Guide the evening review: | ||
|
|
||
| 1. What was accomplished today? | ||
| 2. What remains incomplete? | ||
| 3. Process inbox items | ||
| 4. Preview tomorrow's calendar | ||
| 5. Set intentions for tomorrow |
9 changes: 9 additions & 0 deletions
9
tests/fixtures/test-vault-populated/9_Meta/prompts/morning-brief.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Morning Brief Template | ||
|
|
||
| Generate a morning brief with: | ||
|
|
||
| 1. Today's calendar events | ||
| 2. Priority tasks | ||
| 3. Emails needing attention | ||
| 4. Slack/P2 messages to review | ||
| 5. Reminders for today |
8 changes: 8 additions & 0 deletions
8
tests/fixtures/test-vault-populated/9_Meta/prompts/process-inbox.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Process Inbox Template | ||
|
|
||
| Guide inbox processing: | ||
|
|
||
| 1. Identify items to process | ||
| 2. For each item, decide: delete, delegate, defer, do, or file | ||
| 3. Move processed items to appropriate locations | ||
| 4. Update any related projects or areas |
9 changes: 9 additions & 0 deletions
9
tests/fixtures/test-vault-populated/9_Meta/prompts/weekly-review.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Weekly Review Template | ||
|
|
||
| Guide the weekly review: | ||
|
|
||
| 1. Review the past week | ||
| 2. Check project statuses | ||
| 3. Process fleeting notes | ||
| 4. Review upcoming week | ||
| 5. Set weekly intentions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "version": 1, | ||
| "last_sync": { | ||
| "gmail": null, | ||
| "calendar": null, | ||
| "slack": null, | ||
| "p2": null, | ||
| "linear": null, | ||
| "reminders": null | ||
| }, | ||
| "last_morning_brief": null, | ||
| "last_evening_review": null, | ||
| "last_weekly_review": null | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scaffold_vaultis defined but intentionally returns exit code 1. With the current test suite, this makes all scaffolding tests fail (they only skip when the function is missing). If these functions are meant to be stubs for now, either adjust the tests to skip on the stub state or avoid defining failing stubs until implementation is ready.