Skip to content

Commit 687e856

Browse files
thiagofinchclaude
andcommitted
refactor(arch): promote workspace/ to root level (L1 template, L2 populated)
BREAKING: workspace/ moved from knowledge/workspace/ to root level. This aligns with the architectural decision that business data is a first-class citizen alongside knowledge/ and agents/, not nested under it. - workspace/ now at root: _org, _team, _finance, _meetings, _automations, _tools, inbox/ - core/paths.py: WORKSPACE = ROOT / "workspace" (replaces KNOWLEDGE_WORKSPACE) - bucket_processor.py: updated imports to use WORKSPACE - directory-contract.md: updated architecture diagram and directory table - reference/SOURCE-TREE.md: updated top-level structure - .gitignore: workspace/ tracked as L1 template, L2 populated Layer behavior: L1: workspace/ structure (template dirs, index.md, setup docs) L2: workspace/ populated (real business data) L3: knowledge/personal/ remains gitignored 79 tests pass. Ruff clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fc7ac48 commit 687e856

File tree

10 files changed

+236
-41
lines changed

10 files changed

+236
-41
lines changed

.claude/rules/directory-contract.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
---
99

10-
## Arquitetura Tridimensional (knowledge/)
10+
## Arquitetura Tridimensional (3 Buckets)
1111

1212
```
1313
knowledge/
@@ -17,20 +17,21 @@ knowledge/
1717
│ ├── playbooks/ → Actionable playbooks
1818
│ ├── sources/ → Source compilations
1919
│ └── inbox/ → Raw expert materials
20-
├── workspace/ ← Bucket 2: Business Data (L2/L3)
21-
│ ├── _org/ → Organization structure
22-
│ ├── _team/ → Team data
23-
│ ├── _finance/ → Financial data (L3)
24-
│ ├── _meetings/ → Meeting notes
25-
│ ├── _automations/ → Tool configs
26-
│ ├── _tools/ → Detected tools log
27-
│ └── inbox/ → Raw business materials
2820
└── personal/ ← Bucket 3: Cognitive/Private (L3 ONLY)
2921
├── _email/ → Email digests
3022
├── _messages/ → WhatsApp/Slack
3123
├── _calls/ → Call transcripts
3224
├── _cognitive/ → Mental models, reflections
3325
└── inbox/ → Raw personal materials
26+
27+
workspace/ ← Bucket 2: Business Data (ROOT level, L1 template / L2 populated)
28+
├── _org/ → Organization structure
29+
├── _team/ → Team data
30+
├── _finance/ → Financial data
31+
├── _meetings/ → Meeting notes
32+
├── _automations/ → Tool configs
33+
├── _tools/ → Detected tools log
34+
└── inbox/ → Raw business materials
3435
```
3536

3637
## Diretórios e Propósito
@@ -47,8 +48,8 @@ knowledge/
4748
| `artifacts/` | Generated Output | audit reports, validation | Gitignored |
4849
| `logs/` | Session Logs | batches, JSONL audit trails | Gitignored |
4950
| `inbox/` | Raw Materials | L3 personal content | Gitignored |
50-
| `knowledge/external/` | Bucket 1 | Expert dna, dossiers, playbooks | Gitignored |
51-
| `knowledge/workspace/` | Bucket 2 | Business data, org, finance | Gitignored |
51+
| `workspace/` | Bucket 2 | Business data, org, finance | Tracked (L1 template, L2 populated) |
52+
| `knowledge/external/` | Bucket 1 | Expert dna, dossiers, playbooks | Tracked (L2) |
5253
| `knowledge/personal/` | Bucket 3 | Cognitive, email, calls | Gitignored (L3) |
5354
| `research/` | Ad-hoc Analysis | L3 blueprints, deep-dives | Gitignored |
5455
| `processing/` | Pipeline Artifacts | speakers, entities, diarization | Gitignored |
@@ -70,7 +71,7 @@ knowledge/
7071
| `nav_map_builder.py` | `knowledge/external/` | `ROUTING["nav_map"]` |
7172
| `sow_generator.py` | `agents/sua-empresa/sow/` | `ROUTING["sow_output"]` |
7273
| `organized_downloader.py` | `inbox/` | `ROUTING["download"]` |
73-
| *(workspace scripts)* | `knowledge/workspace/` | `ROUTING["workspace_data"]` |
74+
| *(workspace scripts)* | `workspace/` | `ROUTING["workspace_data"]` |
7475
| *(personal scripts)* | `knowledge/personal/` | `ROUTING["personal_data"]` |
7576

