19 Commits

Author SHA1 Message Date
f57fc14162 Merge branch '002-direct-db-access': Direct database access for scripts (v0.2.0) 2026-01-08 13:02:07 -05:00
05ffc3793c docs: update CLAUDE.md and bump version to 0.2.0
- Add persistent SQLite database to active technologies
- Update recent changes section for 002-direct-db-access
- Bump package version to 0.2.0 in uv.lock
2026-01-08 13:01:49 -05:00
e250cc7444 docs: mark all tasks as complete in tasks.md 2026-01-08 12:56:29 -05:00
d6a79bf24a feat: add direct database access for scripts (v0.2.0)
Implement persistent SQLite database feature that allows scripts to
query schedule data directly via SQL after loading XER files through MCP.

Key changes:
- Extend load_xer with db_path parameter for persistent database
- Add get_database_info tool to retrieve database connection details
- Add schema introspection with tables, columns, primary/foreign keys
- Support WAL mode for concurrent read access
- Use atomic write pattern to prevent corruption

New features:
- db_path=None: in-memory database (default, backward compatible)
- db_path="": auto-generate path from XER filename (.sqlite extension)
- db_path="/path/to/db": explicit persistent database path

Response includes complete DatabaseInfo:
- db_path: absolute path (or :memory:)
- is_persistent: boolean
- source_file: loaded XER path
- loaded_at: ISO timestamp
- schema: tables with columns, primary keys, foreign keys, row counts

Closes: User Story 1, 2, 3 from 002-direct-db-access spec
2026-01-08 12:54:56 -05:00
3e7ad39eb8 docs: add specification and implementation plan for direct database access feature
This feature (002-direct-db-access) enables scripts to query schedule data
directly via SQL after loading XER files through MCP. Key additions:

- spec.md: Feature specification with 3 user stories
- plan.md: Implementation plan with constitution check
- research.md: Technology decisions (SQLite file, WAL mode, atomic writes)
- data-model.md: DatabaseInfo, SchemaInfo, TableInfo entities
- contracts/mcp-tools.json: Extended load_xer schema, new get_database_info tool
- quickstart.md: Usage examples for direct database access
- tasks.md: 16 implementation tasks across 6 phases
2026-01-08 12:38:42 -05:00
48628fd30e Merge branch '001-schedule-tools'
# Conflicts:
#	README.md
2026-01-08 12:22:53 -05:00
a7b6b76db8 feat: add milestone_type field to distinguish start/finish milestones
Add milestone_type field to milestone queries that indicates whether
a milestone is a start milestone ('start') or finish milestone ('finish').

Changes:
- Add milestone_type column to activities table schema
- Parse milestone_type from XER TASK table (MS_Start/MS_Finish)
- Include milestone_type in list_milestones response
- Update contract tests for milestone_type field
- Update specs, contracts, and documentation

The milestone_type is determined by:
1. Explicit milestone_type field in XER (MS_Start -> 'start', MS_Finish -> 'finish')
2. Derived from task_type (TT_Mile -> 'start', TT_FinMile -> 'finish')
2026-01-08 12:18:34 -05:00
bf2f85813e fix: include finish milestones (TT_FinMile) in milestone queries
The list_milestones tool was only returning start milestones (TT_Mile)
and missing all finish milestones. P6 uses two task types for milestones:
- TT_Mile = Start Milestone
- TT_FinMile = Finish Milestone

Changes:
- Update query_milestones() to include both TT_Mile and TT_FinMile
- Derive milestone_type from task_type when not explicitly set:
  - TT_Mile -> 'start'
  - TT_FinMile -> 'finish'
- Add unit tests for milestone_type derivation from task_type

This fixes the E-J Electric schedule returning 5 milestones instead of 62.
2026-01-08 11:55:43 -05:00
af8cdc1d31 feat: add driving flag to relationship query responses
Add computed driving flag to all relationship queries (list_relationships,
get_predecessors, get_successors). A relationship is marked as driving when
the predecessor's early end date plus lag determines the successor's early
start date.

