sdd-plus 0.3.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 (121) hide show
  1. sdd_plus-0.3.0/.github/THIRD_PARTY_AUDIT_PROMPT.md +101 -0
  2. sdd_plus-0.3.0/.github/workflows/ci.yml +81 -0
  3. sdd_plus-0.3.0/.github/workflows/publish.yml +76 -0
  4. sdd_plus-0.3.0/.gitignore +41 -0
  5. sdd_plus-0.3.0/AGENTS.md +475 -0
  6. sdd_plus-0.3.0/AGENTS.yaml +45 -0
  7. sdd_plus-0.3.0/BEHAVIOR_NORMS.md +314 -0
  8. sdd_plus-0.3.0/CHANGELOG.md +61 -0
  9. sdd_plus-0.3.0/CLAUDE.md +495 -0
  10. sdd_plus-0.3.0/CODEX.md +341 -0
  11. sdd_plus-0.3.0/CONTRIBUTING.md +351 -0
  12. sdd_plus-0.3.0/DECISIONS.md +320 -0
  13. sdd_plus-0.3.0/LICENSE +21 -0
  14. sdd_plus-0.3.0/PKG-INFO +195 -0
  15. sdd_plus-0.3.0/PROJECT_SETUP.md +408 -0
  16. sdd_plus-0.3.0/README.md +151 -0
  17. sdd_plus-0.3.0/RESUMEN_COPY_PASTE.md +262 -0
  18. sdd_plus-0.3.0/pyproject.toml +105 -0
  19. sdd_plus-0.3.0/sdd/__init__.py +7 -0
  20. sdd_plus-0.3.0/sdd/artifacts/CONTRACT.yaml +85 -0
  21. sdd_plus-0.3.0/sdd/artifacts/PHASE_1_AUDIT.yaml +76 -0
  22. sdd_plus-0.3.0/sdd/artifacts/PHASE_1_CONTRACT.yaml +149 -0
  23. sdd_plus-0.3.0/sdd/artifacts/PHASE_1_SPEC.yaml +156 -0
  24. sdd_plus-0.3.0/sdd/artifacts/PHASE_2_AUDIT.yaml +130 -0
  25. sdd_plus-0.3.0/sdd/artifacts/PHASE_2_CONTRACT.yaml +208 -0
  26. sdd_plus-0.3.0/sdd/artifacts/PHASE_2_SPEC.yaml +183 -0
  27. sdd_plus-0.3.0/sdd/artifacts/PHASE_3_AUDIT.yaml +21 -0
  28. sdd_plus-0.3.0/sdd/artifacts/PHASE_3_CONTRACT.yaml +144 -0
  29. sdd_plus-0.3.0/sdd/artifacts/PHASE_3_SPEC.yaml +218 -0
  30. sdd_plus-0.3.0/sdd/artifacts/PHASE_4_AUDIT.yaml +22 -0
  31. sdd_plus-0.3.0/sdd/artifacts/PHASE_4_CONTRACT.yaml +180 -0
  32. sdd_plus-0.3.0/sdd/artifacts/PHASE_4_ROADMAP.md +271 -0
  33. sdd_plus-0.3.0/sdd/artifacts/PHASE_4_SPEC.yaml +218 -0
  34. sdd_plus-0.3.0/sdd/artifacts/PHASE_5_AUDIT.yaml +22 -0
  35. sdd_plus-0.3.0/sdd/artifacts/PHASE_5_CONTRACT.yaml +138 -0
  36. sdd_plus-0.3.0/sdd/artifacts/PHASE_5_SPEC.yaml +171 -0
  37. sdd_plus-0.3.0/sdd/artifacts/PHASE_6_AUDIT.yaml +33 -0
  38. sdd_plus-0.3.0/sdd/artifacts/PHASE_6_CONTRACT.yaml +127 -0
  39. sdd_plus-0.3.0/sdd/artifacts/PHASE_6_SPEC.yaml +151 -0
  40. sdd_plus-0.3.0/sdd/artifacts/PHASE_7_AUDIT.yaml +22 -0
  41. sdd_plus-0.3.0/sdd/artifacts/PHASE_7_CONTRACT.yaml +87 -0
  42. sdd_plus-0.3.0/sdd/artifacts/PHASE_7_SPEC.yaml +111 -0
  43. sdd_plus-0.3.0/sdd/artifacts/STATE_SNAPSHOT.yaml +19 -0
  44. sdd_plus-0.3.0/sdd/artifacts/USER_STORY.yaml +49 -0
  45. sdd_plus-0.3.0/sdd/artifacts/examples/invalid_contract.yaml +15 -0
  46. sdd_plus-0.3.0/sdd/artifacts/examples/valid_contract.yaml +40 -0
  47. sdd_plus-0.3.0/sdd/behavior/BEHAVIOR_NORMS.md +314 -0
  48. sdd_plus-0.3.0/sdd/cli/__init__.py +0 -0
  49. sdd_plus-0.3.0/sdd/cli/commands/__init__.py +0 -0
  50. sdd_plus-0.3.0/sdd/cli/commands/audit.py +346 -0
  51. sdd_plus-0.3.0/sdd/cli/commands/check_patterns.py +111 -0
  52. sdd_plus-0.3.0/sdd/cli/commands/dashboard.py +36 -0
  53. sdd_plus-0.3.0/sdd/cli/commands/init.py +83 -0
  54. sdd_plus-0.3.0/sdd/cli/commands/install_hooks.py +44 -0
  55. sdd_plus-0.3.0/sdd/cli/commands/metrics.py +93 -0
  56. sdd_plus-0.3.0/sdd/cli/commands/new_phase.py +207 -0
  57. sdd_plus-0.3.0/sdd/cli/commands/projects.py +51 -0
  58. sdd_plus-0.3.0/sdd/cli/commands/status.py +32 -0
  59. sdd_plus-0.3.0/sdd/cli/commands/transition.py +213 -0
  60. sdd_plus-0.3.0/sdd/cli/commands/validate.py +63 -0
  61. sdd_plus-0.3.0/sdd/cli/main.py +33 -0
  62. sdd_plus-0.3.0/sdd/enforcement.py +247 -0
  63. sdd_plus-0.3.0/sdd/git_integration.py +134 -0
  64. sdd_plus-0.3.0/sdd/handoffs/CODEX_CLI_PROMPT.txt +17 -0
  65. sdd_plus-0.3.0/sdd/handoffs/CODEX_STARTUP_PROMPT.txt +53 -0
  66. sdd_plus-0.3.0/sdd/handoffs/PHASE_2_BRIEFING.md +149 -0
  67. sdd_plus-0.3.0/sdd/handoffs/PHASE_2_HANDOFF.md +77 -0
  68. sdd_plus-0.3.0/sdd/handoffs/PHASE_3_HANDOFF.md +29 -0
  69. sdd_plus-0.3.0/sdd/handoffs/PHASE_3_TO_4.md +37 -0
  70. sdd_plus-0.3.0/sdd/handoffs/PHASE_4_TO_5.md +32 -0
  71. sdd_plus-0.3.0/sdd/handoffs/PHASE_5_TO_6.md +20 -0
  72. sdd_plus-0.3.0/sdd/handoffs/PHASE_6_TO_7.md +22 -0
  73. sdd_plus-0.3.0/sdd/handoffs/PROTOCOL.md +121 -0
  74. sdd_plus-0.3.0/sdd/logs/.gitkeep +0 -0
  75. sdd_plus-0.3.0/sdd/schemas/__init__.py +18 -0
  76. sdd_plus-0.3.0/sdd/schemas/agent.py +68 -0
  77. sdd_plus-0.3.0/sdd/schemas/audit.py +51 -0
  78. sdd_plus-0.3.0/sdd/schemas/base.py +53 -0
  79. sdd_plus-0.3.0/sdd/schemas/contract.py +76 -0
  80. sdd_plus-0.3.0/sdd/schemas/spec.py +55 -0
  81. sdd_plus-0.3.0/sdd/schemas/state.py +38 -0
  82. sdd_plus-0.3.0/sdd/schemas/story.py +31 -0
  83. sdd_plus-0.3.0/sdd/skills/__init__.py +0 -0
  84. sdd_plus-0.3.0/sdd/state-machine/STATE_MACHINE.yaml +109 -0
  85. sdd_plus-0.3.0/sdd/state_machine/__init__.py +0 -0
  86. sdd_plus-0.3.0/sdd/state_machine/machine.py +157 -0
  87. sdd_plus-0.3.0/sdd/state_machine/transitions.py +101 -0
  88. sdd_plus-0.3.0/sdd/telemetry.py +193 -0
  89. sdd_plus-0.3.0/sdd/tools/__init__.py +0 -0
  90. sdd_plus-0.3.0/sdd/tools/sdd.py +114 -0
  91. sdd_plus-0.3.0/sdd/validators/__init__.py +0 -0
  92. sdd_plus-0.3.0/sdd/validators/validate_contract.py +96 -0
  93. sdd_plus-0.3.0/sdd/validators/validate_state.py +96 -0
  94. sdd_plus-0.3.0/sdd/web/__init__.py +1 -0
  95. sdd_plus-0.3.0/sdd/web/app.py +33 -0
  96. sdd_plus-0.3.0/sdd/web/routes.py +157 -0
  97. sdd_plus-0.3.0/sdd/web/templates/base.html +46 -0
  98. sdd_plus-0.3.0/sdd/web/templates/index.html +35 -0
  99. sdd_plus-0.3.0/sdd/web/templates/metrics.html +71 -0
  100. sdd_plus-0.3.0/sdd/web/templates/project.html +53 -0
  101. sdd_plus-0.3.0/sdd/workspace.py +105 -0
  102. sdd_plus-0.3.0/setup-sdd.sh +66 -0
  103. sdd_plus-0.3.0/tests/__init__.py +0 -0
  104. sdd_plus-0.3.0/tests/conftest.py +89 -0
  105. sdd_plus-0.3.0/tests/test_agent_schema.py +176 -0
  106. sdd_plus-0.3.0/tests/test_audit_command.py +575 -0
  107. sdd_plus-0.3.0/tests/test_cli.py +278 -0
  108. sdd_plus-0.3.0/tests/test_dashboard.py +280 -0
  109. sdd_plus-0.3.0/tests/test_enforcement.py +328 -0
  110. sdd_plus-0.3.0/tests/test_git_integration.py +180 -0
  111. sdd_plus-0.3.0/tests/test_hooks_cli.py +212 -0
  112. sdd_plus-0.3.0/tests/test_metrics_cli.py +271 -0
  113. sdd_plus-0.3.0/tests/test_new_phase.py +315 -0
  114. sdd_plus-0.3.0/tests/test_packaging.py +144 -0
  115. sdd_plus-0.3.0/tests/test_schemas.py +142 -0
  116. sdd_plus-0.3.0/tests/test_setup.py +141 -0
  117. sdd_plus-0.3.0/tests/test_state_machine.py +256 -0
  118. sdd_plus-0.3.0/tests/test_telemetry.py +239 -0
  119. sdd_plus-0.3.0/tests/test_transition_command.py +275 -0
  120. sdd_plus-0.3.0/tests/test_validators.py +135 -0
  121. sdd_plus-0.3.0/tests/test_workspace.py +198 -0