7677
## RAG Isolation
@@ -97,7 +98,7 @@ from core.paths import ROUTING, KNOWLEDGE_EXTERNAL, KNOWLEDGE_WORKSPACE, KNOWLED
9798
# Correto: usar constante
9899
output = ROUTING["audit_report"] / "report.json"
99100
dna_path = KNOWLEDGE_EXTERNAL / "dna" / "persons" / "alex-hormozi"
100-
workspace = ROUTING["workspace_data"] / "_meetings"
101+
workspace = ROUTING["workspace_data"] / "_meetings" # resolves to workspace/_meetings
101102

102103
# Errado: hardcodar path
103104
output = Path("knowledge/dna/persons/alex-hormozi") # PROIBIDO (stale path)

.gitignore

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,9 @@ squads/
448448
!knowledge/external/inbox/
449449
!knowledge/external/inbox/.gitkeep
450450

451-
# Knowledge workspace scaffolding L1/L2
452-
!knowledge/workspace/
453-
!knowledge/workspace/index.md
454-
!knowledge/workspace/MISSING-CONTEXT-LOG.md
455-
!knowledge/workspace/DETECTED-TOOLS-LOG.md
456-
!knowledge/workspace/SETUP-PENDING.md
457-
!knowledge/workspace/MASTER-INDEX.md
458-
!knowledge/workspace/inbox/
459-
!knowledge/workspace/inbox/.gitkeep
451+
# Workspace — root level (L1 template, L2 populated)
452+
!workspace/
453+
!workspace/**
460454

461455
# Knowledge personal — L3 ONLY (never commit content)
462456
# The personal/.gitignore blocks everything except itself and index.md
@@ -502,8 +496,8 @@ squads/
502496
!knowledge/external/TAG-RESOLVER.json
503497
!knowledge/external/inbox/**
504498

505-
# Knowledge workspace populado
506-
!knowledge/workspace/**
499+
# Workspace populado (root level, not inside knowledge/)
500+
# Already covered by !workspace/** in BLOCO 4
507501

508502
# Expert agents populados
509503
!agents/minds/**

core/intelligence/pipeline/bucket_processor.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
from core.paths import (
2727
KNOWLEDGE_EXTERNAL,
2828
KNOWLEDGE_PERSONAL,
29-
KNOWLEDGE_WORKSPACE,
3029
LOGS,
3130
ROUTING,
31+
WORKSPACE,
3232
)
3333

3434
logger = logging.getLogger(__name__)
@@ -52,18 +52,18 @@
5252
},
5353
},
5454
"workspace": {
55-
"path": KNOWLEDGE_WORKSPACE,
55+
"path": WORKSPACE,
5656
"inbox": ROUTING["workspace_inbox"],
5757
"color": "red",
5858
"label": "Business Intelligence",
5959
"layer": "L2/L3",
6060
"subdirs": {
61-
"org": KNOWLEDGE_WORKSPACE / "_org",
62-
"team": KNOWLEDGE_WORKSPACE / "_team",
63-
"finance": KNOWLEDGE_WORKSPACE / "_finance",
64-
"meetings": KNOWLEDGE_WORKSPACE / "_meetings",
65-
"automations": KNOWLEDGE_WORKSPACE / "_automations",
66-
"tools": KNOWLEDGE_WORKSPACE / "_tools",
61+
"org": WORKSPACE / "_org",
62+
"team": WORKSPACE / "_team",
63+
"finance": WORKSPACE / "_finance",
64+
"meetings": WORKSPACE / "_meetings",
65+
"automations": WORKSPACE / "_automations",
66+
"tools": WORKSPACE / "_tools",
6767
},
6868
},
6969
"personal": {

core/paths.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
SKILLS = CLAUDE / "skills"
2525
HOOKS = CLAUDE / "hooks"
2626
COMMANDS = CLAUDE / "commands"
27+
WORKSPACE = ROOT / "workspace" # Business data (L1 template, L2 populated)
2728

2829
# ── GITIGNORED (L3 / Runtime) ────────────────────────────────────
2930
LOGS = ROOT / "logs"
3031
INBOX = ROOT / "inbox"
3132
KNOWLEDGE = ROOT / "knowledge"
3233
KNOWLEDGE_EXTERNAL = KNOWLEDGE / "external"
33-
KNOWLEDGE_WORKSPACE = KNOWLEDGE / "workspace"
3434
KNOWLEDGE_PERSONAL = KNOWLEDGE / "personal"
35+
# KNOWLEDGE_WORKSPACE removed — workspace is now at root level (WORKSPACE)
3536
PROCESSING = ROOT / "processing"
3637
ARTIFACTS = ROOT / "artifacts"
3738
DATA = ROOT / ".data"
@@ -88,11 +89,11 @@
8889
# Trash (never delete, always move here)
8990
"trash": TRASH,
9091
# Knowledge buckets
91-
"workspace_data": KNOWLEDGE_WORKSPACE,
92+
"workspace_data": WORKSPACE,
9293
"personal_data": KNOWLEDGE_PERSONAL,
9394
"rag_expert": RAG_EXPERT,
9495
"rag_business": RAG_BUSINESS,
95-
"workspace_inbox": KNOWLEDGE_WORKSPACE / "inbox",
96+
"workspace_inbox": WORKSPACE / "inbox",
9697
"personal_inbox": KNOWLEDGE_PERSONAL / "inbox",
9798
"external_inbox": KNOWLEDGE_EXTERNAL / "inbox",
9899
# Log templates (L1 — mechanism, not data)

reference/SOURCE-TREE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ mega-brain/
1515
├── agents/ Knowledge agents (conclave, cargo, minds)
1616
├── reference/ Documentation (guides, standards, ADRs)
1717
├── docs/ Legacy docs (migrating to reference/)
18-
├── knowledge/ Knowledge base (3 buckets)
18+
├── workspace/ Business data — L1 template, L2 populated (org, finance, meetings)
19+
├── knowledge/ Knowledge base (2 buckets)
1920
│ ├── external/ Expert content (dna, dossiers, playbooks)
20-
│ ├── workspace/ Business data (org, finance, meetings)
21-
│ └── personal/ Private content (email, calls, cognitive)
21+
│ └── personal/ Private content — L3 only (email, calls, cognitive)
2222
├── artifacts/ Pipeline output (chunks, insights, canonical)
2323
├── inbox/ Raw materials awaiting processing
2424
├── logs/ Session and batch logs
@@ -41,9 +41,9 @@ mega-brain/
4141

4242
| Layer | Content | Git | npm |
4343
|-------|---------|-----|-----|
44-
| L1 (Community) | core/, bin/, agents/templates, .claude/ | Tracked | Published |
45-
| L2 (Pro) | agents/cargo/*, knowledge/external/* | Tracked | Premium |
46-
| L3 (Personal) | inbox/*, logs/*, .env, sessions | Gitignored | Never |
44+
| L1 (Community) | core/, bin/, agents/templates, .claude/, workspace/ (template) | Tracked | Published |
45+
| L2 (Pro) | agents/cargo/*, knowledge/external/*, workspace/ (populated) | Tracked | Premium |
46+
| L3 (Personal) | inbox/*, logs/*, knowledge/personal/*, .env, sessions | Gitignored | Never |
4747
| NEVER | .env, credentials, .DS_Store, __pycache__ | Blocked | Blocked |
4848

4949
---

workspace/DETECTED-TOOLS-LOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Detected Tools Log
2+
3+
> **Purpose:** Track tools and platforms detected during sessions.
4+
> **Location:** `knowledge/workspace/DETECTED-TOOLS-LOG.md`
5+
> **Updated by:** JARVIS when tools/platforms are mentioned in conversations.
6+
7+
## How This Works
8+
9+
When the user mentions a tool, platform, or SaaS product that is part of their
10+
business stack, JARVIS logs it here. Over time this builds a complete picture of the
11+
business technology stack, which helps agents make tool-aware recommendations.
12+
13+
## Format
14+
15+
Each entry follows this structure:
16+
17+
```
18+
### [Tool Name]
19+
- **Category:** [CRM / Automation / Finance / Communication / Analytics / Other]
20+
- **First detected:** YYYY-MM-DD
21+
- **Integration status:** [Active / Planned / Deprecated / Unknown]
22+
- **MCP available:** [Yes / No / N/A]
23+
- **Notes:** [Any context about how the tool is used]
24+
```
25+
26+
## Detected Tools
27+
28+
_No tools detected yet. Tools will be logged here as they are mentioned in sessions._

workspace/MASTER-INDEX.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Workspace Master Index
2+
3+
> **Purpose:** Human-readable index of all workspace content.
4+
> **Location:** `knowledge/workspace/MASTER-INDEX.md`
5+
> **Updated by:** JARVIS after any workspace content changes.
6+
7+
## Directory Overview
8+
9+
| Directory | Content Count | Last Updated |
10+
|-----------|--------------|--------------|
11+
| `_org/` | 0 items | - |
12+
| `_team/` | 0 items | - |
13+
| `_finance/` | 0 items | - |
14+
| `_meetings/` | 0 items | - |
15+
| `_tools/` | 0 items | - |
16+
| `_automations/` | 0 items | - |
17+
| `inbox/` | 0 items | - |
18+
19+
## Content by Category
20+
21+
### Organization (`_org/`)
22+
_No content yet._
23+
24+
### Team (`_team/`)
25+
_No content yet._
26+
27+
### Finance (`_finance/`)
28+
_No content yet._
29+
30+
### Meetings (`_meetings/`)
31+
_No content yet._
32+
33+
### Tools (`_tools/`)
34+
_No content yet._
35+
36+
### Automations (`_automations/`)
37+
_No content yet._
38+
39+
## Related Files
40+
41+
- [Missing Context Log](./MISSING-CONTEXT-LOG.md) -- Gaps detected by agents
42+
- [Detected Tools Log](./DETECTED-TOOLS-LOG.md) -- Business tech stack
43+
- [Setup Pending](./SETUP-PENDING.md) -- Integration backlog
44+
45+
## Statistics
46+
47+
- **Total workspace items:** 0
48+
- **Last full index:** Never
49+
- **Coverage score:** 0% (no business context imported yet)

workspace/MISSING-CONTEXT-LOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Missing Context Log
2+
3+
> **Purpose:** Track business context gaps detected by agents during sessions.
4+
> **Location:** `knowledge/workspace/MISSING-CONTEXT-LOG.md`
5+
> **Updated by:** JARVIS and cargo agents when they detect missing business data.
6+
7+
## How This Works
8+
9+
When an agent needs business context to answer a question but cannot find it in
10+
`knowledge/workspace/`, it logs the gap here. This creates a backlog of information
11+
that should be imported into the workspace bucket.
12+
13+
## Format
14+
15+
Each entry follows this structure:
16+
17+
```
18+
### YYYY-MM-DD -- [Category]
19+
- **Detected by:** [Agent name]
20+
- **Context needed:** [What was missing]
21+
- **Why needed:** [What question triggered the detection]
22+
- **Suggested source:** [Where this data might come from]
23+
- **Priority:** [HIGH / MEDIUM / LOW]
24+
- **Status:** [OPEN / RESOLVED / WONT-FIX]
25+
```
26+
27+
## Log Entries
28+
29+
_No entries yet. Gaps will be logged here as agents detect missing business context._

workspace/SETUP-PENDING.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Setup Pending
2+
3+
> **Purpose:** Track pending setup items for workspace integrations.
4+
> **Location:** `knowledge/workspace/SETUP-PENDING.md`
5+
> **Updated by:** JARVIS during setup and configuration sessions.
6+
7+
## How This Works
8+
9+
When a workspace integration is identified but not yet configured, it gets logged
10+
here. This serves as a backlog for the @devops system agent and the user to
11+
progressively build out the workspace bucket's data sources.
12+
13+
## Pending Items
14+
15+
### Data Sources Not Yet Connected
16+
17+
| Source | Category | Blocked By | Priority |
18+
|--------|----------|------------|----------|
19+
| _None yet_ | - | - | - |
20+
21+
### Integrations Not Yet Configured
22+
23+
| Integration | MCP Server | Status | Notes |
24+
|-------------|------------|--------|-------|
25+
| _None yet_ | - | - | - |
26+
27+
### Manual Imports Needed
28+
29+
| Data | Source Location | Target Directory | Notes |
30+
|------|----------------|------------------|-------|
31+
| _None yet_ | - | - | - |
32+
33+
## Completed Setup Items
34+
35+
_No items completed yet._

workspace/index.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Knowledge / Workspace
2+
3+
> **Bucket 2** -- Business context and operational data.
4+
> **Layer:** L2 (Pro, tracked scaffolding) / L3 (populated content gitignored)
5+
> **paths.py constant:** `KNOWLEDGE_WORKSPACE`
6+
7+
## Purpose
8+
9+
This bucket contains **business-specific** knowledge: team structure, financial data,
10+
meeting notes, tool configurations, and automation workflows. It provides the real-world
11+
context that transforms generic expert knowledge into actionable recommendations.
12+
13+
## Structure
14+
15+
```
16+
knowledge/workspace/
17+
_org/ -- Organization charts, role definitions, SOWs
18+
_team/ -- Team profiles, performance data, hiring pipeline
19+
_finance/ -- Financial data, KPIs, DRE, unit economics
20+
_meetings/ -- Meeting notes, decisions, action items
21+
_tools/ -- Tool configurations, CRM setup, integrations
22+
_automations/ -- n8n workflows, Zapier configs, automation docs
23+
inbox/ -- Triage area for new business content
24+
pending/ -- Awaiting classification
25+
rejected/ -- Did not pass quality gate
26+
```
27+
28+
## Key Files
29+
30+
| File | Purpose |
31+
|------|---------|
32+
| `MASTER-INDEX.md` | Human-readable index of all workspace content |
33+
| `MISSING-CONTEXT-LOG.md` | Tracks business context gaps detected by agents |
34+
| `DETECTED-TOOLS-LOG.md` | Tools and platforms detected during sessions |
35+
| `SETUP-PENDING.md` | Pending setup items for workspace integrations |
36+
37+
## Routing
38+
39+
```python
40+
from core.paths import KNOWLEDGE_WORKSPACE, ROUTING
41+
42+
ROUTING["workspace_data"] # -> knowledge/workspace/
43+
ROUTING["workspace_inbox"] # -> knowledge/workspace/inbox/
44+
ROUTING["rag_business"] # -> .data/rag_business/ (index built from this bucket)
45+
```
46+
47+
## Integration Points
48+
49+
- Agents consult workspace/ before making strategic recommendations (Rule #16)
50+
- The `context_assembler.py` pulls from workspace/ for business-aware RAG
51+
- MCP servers (ClickUp, Notion) can push data into workspace/inbox/
52+
- Financial data here feeds the CFO agent's MEMORY.md
53+
54+
## Security
55+
56+
Populated content in this bucket is L3 (gitignored). Only the directory scaffolding
57+
and template files (.gitkeep, index.md) are tracked. Never commit actual business
58+
data, financial figures, or team personal information.

0 commit comments

Comments
 (0)