Changes:
- Add early_start_date and early_end_date columns to activities schema
- Parse early dates from TASK table in XER files
- Implement is_driving_relationship() helper with 24hr tolerance for
  calendar gaps
- Update all relationship queries to compute and return driving flag
- Add contract and unit tests for driving flag functionality
- Update spec, contracts, and documentation
2026-01-07 07:21:58 -05:00
2255b65ef6 feat: add data_date to project summary response
Include the schedule data date (last_recalc_date from XER) in the
get_project_summary tool response. This shows when the schedule
was last calculated in P6.

Changes:
- Add last_recalc_date column to projects table schema
- Parse last_recalc_date in PROJECT table handler
- Include last_recalc_date in db loader
- Return data_date field in get_project_summary query
- Update contract test to verify data_date presence
2026-01-06 22:42:10 -05:00
8fc2a87607 chore: add MCP server configuration for project 2026-01-06 22:31:08 -05:00
70c1cf3094 docs: add README with installation and usage instructions 2026-01-06 22:29:53 -05:00
a6413eaaae Initial commit 2026-01-06 21:31:07 -05:00
ccc8296418 feat: implement XER MCP Server with 9 schedule query tools
Implement complete MCP server for parsing Primavera P6 XER files and
exposing schedule data through MCP tools. All 4 user stories complete.

Tools implemented:
- load_xer: Parse XER files into SQLite database
- list_activities: Query activities with pagination and filtering
- get_activity: Get activity details by ID
- list_relationships: Query activity dependencies
- get_predecessors/get_successors: Query activity relationships
- get_project_summary: Project overview with counts
- list_milestones: Query milestone activities
- get_critical_path: Query driving path activities

Features:
- Tab-delimited XER format parsing with pluggable table handlers
- In-memory SQLite database for fast queries
- Pagination with 100-item default limit
- Multi-project file support with project selection
- ISO8601 date formatting
- NO_FILE_LOADED error handling for all query tools

Test coverage: 81 tests (contract, integration, unit)
2026-01-06 21:27:35 -05:00
2cd54118a1 docs: add implementation task list with 67 tasks
Task breakdown by user story:
- US1 Load XER File (P1): 17 tasks
- US2 Query Activities (P1): 10 tasks
- US3 Query Relationships (P2): 9 tasks
- US4 Query Summary (P3): 9 tasks

TDD mandated: test tasks precede implementation tasks.
Parallel opportunities identified for models, table handlers,
and concurrent user story development after US1.
2026-01-06 21:02:52 -05:00
d3474b0f8b docs: add implementation plan and clarify no-file-loaded errors
Plan artifacts:
- plan.md: Technical context, constitution check, project structure
- research.md: XER format, MCP SDK, SQLite schema decisions
- data-model.md: Entity definitions and database schema
- contracts/mcp-tools.json: MCP tool schemas (9 tools)
- quickstart.md: Usage guide with examples
- CLAUDE.md: Agent context file

Spec updates:
- Add FR-015: NO_FILE_LOADED error requirement
- Add acceptance scenarios for no-file-loaded errors to US3, US4
2026-01-06 20:57:55 -05:00
0170eb7fef docs: add project schedule tools feature specification
Feature spec for MCP tools to query XER schedule data:
- 4 user stories (load file, query activities, relationships, summary)
- 14 functional requirements including pagination (100 item default)
- Clarifications: P6 critical flags, multi-project selection, internal calendars
2026-01-06 19:58:42 -05:00
257135bac0 docs: establish project constitution v1.0.1
Define governance for XER MCP Server with 5 core principles:
- Test-First Development (TDD mandatory)
- Extensibility Architecture (pluggable handlers)
- MCP Protocol Compliance (strict spec adherence)
- XER Format Fidelity (no data loss)
- Semantic Versioning (MAJOR.MINOR.PATCH)

Technical standards: Python 3.14, type hints, testing gates
2026-01-06 19:37:19 -05:00
6df5818c13 Initial commit from Specify template 2026-01-06 19:22:06 -05:00