Phase 5: Add immutable file headers to all protected files

Added protection headers to 9 critical files:

JSON Files (x-immutable-notice field):
- .dss/schema/api.schema.json
- .dss/schema/tokens.schema.json
- .dss/schema/components.schema.json
- .dss/schema/workflows.schema.json
- .dss/schema/guardrails.schema.json
- dss-claude-plugin/.mcp.json

YAML File (comment header):
- .dss-boundaries.yaml

Markdown File (HTML comment):
- API_SPECIFICATION_IMMUTABLE.md

Python File (docstring header):
- dss-mvp1/dss/validators/schema.py

Each header includes:
- Protection notice
- Reason for immutability
- Last modified date
- Bypass instructions (DSS_IMMUTABLE_BYPASS=1)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Digital Production Factory
2025-12-09 19:34:32 -03:00
parent 7281085635
commit 93e1b452fb
18 changed files with 423 additions and 58 deletions

View File

@@ -1,15 +1,15 @@
"""
🔌 DSS NERVOUS SYSTEM - FastAPI Server
The nervous system is how the DSS organism communicates with the external world.
This REST API serves as the organism's neural pathways - transmitting signals
The nervous system is how the DSS component communicates with the external world.
This REST API serves as the component's neural pathways - transmitting signals
between external systems and the DSS internal organs.
Portal Endpoints (Synapses):
- 📊 Project management (CRUD operations)
- 👁️ Figma integration (sensory perception)
- 🏥 Health checks and diagnostics
- 📝 Activity tracking (organism consciousness)
- 📝 Activity tracking (component consciousness)
- ⚙️ Runtime configuration management
- 🔍 Service discovery (companion ecosystem)
@@ -17,7 +17,7 @@ Operational Modes:
- **Server Mode** 🌐 - Deployed remotely, distributes tokens to teams
- **Local Mode** 🏠 - Dev companion, local service integration
Foundation: SQLite database (❤️ Heart) stores all organism experiences
Foundation: SQLite database (❤️ Heart) stores all component experiences
"""
# Load environment variables from .env file FIRST (before any other imports)
@@ -90,8 +90,8 @@ class RuntimeConfig:
⚙️ ENDOCRINE HORMONE STORAGE - Runtime configuration system
The endocrine system regulates behavior through hormones. This configuration
manager stores the organism's behavioral preferences and adaptation state.
Persists to .dss/runtime-config.json so the organism remembers its preferences
manager stores the component's behavioral preferences and adaptation state.
Persists to .dss/runtime-config.json so the component remembers its preferences
even after sleep (shutdown).
"""
def __init__(self):
@@ -177,7 +177,7 @@ class ServiceDiscovery:
🔌 SENSORY ORGAN PERCEPTION - Service discovery system
The sensory organs perceive companion services (Storybook, Chromatic, dev servers)
running in the ecosystem. This discovery mechanism helps the organism understand
running in the ecosystem. This discovery mechanism helps the component understand
what external tools are available for integration.
"""
@@ -393,8 +393,8 @@ async def health():
"""
🏥 ORGANISM VITAL SIGNS CHECK
Performs a complete health diagnostic on the DSS organism.
Returns 200 OK with vital signs if organism is healthy.
Performs a complete health diagnostic on the DSS component.
Returns 200 OK with vital signs if component is healthy.
Vital Signs Checked:
- ❤️ Heart (Database) - Is the source of truth responsive?
@@ -437,7 +437,7 @@ async def health():
print(f"🧠 BRAIN CHECK: MCP handler error: {type(e).__name__}: {e}", flush=True)
print(f" Traceback:\n{error_trace}", flush=True)
# Get uptime (how long organism has been conscious)
# Get uptime (how long component has been conscious)
try:
process = psutil.Process(os.getpid())
uptime_seconds = int((datetime.now() - datetime.fromtimestamp(process.create_time())).total_seconds())
@@ -828,7 +828,7 @@ async def extract_variables(request: FigmaExtractRequest, background_tasks: Back
The sensory organs perceive Figma designs, then the digestive system
breaks them down into nutrient particles (design tokens) that the
organism can absorb and circulate through its body.
component can absorb and circulate through its body.
"""
try:
result = await figma_suite.extract_variables(request.file_key, request.format)
@@ -846,7 +846,7 @@ async def extract_components(request: FigmaExtractRequest):
"""
🧬 GENETIC BLUEPRINT EXTRACTION - Extract component DNA from Figma
Components are the organism's tissue structures. This extracts
Components are the component's tissue structures. This extracts
the genetic blueprints (component definitions) from Figma.
"""
try:
@@ -865,7 +865,7 @@ async def extract_styles(request: FigmaExtractRequest):
"""
🎨 PHENOTYPE EXTRACTION - Extract visual styles from Figma
The organism's appearance (styles) is extracted from Figma designs.
The component's appearance (styles) is extracted from Figma designs.
This feeds the skin (presentation) system.
"""
try:
@@ -877,10 +877,10 @@ async def extract_styles(request: FigmaExtractRequest):
@app.post("/api/figma/sync-tokens")
async def sync_tokens(request: FigmaSyncRequest):
"""
🩸 CIRCULATORY DISTRIBUTION - Sync tokens throughout the organism
🩸 CIRCULATORY DISTRIBUTION - Sync tokens throughout the component
The circulatory system distributes nutrients (tokens) to all parts
of the organism. This endpoint broadcasts extracted tokens to the
of the component. This endpoint broadcasts extracted tokens to the
target output paths.
"""
try:
@@ -923,7 +923,7 @@ async def figma_health():
👁️ SENSORY ORGAN HEALTH CHECK - Figma perception status
The sensory organs (eyes) perceive visual designs from Figma.
This endpoint checks if the organism's eyes can see external designs.
This endpoint checks if the component's eyes can see external designs.
"""
is_live = figma_suite.mode == 'live'
return {