qp-conductor 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. qp_conductor-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +40 -0
  2. qp_conductor-0.1.0/.github/ISSUE_TEMPLATE/capability_request.md +45 -0
  3. qp_conductor-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
  4. qp_conductor-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +25 -0
  5. qp_conductor-0.1.0/.github/dependabot.yml +21 -0
  6. qp_conductor-0.1.0/.github/workflows/python-ci.yaml +62 -0
  7. qp_conductor-0.1.0/.gitignore +33 -0
  8. qp_conductor-0.1.0/CHANGELOG.md +44 -0
  9. qp_conductor-0.1.0/CODE_OF_CONDUCT.md +36 -0
  10. qp_conductor-0.1.0/CONTRIBUTING.md +110 -0
  11. qp_conductor-0.1.0/INTEGRATION.md +161 -0
  12. qp_conductor-0.1.0/LICENSE +111 -0
  13. qp_conductor-0.1.0/Makefile +22 -0
  14. qp_conductor-0.1.0/PKG-INFO +441 -0
  15. qp_conductor-0.1.0/README.md +388 -0
  16. qp_conductor-0.1.0/SECURITY.md +36 -0
  17. qp_conductor-0.1.0/pyproject.toml +111 -0
  18. qp_conductor-0.1.0/setup.cfg +4 -0
  19. qp_conductor-0.1.0/src/qp_conductor/__init__.py +241 -0
  20. qp_conductor-0.1.0/src/qp_conductor/adaptation/__init__.py +1 -0
  21. qp_conductor-0.1.0/src/qp_conductor/adaptation/engine.py +337 -0
  22. qp_conductor-0.1.0/src/qp_conductor/adaptation/models.py +323 -0
  23. qp_conductor-0.1.0/src/qp_conductor/adaptation/safety.py +338 -0
  24. qp_conductor-0.1.0/src/qp_conductor/adaptation/signals.py +293 -0
  25. qp_conductor-0.1.0/src/qp_conductor/capabilities/__init__.py +1 -0
  26. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/analysis/accounting_operations.yaml +55 -0
  27. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/analysis/comparative_analysis.yaml +42 -0
  28. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/analysis/criteria_evaluation.yaml +42 -0
  29. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/analysis/data_analysis.yaml +42 -0
  30. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/analysis/financial_analysis.yaml +45 -0
  31. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/analysis/hr_operations.yaml +53 -0
  32. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/analysis/legal_analysis.yaml +50 -0
  33. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/analysis/market_analysis.yaml +38 -0
  34. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/analysis/pattern_detection.yaml +43 -0
  35. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/analysis/risk_assessment.yaml +42 -0
  36. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/audio/audio_synthesis.yaml +49 -0
  37. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/audio/audio_transcription.yaml +53 -0
  38. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/audio/audio_understanding.yaml +53 -0
  39. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/audio/speaker_diarization.yaml +46 -0
  40. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/communication/progress_reporting.yaml +37 -0
  41. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/communication/stakeholder_communication.yaml +40 -0
  42. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/creation/code_generation.yaml +41 -0
  43. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/creation/content_creation.yaml +40 -0
  44. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/creation/documentation.yaml +39 -0
  45. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/creation/formal_document_generation.yaml +44 -0
  46. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/creation/test_generation.yaml +40 -0
  47. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/execution/deployment.yaml +41 -0
  48. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/execution/shell_execution.yaml +39 -0
  49. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/investigation/debugging.yaml +41 -0
  50. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/investigation/performance_analysis.yaml +41 -0
  51. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/investigation/research.yaml +39 -0
  52. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/investigation/root_cause_analysis.yaml +40 -0
  53. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/investigation/vision_analysis.yaml +51 -0
  54. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/planning/project_planning.yaml +40 -0
  55. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/planning/resource_planning.yaml +38 -0
  56. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/planning/strategic_planning.yaml +42 -0
  57. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/planning/task_decomposition.yaml +38 -0
  58. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/sysadmin/system_diagnosis.yaml +45 -0
  59. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/sysadmin/system_health_check.yaml +41 -0
  60. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/sysadmin/system_learning.yaml +42 -0
  61. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/sysadmin/system_remediation.yaml +45 -0
  62. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/sysadmin/system_validation.yaml +44 -0
  63. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/validation/code_review.yaml +41 -0
  64. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/validation/compliance_check.yaml +40 -0
  65. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/validation/evidence_collection.yaml +45 -0
  66. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/validation/security_audit.yaml +42 -0
  67. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry/validation/test_execution.yaml +39 -0
  68. qp_conductor-0.1.0/src/qp_conductor/capabilities/registry_loader.py +450 -0
  69. qp_conductor-0.1.0/src/qp_conductor/cli/__init__.py +1 -0
  70. qp_conductor-0.1.0/src/qp_conductor/cli/main.py +275 -0
  71. qp_conductor-0.1.0/src/qp_conductor/core/__init__.py +1 -0
  72. qp_conductor-0.1.0/src/qp_conductor/core/autonomy_calculator.py +440 -0
  73. qp_conductor-0.1.0/src/qp_conductor/core/autonomy_rules.yaml +230 -0
  74. qp_conductor-0.1.0/src/qp_conductor/core/capability_composer.py +491 -0
  75. qp_conductor-0.1.0/src/qp_conductor/core/capability_executor.py +520 -0
  76. qp_conductor-0.1.0/src/qp_conductor/core/checkpoint_manager.py +521 -0
  77. qp_conductor-0.1.0/src/qp_conductor/core/goal_analyzer.py +586 -0
  78. qp_conductor-0.1.0/src/qp_conductor/drift/__init__.py +1 -0
  79. qp_conductor-0.1.0/src/qp_conductor/drift/detector.py +211 -0
  80. qp_conductor-0.1.0/src/qp_conductor/genome/__init__.py +1 -0
  81. qp_conductor-0.1.0/src/qp_conductor/genome/parser.py +222 -0
  82. qp_conductor-0.1.0/src/qp_conductor/goals/__init__.py +1 -0
  83. qp_conductor-0.1.0/src/qp_conductor/goals/auto_approve_service.py +245 -0
  84. qp_conductor-0.1.0/src/qp_conductor/goals/goal_service.py +374 -0
  85. qp_conductor-0.1.0/src/qp_conductor/goals/task_service.py +307 -0
  86. qp_conductor-0.1.0/src/qp_conductor/integrations/__init__.py +1 -0
  87. qp_conductor-0.1.0/src/qp_conductor/integrations/fastapi.py +178 -0
  88. qp_conductor-0.1.0/src/qp_conductor/memory/__init__.py +1 -0
  89. qp_conductor-0.1.0/src/qp_conductor/memory/organizational.py +269 -0
  90. qp_conductor-0.1.0/src/qp_conductor/models/__init__.py +1 -0
  91. qp_conductor-0.1.0/src/qp_conductor/models/auto_approve.py +343 -0
  92. qp_conductor-0.1.0/src/qp_conductor/models/capability.py +657 -0
  93. qp_conductor-0.1.0/src/qp_conductor/models/goal.py +365 -0
  94. qp_conductor-0.1.0/src/qp_conductor/models/task.py +335 -0
  95. qp_conductor-0.1.0/src/qp_conductor/models/workflow.py +492 -0
  96. qp_conductor-0.1.0/src/qp_conductor/protocols.py +278 -0
  97. qp_conductor-0.1.0/src/qp_conductor/py.typed +0 -0
  98. qp_conductor-0.1.0/src/qp_conductor/scheduler/__init__.py +1 -0
  99. qp_conductor-0.1.0/src/qp_conductor/scheduler/scheduler.py +331 -0
  100. qp_conductor-0.1.0/src/qp_conductor/state_machines/__init__.py +1 -0
  101. qp_conductor-0.1.0/src/qp_conductor/state_machines/goal_state.py +242 -0
  102. qp_conductor-0.1.0/src/qp_conductor/state_machines/task_state.py +238 -0
  103. qp_conductor-0.1.0/src/qp_conductor/storage/__init__.py +6 -0
  104. qp_conductor-0.1.0/src/qp_conductor/storage/memory.py +233 -0
  105. qp_conductor-0.1.0/src/qp_conductor/storage/protocol.py +143 -0
  106. qp_conductor-0.1.0/src/qp_conductor.egg-info/PKG-INFO +441 -0
  107. qp_conductor-0.1.0/src/qp_conductor.egg-info/SOURCES.txt +134 -0
  108. qp_conductor-0.1.0/src/qp_conductor.egg-info/dependency_links.txt +1 -0
  109. qp_conductor-0.1.0/src/qp_conductor.egg-info/entry_points.txt +2 -0
  110. qp_conductor-0.1.0/src/qp_conductor.egg-info/requires.txt +33 -0
  111. qp_conductor-0.1.0/src/qp_conductor.egg-info/top_level.txt +1 -0
  112. qp_conductor-0.1.0/tests/__init__.py +0 -0
  113. qp_conductor-0.1.0/tests/test_adaptation_engine.py +190 -0
  114. qp_conductor-0.1.0/tests/test_auto_approve.py +224 -0
  115. qp_conductor-0.1.0/tests/test_autonomy_calculator.py +99 -0
  116. qp_conductor-0.1.0/tests/test_capability_composer.py +151 -0
  117. qp_conductor-0.1.0/tests/test_capability_registry.py +166 -0
  118. qp_conductor-0.1.0/tests/test_checkpoint_manager.py +205 -0
  119. qp_conductor-0.1.0/tests/test_cli.py +26 -0
  120. qp_conductor-0.1.0/tests/test_coverage_boost.py +426 -0
  121. qp_conductor-0.1.0/tests/test_coverage_final.py +585 -0
  122. qp_conductor-0.1.0/tests/test_drift_detector.py +100 -0
  123. qp_conductor-0.1.0/tests/test_genome_parser.py +154 -0
  124. qp_conductor-0.1.0/tests/test_goal_analyzer.py +64 -0
  125. qp_conductor-0.1.0/tests/test_goal_service.py +132 -0
  126. qp_conductor-0.1.0/tests/test_goal_state_machine.py +217 -0
  127. qp_conductor-0.1.0/tests/test_integration.py +238 -0
  128. qp_conductor-0.1.0/tests/test_llm_integration.py +389 -0
  129. qp_conductor-0.1.0/tests/test_memory.py +129 -0
  130. qp_conductor-0.1.0/tests/test_models.py +304 -0
  131. qp_conductor-0.1.0/tests/test_phase6.py +450 -0
  132. qp_conductor-0.1.0/tests/test_protocol_compatibility.py +305 -0
  133. qp_conductor-0.1.0/tests/test_safety_gates.py +258 -0
  134. qp_conductor-0.1.0/tests/test_scheduler.py +177 -0
  135. qp_conductor-0.1.0/tests/test_task_service.py +165 -0
  136. qp_conductor-0.1.0/tests/test_task_state_machine.py +206 -0
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Report a bug in qp-conductor
4
+ title: "[Bug] "
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Describe the Bug
10
+
11
+ A clear description of what the bug is.
12
+
13
+ ## To Reproduce
14
+
15
+ ```python
16
+ from qp_conductor import GoalService, InMemoryStorage
17
+
18
+ storage = InMemoryStorage()
19
+ service = GoalService(storage=storage)
20
+ # Minimal reproducer here
21
+ ```
22
+
23
+ ## Expected Behavior
24
+
25
+ What you expected to happen.
26
+
27
+ ## Actual Behavior
28
+
29
+ What actually happened. Include the full traceback if applicable.
30
+
31
+ ## Environment
32
+
33
+ - **OS**: (e.g., macOS 15, Ubuntu 24.04)
34
+ - **Python**: (e.g., 3.12.4)
35
+ - **qp-conductor version**: (e.g., 0.1.0)
36
+ - **Install extras**: (e.g., `[vault]`, `[redis]`)
37
+
38
+ ## Additional Context
39
+
40
+ Any other context about the problem.
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: Capability Request
3
+ about: Suggest a new capability for the registry
4
+ title: "[Capability] "
5
+ labels: capability
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Domain
10
+
11
+ - [ ] Analysis
12
+ - [ ] Planning
13
+ - [ ] Creation
14
+ - [ ] Investigation
15
+ - [ ] Validation
16
+ - [ ] Communication
17
+ - [ ] Execution
18
+ - [ ] Audio
19
+ - [ ] Sysadmin
20
+ - [ ] New domain
21
+
22
+ ## Description
23
+
24
+ What would this capability do?
25
+
26
+ ## Use Case
27
+
28
+ Who would use this and why?
29
+
30
+ ## Proposed YAML
31
+
32
+ ```yaml
33
+ name: my_capability
34
+ domain: analysis
35
+ description: What this capability does
36
+ risk_level: medium
37
+ required_tools:
38
+ - tool_name
39
+ dependencies: []
40
+ estimated_duration_minutes: 10
41
+ ```
42
+
43
+ ## Additional Context
44
+
45
+ Links to relevant tools, APIs, or documentation.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest an enhancement to qp-conductor
4
+ title: "[Feature] "
5
+ labels: enhancement
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Problem
10
+
11
+ What problem does this solve? What use case is not currently supported?
12
+
13
+ ## Proposed Solution
14
+
15
+ Describe your preferred approach.
16
+
17
+ ## Alternatives Considered
18
+
19
+ What other approaches did you consider?
20
+
21
+ ## Additional Context
22
+
23
+ Any other context, screenshots, or references.
@@ -0,0 +1,25 @@
1
+ ## Summary
2
+
3
+ What does this PR do? Link to any related issues.
4
+
5
+ ## Type of Change
6
+
7
+ - [ ] Bug fix (non-breaking change that fixes an issue)
8
+ - [ ] New feature (non-breaking change that adds functionality)
9
+ - [ ] Breaking change (fix or feature that changes existing behavior)
10
+ - [ ] New capability (YAML definition in the registry)
11
+ - [ ] Documentation update
12
+ - [ ] Test improvement
13
+
14
+ ## Checklist
15
+
16
+ - [ ] Tests pass: `make test`
17
+ - [ ] Linter passes: `make lint`
18
+ - [ ] No deprecation warnings
19
+ - [ ] Documentation updated (if applicable)
20
+ - [ ] CHANGELOG.md updated (if user-facing change)
21
+ - [ ] Safety constraints preserved (HIGH-risk never auto-approved)
22
+
23
+ ## How Has This Been Tested?
24
+
25
+ Describe the tests that cover this change.
@@ -0,0 +1,21 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ labels:
8
+ - "dependencies"
9
+ - "python"
10
+ commit-message:
11
+ prefix: "deps"
12
+
13
+ - package-ecosystem: "github-actions"
14
+ directory: "/"
15
+ schedule:
16
+ interval: "weekly"
17
+ labels:
18
+ - "dependencies"
19
+ - "ci"
20
+ commit-message:
21
+ prefix: "ci"
@@ -0,0 +1,62 @@
1
+ name: Python CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags: ["v*"]
7
+ pull_request:
8
+ branches: [main]
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ lint:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: actions/setup-python@v6
19
+ with:
20
+ python-version: "3.12"
21
+ - run: pip install ruff
22
+ - run: ruff check src/ tests/
23
+
24
+ typecheck:
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+ - uses: actions/setup-python@v6
29
+ with:
30
+ python-version: "3.12"
31
+ - run: pip install -e ".[dev]"
32
+ - run: mypy src/qp_conductor/
33
+
34
+ test:
35
+ runs-on: ubuntu-latest
36
+ strategy:
37
+ matrix:
38
+ python-version: ["3.12", "3.13", "3.14"]
39
+ steps:
40
+ - uses: actions/checkout@v4
41
+ - uses: actions/setup-python@v6
42
+ with:
43
+ python-version: ${{ matrix.python-version }}
44
+ allow-prereleases: true
45
+ - run: pip install -e ".[dev]"
46
+ - run: pytest tests/ -v --tb=short --cov=qp_conductor --cov-report=term-missing
47
+
48
+ publish:
49
+ needs: [lint, test]
50
+ if: startsWith(github.ref, 'refs/tags/v')
51
+ runs-on: ubuntu-latest
52
+ environment: pypi
53
+ permissions:
54
+ id-token: write
55
+ steps:
56
+ - uses: actions/checkout@v4
57
+ - uses: actions/setup-python@v6
58
+ with:
59
+ python-version: "3.12"
60
+ - run: pip install build
61
+ - run: python -m build
62
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,33 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+
8
+ # Virtual environments
9
+ .venv/
10
+ venv/
11
+
12
+ # Testing
13
+ .pytest_cache/
14
+ .coverage
15
+ htmlcov/
16
+
17
+ # Linting & Type Checking
18
+ .ruff_cache/
19
+ .mypy_cache/
20
+
21
+ # IDE
22
+ .idea/
23
+ .vscode/
24
+ *.swp
25
+ *.swo
26
+
27
+ # OS
28
+ .DS_Store
29
+ Thumbs.db
30
+
31
+ # Database
32
+ *.db
33
+ *.sqlite
@@ -0,0 +1,44 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2026-04-07
11
+
12
+ ### Added
13
+ - Initial release
14
+ - **Goal Analyzer**: Natural language to capability requirements with intent classification (GOAL/SPECIFICATION/HYBRID/AMBIGUOUS)
15
+ - **Capability Composer**: Requirements to dependency-ordered execution plan via topological sort
16
+ - **Autonomy Calculator**: YAML-configured oversight levels (L0 blocked through L4 fully autonomous)
17
+ - **Conductor**: Multi-agent orchestration with parallel execution and Capsule sealing
18
+ - **Checkpoint Manager**: Human approval gates with async wait pattern
19
+ - **Adaptation Engine**: Self-improvement via signal capture, pattern mining, safety validation, adapter creation
20
+ - **Drift Detector**: Behavioral consistency monitoring via cosine distance on embedding fingerprints
21
+ - **Organizational Memory**: Learn from past goals (in-memory + optional Vault backend)
22
+ - **Persistent Scheduler**: Cron-based recurring workflows
23
+ - **Priority Inbox**: Risk-sorted task approval (HIGH risk first, LOW confidence first, OLDEST first)
24
+ - **Auto-Approval Rules**: Pattern-based with safety constraints (HIGH-risk tasks never auto-approved)
25
+ - **Goal State Machine**: 25 transitions covering the full goal lifecycle
26
+ - **Task State Machine**: 14 transitions from PENDING through COMPLETED/FAILED
27
+ - **42 capabilities** across 9 domains (analysis, planning, creation, investigation, validation, communication, execution, audio, sysadmin)
28
+ - **Goal Service**: Create, clarify, cancel, update progress
29
+ - **Task Service**: Approve, decline, skip, retry, batch operations
30
+ - **Auto-Approve Service**: Rule CRUD with safety enforcement
31
+ - **InMemoryStorage**: Zero-dependency storage backend for development
32
+ - **Protocol interfaces**: LLM, Agent, AgentRegistry, CapsuleChain, Seal, KillSwitch, Vault
33
+ - **Safety gates**: Forbidden patterns (injection), forbidden agents (auditor, deployer), HIGH-risk never auto-approved
34
+ - **Hub Genome parser**: YAML to autonomous business configuration
35
+ - 459 tests with 90% coverage threshold
36
+
37
+ ### Security
38
+ - HIGH-risk tasks always require human review
39
+ - Security agents (auditor, deployer) cannot receive prompt modifications
40
+ - Shell injection, SQL injection, path traversal, and secret leakage patterns blocked
41
+ - Kill switch checked on every agent iteration
42
+
43
+ [unreleased]: https://github.com/quantumpipes/conductor/compare/v0.1.0...HEAD
44
+ [0.1.0]: https://github.com/quantumpipes/conductor/releases/tag/v0.1.0
@@ -0,0 +1,36 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to a positive environment:
15
+
16
+ * Using welcoming and inclusive language
17
+ * Being respectful of differing viewpoints and experiences
18
+ * Gracefully accepting constructive criticism
19
+ * Focusing on what is best for the community
20
+
21
+ Examples of unacceptable behavior:
22
+
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information without explicit permission
26
+ * Other conduct which could reasonably be considered inappropriate
27
+
28
+ ## Enforcement
29
+
30
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
31
+ reported to the project team at conduct@quantumpipes.io.
32
+
33
+ ## Attribution
34
+
35
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
36
+ version 2.0.
@@ -0,0 +1,110 @@
1
+ # Contributing to qp-conductor
2
+
3
+ Thank you for your interest in contributing to qp-conductor. This document explains how to get involved.
4
+
5
+ ## Repository Structure
6
+
7
+ ```
8
+ conductor/
9
+ ├── src/qp_conductor/ <- Source code
10
+ │ ├── core/ <- GoalAnalyzer, CapabilityComposer, AutonomyCalculator, CheckpointManager
11
+ │ ├── models/ <- Goal, Task, Workflow, Capability, AutoApprove dataclasses
12
+ │ ├── state_machines/ <- GoalStateMachine (25 transitions), TaskStateMachine (14 transitions)
13
+ │ ├── capabilities/ <- CapabilityRegistry + 42 YAML definitions across 9 domains
14
+ │ ├── goals/ <- GoalService, TaskService, AutoApproveService
15
+ │ ├── storage/ <- StorageProtocol + InMemoryStorage
16
+ │ ├── adaptation/ <- AdaptationEngine, SignalCapture, SafetyGates
17
+ │ ├── drift/ <- BehavioralDriftDetector (cosine distance)
18
+ │ ├── memory/ <- OrganizationalMemory (in-memory + optional Vault)
19
+ │ ├── scheduler/ <- Cron scheduler
20
+ │ ├── genome/ <- Hub Genome parser
21
+ │ ├── cli/ <- Typer CLI
22
+ │ ├── integrations/ <- FastAPI mount
23
+ │ └── protocols.py <- Protocol interfaces for all external integration
24
+ ├── tests/ <- Test suite (459 tests)
25
+ └── INTEGRATION.md <- Cross-package integration guide
26
+ ```
27
+
28
+ ## Getting Started
29
+
30
+ ```bash
31
+ git clone https://github.com/quantumpipes/conductor.git
32
+ cd conductor
33
+ pip install -e ".[dev]"
34
+ make test
35
+ ```
36
+
37
+ ## Types of Contributions
38
+
39
+ ### Bug Fixes
40
+
41
+ - Open an issue describing the bug
42
+ - Include a minimal reproduction case
43
+ - Submit a PR with a test that fails before the fix and passes after
44
+
45
+ ### New Capabilities
46
+
47
+ Add a YAML file to `src/qp_conductor/capabilities/registry/`:
48
+
49
+ ```yaml
50
+ name: my_capability
51
+ domain: analysis
52
+ description: What this capability does
53
+ risk_level: medium
54
+ required_tools:
55
+ - tool_name
56
+ dependencies: []
57
+ estimated_duration_minutes: 10
58
+ ```
59
+
60
+ No code changes required. The registry auto-discovers YAML files.
61
+
62
+ ### New Storage Backends
63
+
64
+ Implement the `StorageProtocol` in `src/qp_conductor/storage/`:
65
+
66
+ ```python
67
+ class StorageProtocol(Protocol):
68
+ async def save_goal(self, goal: Goal) -> None: ...
69
+ async def get_goal(self, goal_id: str) -> Goal | None: ...
70
+ async def save_task(self, task: Task) -> None: ...
71
+ # ... see storage/protocol.py for full interface
72
+ ```
73
+
74
+ ### Documentation
75
+
76
+ Improvements to README, INTEGRATION.md, examples, and tutorials.
77
+
78
+ ## Code Standards
79
+
80
+ - **Type hints** on all function signatures
81
+ - **Docstrings** on all public classes and methods
82
+ - **Tests** for all new functionality (target 90% coverage)
83
+ - **Async-first**: all I/O operations must be async
84
+ - **Protocol-based**: never import directly from external packages (Core, Capsule, Vault)
85
+ - **Safety-first**: HIGH-risk operations always require human review
86
+
87
+ ## Running Tests
88
+
89
+ ```bash
90
+ make test # Run full test suite with coverage
91
+ make lint # Run ruff linter
92
+ make typecheck # Run mypy type checker
93
+ make test-all # All of the above
94
+ ```
95
+
96
+ ## Submitting Changes
97
+
98
+ 1. Fork the repository
99
+ 2. Create a feature branch from `main`
100
+ 3. Write tests alongside your code
101
+ 4. Ensure `make test-all` passes
102
+ 5. Submit a pull request
103
+
104
+ ## Security
105
+
106
+ If you discover a security vulnerability, please report it privately. See [SECURITY.md](SECURITY.md).
107
+
108
+ ## License
109
+
110
+ By contributing, you agree that your contributions will be licensed under the Apache License 2.0.
@@ -0,0 +1,161 @@
1
+ # qp-conductor Integration Guide
2
+
3
+ > How Conductor integrates with every other repos/ package.
4
+
5
+ ---
6
+
7
+ ## Protocol-Based Architecture
8
+
9
+ Conductor uses **structural subtyping (Protocols)** for all external dependencies. This means:
10
+ - Conductor never `import`s from Core, Capsule, or Vault directly
11
+ - Any object matching the Protocol interface works (duck typing)
12
+ - Consumers wire up the real implementations at initialization
13
+
14
+ ```python
15
+ from qp_conductor.protocols import (
16
+ LLMProtocol, # Core's CapabilityRouter.chat()
17
+ AgentProtocol, # Core's Agent
18
+ AgentRegistryProtocol, # Agent lookup by type
19
+ CapsuleChainProtocol, # qp-capsule's CapsuleChain.add()
20
+ SealProtocol, # qp-capsule's Seal
21
+ KillSwitchProtocol, # Core's KillSwitch
22
+ VaultProtocol, # qp-vault's AsyncVault
23
+ )
24
+ ```
25
+
26
+ ---
27
+
28
+ ## Integration Map
29
+
30
+ ### quantumpipes (Core) v1.1.0
31
+
32
+ | Conductor Needs | Core Provides | Protocol | How to Wire |
33
+ |-----------------|---------------|----------|-------------|
34
+ | LLM inference | `CapabilityRouter.chat()` | `LLMProtocol` | Pass router instance |
35
+ | Agent execution | `Agent.execute(task)` -> `LoopResult` | `AgentProtocol` | Pass Agent instance |
36
+ | Agent stop | `Agent.stop()` | `AgentProtocol` | Built into protocol |
37
+ | Kill switch check | `KillSwitch.check()` / `.check_raise()` | `KillSwitchProtocol` | `KillSwitch.get()` singleton |
38
+ | Joy scoring | `JoyCalculator.compute()` | Direct import (optional) | Optional dependency |
39
+ | Novelty detection | `NoveltyCalculator` | Direct import (optional) | Optional dependency |
40
+
41
+ **Key API notes:**
42
+ - `Agent.execute(task: str, session_id: str | None)` returns `LoopResult` (success, result, error, capsules, iterations, duration_ms)
43
+ - `CapabilityRouter.chat(messages: list[dict], **kwargs)` returns `dict` with `content`, `model`, `usage`
44
+ - `KillSwitch` is a singleton: `KillSwitch.get()`. Once killed, cannot be undone.
45
+
46
+ ### qp-capsule v1.5.3
47
+
48
+ | Conductor Needs | Capsule Provides | Protocol | How to Wire |
49
+ |-----------------|------------------|----------|-------------|
50
+ | Chain capsules | `CapsuleChain.add(capsule)` | `CapsuleChainProtocol` | Pass chain instance |
51
+ | Seal capsules | `Seal.seal(capsule)` / `.verify(capsule)` | `SealProtocol` | Pass seal instance |
52
+ | Create capsules | `Capsule(type=..., trigger=..., ...)` | Direct dataclass | Import Capsule from qp-capsule |
53
+
54
+ **Key API notes:**
55
+ - `Capsule` has 6 sections: TriggerSection, ContextSection, ReasoningSection, AuthoritySection, ExecutionSection, OutcomeSection
56
+ - `CapsuleType` enum: AGENT, TOOL, SYSTEM, KILL, WORKFLOW, CHAT, VAULT, AUTH
57
+ - `Seal` requires filesystem access to `~/.quantumpipes/key` for Ed25519 keys
58
+ - Chain links `previous_hash` and `sequence` automatically
59
+
60
+ ### qp-vault v1.2.0
61
+
62
+ | Conductor Needs | Vault Provides | Protocol | How to Wire |
63
+ |-----------------|---------------|----------|-------------|
64
+ | Store memories | `AsyncVault.add(source, name, trust_tier, layer, metadata)` | `VaultProtocol` | Pass vault instance |
65
+ | Search memories | `AsyncVault.search(query, tenant_id, top_k)` | `VaultProtocol` | Pass vault instance |
66
+ | Get content | `AsyncVault.get_content(resource_id)` | `VaultProtocol` | Pass vault instance |
67
+
68
+ **Key API notes:**
69
+ - `search()` returns `list[SearchResult]` with trust-weighted relevance scores
70
+ - `add()` accepts `trust_tier` (CANONICAL, WORKING, EPHEMERAL, ARCHIVED) and `layer` (OPERATIONAL, STRATEGIC, COMPLIANCE)
71
+ - Organizational memories should use `trust_tier=WORKING`, `layer=STRATEGIC`
72
+
73
+ ### Hub v1.0.1
74
+
75
+ Hub renders Conductor data but does NOT depend on Conductor directly. Hub talks to Core's FastAPI, which uses Conductor internally.
76
+
77
+ | Hub Feature | What It Renders | Data Source |
78
+ |-------------|----------------|-------------|
79
+ | Priority Inbox | Pending review tasks sorted by risk/confidence/age | `TaskService.get_pending_review_tasks()` |
80
+ | Goal Progress | Goal status, progress bars, outcome achievement | `Goal.to_dict()` |
81
+ | Workflow Visualization | Phase execution timeline | `Workflow.to_dict()` |
82
+ | Capsule Chain | Audit trail of orchestration decisions | Capsule viewer (existing) |
83
+ | Autonomy Indicator | Current autonomy level with reasoning | `AutonomyDecision.to_dict()` |
84
+
85
+ ### Conduit v0.1.0
86
+
87
+ Conductor does not integrate with Conduit directly. Conduit manages infrastructure (DNS, TLS, routing). If Conductor schedules a deployment workflow, the Deployer agent would interact with Conduit via tools.
88
+
89
+ ### Tunnel v0.1.0
90
+
91
+ Conductor does not integrate with Tunnel directly. Tunnel provides VPN access. Conductor operates within the network that Tunnel secures.
92
+
93
+ ---
94
+
95
+ ## Wiring Example
96
+
97
+ ```python
98
+ from quantumpipes import Agent, AgentConfig, KillSwitch
99
+ from quantumpipes.intelligence import CapabilityRouter
100
+ from qp_capsule import Capsule, CapsuleChain, CapsuleStorage, Seal
101
+ from qp_vault import AsyncVault
102
+
103
+ from qp_conductor import Goal, GoalStateMachine
104
+ from qp_conductor.capabilities.registry_loader import CapabilityRegistry
105
+ from qp_conductor.core.capability_composer import CapabilityComposer
106
+ from qp_conductor.core.autonomy_calculator import AutonomyCalculator
107
+ from qp_conductor.core.goal_analyzer import GoalAnalyzer
108
+ from qp_conductor.core.checkpoint_manager import CheckpointManager
109
+
110
+ # Initialize external dependencies
111
+ router = CapabilityRouter(providers={...})
112
+ agent = Agent(config=AgentConfig(model="llama3.2:3b"))
113
+ kill_switch = KillSwitch.get()
114
+ capsule_chain = CapsuleChain(CapsuleStorage("conductor.db"))
115
+ seal = Seal()
116
+ vault = await AsyncVault.create(path="./vault")
117
+
118
+ # Initialize Conductor components with protocols
119
+ registry = CapabilityRegistry()
120
+ analyzer = GoalAnalyzer(
121
+ capability_registry=registry,
122
+ llm_service=router, # Satisfies LLMProtocol
123
+ )
124
+ composer = CapabilityComposer(capability_registry=registry)
125
+ calculator = AutonomyCalculator(capability_registry=registry)
126
+ checkpoints = CheckpointManager()
127
+
128
+ # Create and analyze a goal
129
+ goal = Goal(description="Prepare Q4 tax filings")
130
+ sm = GoalStateMachine(goal)
131
+ sm.start_planning()
132
+
133
+ analysis = await analyzer.analyze(goal.description, goal_id=str(goal.id))
134
+ plan = await composer.compose(analysis)
135
+ decision = calculator.calculate(analysis=analysis, plan=plan)
136
+
137
+ print(f"Plan: {len(plan.steps)} steps, autonomy L{decision.numeric_level}")
138
+ ```
139
+
140
+ ---
141
+
142
+ ## Future Phase Integration Notes
143
+
144
+ ### Phase 3 (Goal/Task Services)
145
+ - GoalService needs LLMProtocol for intent extraction
146
+ - TaskService needs no external deps (pure state machine + storage)
147
+ - AutoApproveService needs no external deps
148
+
149
+ ### Phase 4 (Adaptation Engine)
150
+ - SignalCapture needs CapsuleChainProtocol for adapter audit
151
+ - AdapterStore needs SealProtocol for Ed25519 signing
152
+ - SafetyGates needs no external deps (pure validation)
153
+
154
+ ### Phase 5 (Drift + Memory + Scheduler)
155
+ - DriftDetector needs LLMProtocol for embedding generation (or a separate EmbeddingProtocol)
156
+ - OrganizationalMemory needs VaultProtocol for storage and search
157
+ - Scheduler needs no external deps (SQLite built-in)
158
+
159
+ ### Phase 6 (CLI + FastAPI)
160
+ - CLI wraps all services
161
+ - FastAPI module uses same Protocols for dependency injection