[Worker] OBSERVATION_SYSTEM_PROMPT ist nicht synchron mit ObservationType #292

Closed
opened 2026-01-25 15:40:04 +00:00 by jack · 1 comment
Owner

Problem

Der OBSERVATION_SYSTEM_PROMPT in packages/worker/src/handlers/prompts.ts ist nicht synchron mit:

  1. ObservationType in packages/types/src/database.ts
  2. Observation Entity in packages/database/src/entities/Observation.ts

Teil 1: Fehlende Observation-Typen

ObservationType (database.ts) - 16 Typen

export type ObservationType =
  // Work Types
  | 'bugfix'        // Something was broken, now fixed
  | 'feature'       // New capability or functionality added
  | 'refactor'      // Code restructured, behavior unchanged
  | 'change'        // Generic modification
  // Documentation & Config
  | 'docs'          // Documentation changes
  | 'config'        // Configuration/environment changes
  // Quality & Testing
  | 'test'          // Test implementation
  | 'security'      // Security fixes
  | 'performance'   // Optimization
  // Infrastructure
  | 'deploy'        // CI/CD, release
  | 'infra'         // Infrastructure, DevOps
  | 'migration'     // Database migrations
  // Knowledge Types
  | 'discovery'     // Learning about existing system
  | 'decision'      // Architectural choice
  | 'research';     // Investigation, analysis

OBSERVATION_SYSTEM_PROMPT (prompts.ts) - nur 7 Typen

- bugfix, feature, refactor, change, discovery, decision
- session-request ❌ EXISTIERT NICHT IN ObservationType

Fehlende Typen: 9 Stück

Typ Beschreibung
docs Documentation changes
config Configuration changes
test Test implementation
security Security fixes
performance Optimization
deploy Deployment
infra Infrastructure
migration Migrations
research Investigation

Teil 2: Fehlende Entity-Felder im Prompt

Observation Entity hat diese Felder die der Prompt NICHT abfragt:

Entity-Feld Beschreibung Sollte im Prompt?
concept Singular concept ⚠️ Prompt fragt nur concepts (plural)
source_files Quell-Dateien Unklar ob redundant zu files_read
git_branch Git Branch JA - wichtig für Kontext
decision_category Kategorie für decisions JA - wichtig für decision-Typen!

Aktueller Prompt XML Output:

<observation>
  <type>...</type>
  <title>...</title>
  <subtitle>...</subtitle>
  <text>...</text>
  <narrative>...</narrative>
  <facts>...</facts>
  <concepts>...</concepts>
  <files_read>...</files_read>
  <files_modified>...</files_modified>
</observation>

Vorgeschlagener erweiterter XML Output:

<observation>
  <type>...</type>
  <title>...</title>
  <subtitle>...</subtitle>
  <text>...</text>
  <narrative>...</narrative>
  <facts>...</facts>
  <concept>Main concept (singular)</concept>
  <concepts>Multiple concepts (one per line)</concepts>
  <files_read>...</files_read>
  <files_modified>...</files_modified>
  <git_branch>Current git branch if detectable</git_branch>
  <decision_category>For decisions: architecture, api, database, security, etc.</decision_category>
</observation>

Teil 3: Lösung

1. Typen im Prompt aktualisieren

Types of observations:

// Work Types (changes to codebase)
- bugfix: Fixing a bug or error in existing code
- feature: Adding new functionality or capability
- refactor: Restructuring code without changing behavior
- change: General modifications that don't fit other categories

// Documentation & Config
- docs: Documentation changes (README, comments, guides, JSDoc)
- config: Configuration or environment changes (.env, config files)

// Quality & Testing
- test: Test implementation, coverage improvements
- security: Security fixes, vulnerability patches
- performance: Optimization, profiling, speed improvements

// Infrastructure
- deploy: CI/CD, release, deployment changes
- infra: Infrastructure, DevOps, cloud resources
- migration: Database migrations, data transformations

// Knowledge Types
- discovery: Learning something new about the codebase
- decision: Making an architectural or design decision
- research: Investigation, analysis, exploration

2. XML Output erweitern

Felder hinzufügen:

  • <concept> (singular)
  • <git_branch>
  • <decision_category> (nur für type=decision)

3. session-request entfernen oder zu ObservationType hinzufügen

Entscheidung nötig: Ist session-request ein gültiger Typ?


Betroffene Dateien

  • packages/worker/src/handlers/prompts.ts - Prompt aktualisieren
  • packages/types/src/database.ts - Ggf. session-request hinzufügen
  • packages/worker/src/handlers/observation-handler.ts - Neue Felder parsen

Priorität

Hoch - Beeinflusst die Qualität aller extrahierten Observations