@@ -0,0 +1,101 @@
1
+ # Third-Party Audit Prompt
2
+
3
+ Copy this prompt into a DIFFERENT AI (Gemini, GPT-4, Codex, etc.) along with the repo files.
4
+ The auditor must NOT be the same AI that built the project.
5
+
6
+ ---
7
+
8
+ ## Prompt
9
+
10
+ You are an independent code auditor. You did NOT build this project. You have no prior context.
11
+
12
+ **Project**: SDD+ (Specification-Driven Development Extended)
13
+ **Language**: Python 3.13+
14
+ **Framework**: CLI (Typer) + FastAPI web dashboard
15
+ **Size**: ~2,075 lines of code, 261 tests, 92% coverage
16
+
17
+ ### Audit scope
18
+
19
+ Review the codebase for:
20
+
21
+ 1. **Architecture & Design**
22
+ - Is the module structure clean and well-separated?
23
+ - Are there circular dependencies?
24
+ - Is the state machine implementation correct and complete?
25
+ - Are the Pydantic schemas well-designed?
26
+
27
+ 2. **Security**
28
+ - Are there injection risks in subprocess calls?
29
+ - Is user input properly validated?
30
+ - Are file operations safe (path traversal, symlink attacks)?
31
+ - Is YAML loading safe (yaml.safe_load vs yaml.load)?
32
+ - Are there secrets or credentials accidentally committed?
33
+
34
+ 3. **Test Quality**
35
+ - Do tests actually test meaningful behavior, or are they trivial?
36
+ - Are edge cases covered?
37
+ - Is mocking appropriate, or does it hide real bugs?
38
+ - Are there tests that would pass even if the code was broken?
39
+
40
+ 4. **Spec Conformance**
41
+ - Do the CONTRACT.yaml files match what the code actually does?
42
+ - Do the SPEC.yaml files match the implementation?
43
+ - Is the AGENTS.yaml authority matrix actually enforced?
44
+
45
+ 5. **Documentation Accuracy**
46
+ - Does the README match the actual CLI commands?
47
+ - Are the install instructions correct?
48
+ - Is the architecture diagram accurate?
49
+
50
+ 6. **Packaging**
51
+ - Is pyproject.toml correctly configured?
52
+ - Will `pip install sdd-plus` work?
53
+ - Are dependencies pinned appropriately?
54
+
55
+ 7. **Code Quality**
56
+ - Dead code?
57
+ - Duplicated logic?
58
+ - Overly complex functions?
59
+ - Error handling: is fail-open (try/except pass) appropriate everywhere it's used?
60
+
61
+ ### Output format
62
+
63
+ Produce a structured audit report:
64
+
65
+ ```
66
+ ## Audit Report: SDD+ v0.2.0
67
+
68
+ ### Executive Summary
69
+ [1 paragraph: overall assessment]
70
+
71
+ ### Findings
72
+
73
+ #### CRITICAL (must fix before release)
74
+ - [Finding] — [File:Line] — [Description]
75
+
76
+ #### HIGH (should fix)
77
+ - [Finding] — [File:Line] — [Description]
78
+
79
+ #### MEDIUM (recommended)
80
+ - [Finding] — [File:Line] — [Description]
81
+
82
+ #### LOW (informational)
83
+ - [Finding] — [File:Line] — [Description]
84
+
85
+ ### Strengths
86
+ - [What's done well]
87
+
88
+ ### Verdict
89
+ [APPROVED / APPROVED WITH CONDITIONS / REJECTED]
90
+ ```
91
+
92
+ ### Files to provide
93
+
94
+ Give the auditor these files (in order of importance):
95
+ 1. `sdd/` — all Python source files
96
+ 2. `tests/` — all test files
97
+ 3. `AGENTS.yaml` — authority matrix
98
+ 4. `pyproject.toml` — packaging config
99
+ 5. `sdd/artifacts/` — specs, contracts, audits
100
+ 6. `README.md`
101
+ 7. `CHANGELOG.md`
@@ -0,0 +1,81 @@
1
+ name: CI — Tests + Security Audit
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ permissions:
10
+ contents: read
11
+ security-events: write
12
+ actions: read
13
+
14
+ jobs:
15
+ test:
16
+ name: Tests + Coverage
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ matrix:
20
+ python-version: ["3.13", "3.14"]
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+ - name: Install dependencies
27
+ run: pip install -e ".[dev]" build hatchling
28
+ - name: Run tests
29
+ run: pytest tests/ -v --cov=sdd --cov-report=term-missing --cov-fail-under=85
30
+ - name: Build wheel
31
+ run: |
32
+ pip install build
33
+ python -m build --wheel --no-isolation
34
+
35
+ security:
36
+ name: Security Scan (bandit + pip-audit)
37
+ runs-on: ubuntu-latest
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+ - uses: actions/setup-python@v5
41
+ with:
42
+ python-version: "3.13"
43
+ - name: Install tools
44
+ run: pip install bandit pip-audit -e .
45
+ - name: Bandit (security)
46
+ run: bandit -r sdd/ -f txt -ll
47
+ - name: pip-audit (CVEs)
48
+ run: pip-audit --format=columns
49
+
50
+ # CodeQL Analysis — enable when repo is public (free) or with GitHub Advanced Security (paid)
51
+ # codeql:
52
+ # name: CodeQL Analysis
53
+ # runs-on: ubuntu-latest
54
+ # steps:
55
+ # - uses: actions/checkout@v4
56
+ # - uses: github/codeql-action/init@v3
57
+ # with:
58
+ # languages: python
59
+ # - uses: github/codeql-action/analyze@v3
60
+
61
+ quality:
62
+ name: Code Quality (radon)
63
+ runs-on: ubuntu-latest
64
+ steps:
65
+ - uses: actions/checkout@v4
66
+ - uses: actions/setup-python@v5
67
+ with:
68
+ python-version: "3.13"
69
+ - name: Install radon
70
+ run: pip install radon
71
+ - name: Cyclomatic complexity (fail on E+)
72
+ run: |
73
+ radon cc sdd/ -a -nc
74
+ radon cc sdd/ -a --total-average | grep -E "^Average" | awk '{print $NF}' | tr -d '()' | while read grade; do
75
+ case "$grade" in
76
+ E|F) echo "FAIL: Average complexity is $grade"; exit 1 ;;
77
+ *) echo "OK: Average complexity is $grade" ;;
78
+ esac
79
+ done
80
+ - name: Maintainability index
81
+ run: radon mi sdd/ -s
@@ -0,0 +1,76 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+ id-token: write # required for OIDC trusted publishing
11
+
12
+ jobs:
13
+ build:
14
+ name: Build distribution
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.13"
22
+
23
+ - name: Install build tools
24
+ run: pip install build hatchling
25
+
26
+ - name: Build wheel and sdist
27
+ run: python -m build
28
+
29
+ - name: Verify dist contents
30
+ run: |
31
+ ls -lh dist/
32
+ pip install twine
33
+ twine check dist/*
34
+
35
+ - name: Upload dist artifacts
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: dist
39
+ path: dist/
40
+
41
+ publish-pypi:
42
+ name: Publish to PyPI
43
+ needs: build
44
+ runs-on: ubuntu-latest
45
+ environment:
46
+ name: pypi
47
+ url: https://pypi.org/p/sdd-plus
48
+ steps:
49
+ - name: Download dist artifacts
50
+ uses: actions/download-artifact@v4
51
+ with:
52
+ name: dist
53
+ path: dist/
54
+
55
+ - name: Publish to PyPI (Trusted Publishing)
56
+ uses: pypa/gh-action-pypi-publish@release/v1
57
+
58
+ publish-testpypi:
59
+ name: Publish to TestPyPI
60
+ needs: build
61
+ runs-on: ubuntu-latest
62
+ if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'rc')
63
+ environment:
64
+ name: testpypi
65
+ url: https://test.pypi.org/p/sdd-plus
66
+ steps:
67
+ - name: Download dist artifacts
68
+ uses: actions/download-artifact@v4
69
+ with:
70
+ name: dist
71
+ path: dist/
72
+
73
+ - name: Publish to TestPyPI (Trusted Publishing)
74
+ uses: pypa/gh-action-pypi-publish@release/v1
75
+ with:
76
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,41 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.so
5
+ .Python
6
+ build/
7
+ develop-eggs/
8
+ dist/
9
+ downloads/
10
+ eggs/
11
+ .eggs/
12
+ lib/
13
+ lib64/
14
+ parts/
15
+ sdist/
16
+ var/
17
+ wheels/
18
+ pip-wheel-metadata/
19
+ share/python-wheels/
20
+ *.egg-info/
21
+ .installed.cfg
22
+ *.egg
23
+ MANIFEST
24
+ .pytest_cache/
25
+ .coverage
26
+ htmlcov/
27
+ .env
28
+ .venv
29
+ env/
30
+ venv/
31
+ ENV/
32
+ env.bak/
33
+ venv.bak/
34
+ .idea/
35
+ .vscode/
36
+ *.swp
37
+ *.swo
38
+ *~
39
+ .DS_Store
40
+ .sdd-metrics/
41
+ .sdd-role