## Problem Der `OBSERVATION_SYSTEM_PROMPT` in `packages/worker/src/handlers/prompts.ts` ist nicht synchron mit: 1. `ObservationType` in `packages/types/src/database.ts` 2. `Observation` Entity in `packages/database/src/entities/Observation.ts` ## Teil 1: Fehlende Observation-Typen ### ObservationType (database.ts) - 16 Typen ```typescript export type ObservationType = // Work Types | 'bugfix' // Something was broken, now fixed | 'feature' // New capability or functionality added | 'refactor' // Code restructured, behavior unchanged | 'change' // Generic modification // Documentation & Config | 'docs' // Documentation changes | 'config' // Configuration/environment changes // Quality & Testing | 'test' // Test implementation | 'security' // Security fixes | 'performance' // Optimization // Infrastructure | 'deploy' // CI/CD, release | 'infra' // Infrastructure, DevOps | 'migration' // Database migrations // Knowledge Types | 'discovery' // Learning about existing system | 'decision' // Architectural choice | 'research'; // Investigation, analysis ``` ### OBSERVATION_SYSTEM_PROMPT (prompts.ts) - nur 7 Typen ``` - bugfix, feature, refactor, change, discovery, decision - session-request ❌ EXISTIERT NICHT IN ObservationType ``` ### Fehlende Typen: 9 Stück | Typ | Beschreibung | |-----|--------------| | `docs` | Documentation changes | | `config` | Configuration changes | | `test` | Test implementation | | `security` | Security fixes | | `performance` | Optimization | | `deploy` | Deployment | | `infra` | Infrastructure | | `migration` | Migrations | | `research` | Investigation | --- ## Teil 2: Fehlende Entity-Felder im Prompt ### Observation Entity hat diese Felder die der Prompt NICHT abfragt: | Entity-Feld | Beschreibung | Sollte im Prompt? | |-------------|--------------|-------------------| | `concept` | Singular concept | ⚠️ Prompt fragt nur `concepts` (plural) | | `source_files` | Quell-Dateien | ❓ Unklar ob redundant zu files_read | | `git_branch` | Git Branch | ✅ JA - wichtig für Kontext | | `decision_category` | Kategorie für decisions | ✅ JA - wichtig für decision-Typen! | ### Aktueller Prompt XML Output: ```xml <observation> <type>...</type> <title>...</title> <subtitle>...</subtitle> <text>...</text> <narrative>...</narrative> <facts>...</facts> <concepts>...</concepts> <files_read>...</files_read> <files_modified>...</files_modified> </observation> ``` ### Vorgeschlagener erweiterter XML Output: ```xml <observation> <type>...</type> <title>...</title> <subtitle>...</subtitle> <text>...</text> <narrative>...</narrative> <facts>...</facts> <concept>Main concept (singular)</concept> <concepts>Multiple concepts (one per line)</concepts> <files_read>...</files_read> <files_modified>...</files_modified> <git_branch>Current git branch if detectable</git_branch> <decision_category>For decisions: architecture, api, database, security, etc.</decision_category> </observation> ``` --- ## Teil 3: Lösung ### 1. Typen im Prompt aktualisieren ```typescript Types of observations: // Work Types (changes to codebase) - bugfix: Fixing a bug or error in existing code - feature: Adding new functionality or capability - refactor: Restructuring code without changing behavior - change: General modifications that don't fit other categories // Documentation & Config - docs: Documentation changes (README, comments, guides, JSDoc) - config: Configuration or environment changes (.env, config files) // Quality & Testing - test: Test implementation, coverage improvements - security: Security fixes, vulnerability patches - performance: Optimization, profiling, speed improvements // Infrastructure - deploy: CI/CD, release, deployment changes - infra: Infrastructure, DevOps, cloud resources - migration: Database migrations, data transformations // Knowledge Types - discovery: Learning something new about the codebase - decision: Making an architectural or design decision - research: Investigation, analysis, exploration ``` ### 2. XML Output erweitern Felder hinzufügen: - `<concept>` (singular) - `<git_branch>` - `<decision_category>` (nur für type=decision) ### 3. session-request entfernen oder zu ObservationType hinzufügen Entscheidung nötig: Ist `session-request` ein gültiger Typ? --- ## Betroffene Dateien - `packages/worker/src/handlers/prompts.ts` - Prompt aktualisieren - `packages/types/src/database.ts` - Ggf. session-request hinzufügen - `packages/worker/src/handlers/observation-handler.ts` - Neue Felder parsen ## Priorität Hoch - Beeinflusst die Qualität aller extrahierten Observations
Author
Owner

Fixed in commit 28a994c

Changes:

  • Extended OBSERVATION_SYSTEM_PROMPT from 7 to 21 types with categories
  • Added new XML output fields: concept, git_branch, decision_category
  • Synchronized VALID_TYPES in xml-parser.ts
  • Extended ParsedObservation interface with new fields
  • Updated ObservationTask result type
  • Added typecheck scripts to worker, backend, hooks packages
Fixed in commit 28a994c **Changes:** - Extended OBSERVATION_SYSTEM_PROMPT from 7 to 21 types with categories - Added new XML output fields: `concept`, `git_branch`, `decision_category` - Synchronized VALID_TYPES in xml-parser.ts - Extended ParsedObservation interface with new fields - Updated ObservationTask result type - Added typecheck scripts to worker, backend, hooks packages
jack closed this issue 2026-01-25 15:54:10 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
customable/claude-mem#292
No description provided.