specsmith 0.1.4.dev34__tar.gz → 0.1.4.dev35__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 (85) hide show
  1. {specsmith-0.1.4.dev34/src/specsmith.egg-info → specsmith-0.1.4.dev35}/PKG-INFO +1 -1
  2. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/pyproject.toml +1 -1
  3. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/importer.py +9 -0
  4. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/integrations/claude_code.py +6 -0
  5. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/integrations/warp.py +9 -0
  6. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/scaffolder.py +6 -0
  7. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/session.py +23 -0
  8. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/gitignore.j2 +3 -0
  9. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/governance/context-budget.md.j2 +11 -0
  10. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35/src/specsmith.egg-info}/PKG-INFO +1 -1
  11. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/LICENSE +0 -0
  12. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/README.md +0 -0
  13. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/setup.cfg +0 -0
  14. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/__init__.py +0 -0
  15. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/__main__.py +0 -0
  16. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/architect.py +0 -0
  17. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/auditor.py +0 -0
  18. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/cli.py +0 -0
  19. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/commands/__init__.py +0 -0
  20. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/compressor.py +0 -0
  21. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/config.py +0 -0
  22. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/credit_analyzer.py +0 -0
  23. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/credits.py +0 -0
  24. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/differ.py +0 -0
  25. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/doctor.py +0 -0
  26. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/exporter.py +0 -0
  27. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/integrations/__init__.py +0 -0
  28. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/integrations/aider.py +0 -0
  29. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/integrations/base.py +0 -0
  30. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/integrations/copilot.py +0 -0
  31. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/integrations/cursor.py +0 -0
  32. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/integrations/gemini.py +0 -0
  33. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/integrations/windsurf.py +0 -0
  34. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/ledger.py +0 -0
  35. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/plugins.py +0 -0
  36. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/releaser.py +0 -0
  37. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/requirements.py +0 -0
  38. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/agents.md.j2 +0 -0
  39. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/docs/architecture.md.j2 +0 -0
  40. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/docs/requirements.md.j2 +0 -0
  41. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/docs/test-spec.md.j2 +0 -0
  42. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/docs/workflow.md.j2 +0 -0
  43. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/editorconfig.j2 +0 -0
  44. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/gitattributes.j2 +0 -0
  45. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/governance/drift-metrics.md.j2 +0 -0
  46. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/governance/roles.md.j2 +0 -0
  47. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/governance/rules.md.j2 +0 -0
  48. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/governance/verification.md.j2 +0 -0
  49. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/governance/workflow.md.j2 +0 -0
  50. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/ledger.md.j2 +0 -0
  51. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/pyproject.toml.j2 +0 -0
  52. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/python/cli.py.j2 +0 -0
  53. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/python/init.py.j2 +0 -0
  54. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/readme.md.j2 +0 -0
  55. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/scripts/exec.cmd.j2 +0 -0
  56. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/scripts/exec.sh.j2 +0 -0
  57. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/scripts/run.cmd.j2 +0 -0
  58. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/scripts/run.sh.j2 +0 -0
  59. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/scripts/setup.cmd.j2 +0 -0
  60. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/templates/scripts/setup.sh.j2 +0 -0
  61. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/tools.py +0 -0
  62. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/updater.py +0 -0
  63. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/upgrader.py +0 -0
  64. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/validator.py +0 -0
  65. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/vcs/__init__.py +0 -0
  66. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/vcs/base.py +0 -0
  67. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/vcs/bitbucket.py +0 -0
  68. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/vcs/github.py +0 -0
  69. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/vcs/gitlab.py +0 -0
  70. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith/vcs_commands.py +0 -0
  71. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith.egg-info/SOURCES.txt +0 -0
  72. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith.egg-info/dependency_links.txt +0 -0
  73. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith.egg-info/entry_points.txt +0 -0
  74. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith.egg-info/requires.txt +0 -0
  75. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/src/specsmith.egg-info/top_level.txt +0 -0
  76. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/tests/test_auditor.py +0 -0
  77. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/tests/test_cli.py +0 -0
  78. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/tests/test_compressor.py +0 -0
  79. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/tests/test_importer.py +0 -0
  80. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/tests/test_integrations.py +0 -0
  81. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/tests/test_scaffolder.py +0 -0
  82. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/tests/test_smoke.py +0 -0
  83. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/tests/test_tools.py +0 -0
  84. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/tests/test_validator.py +0 -0
  85. {specsmith-0.1.4.dev34 → specsmith-0.1.4.dev35}/tests/test_vcs.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: specsmith
3
- Version: 0.1.4.dev34
3
+ Version: 0.1.4.dev35
4
4
  Summary: Forge governed project scaffolds from the Agentic AI Development Workflow Specification.
5
5
  Author: BitConcepts
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "specsmith"
7
- version = "0.1.4.dev34"
7
+ version = "0.1.4.dev35"
8
8
  description = "Forge governed project scaffolds from the Agentic AI Development Workflow Specification."
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -168,6 +168,7 @@ def detect_project(root: Path) -> DetectionResult:
168
168
  ".ruff_cache",
169
169
  ".mypy_cache",
170
170
  ".work",
171
+ ".specsmith",
171
172
  "build",
172
173
  "dist",
173
174
  "target",
@@ -1117,6 +1118,14 @@ def generate_overlay(
1117
1118
  agents_path.write_text(hub, encoding="utf-8")
1118
1119
  created.append(agents_path)
1119
1120
 
1121
+ # Initialize credit tracking with unlimited budget
1122
+ specsmith_dir = target / ".specsmith"
1123
+ if not specsmith_dir.exists():
1124
+ from specsmith.credits import CreditBudget, save_budget
1125
+
1126
+ save_budget(target, CreditBudget()) # unlimited by default
1127
+ created.append(target / ".specsmith" / "credit-budget.json")
1128
+
1120
1129
  # --- CI config (merge: only create if no CI detected) ---
1121
1130
  if not result.existing_ci and result.vcs_platform:
1122
1131
  try:
@@ -78,4 +78,10 @@ When user says `sync`: run `specsmith sync --project-dir .`
78
78
  When user says `pr`: run `specsmith pr --project-dir .`
79
79
  When user says `audit`: run `specsmith audit --project-dir .`
80
80
  When user says `session-end`: run `specsmith session-end --project-dir .`
81
+
82
+ ## Credit Tracking
83
+ At session end, record token usage:
84
+ `specsmith credits record --model <model> --provider anthropic \
85
+ --tokens-in <N> --tokens-out <N> --task "<desc>"`
86
+ Check budget: `specsmith credits summary`
81
87
  """
@@ -84,10 +84,19 @@ When user says `session-end`: run `specsmith session-end --project-dir .`
84
84
  ## Verification
85
85
  Before marking any task complete, run: {verify_line}
86
86
 
87
+ ## Credit Tracking
88
+ After completing tasks, record token usage:
89
+ ```
90
+ specsmith credits record --model <model> --provider <provider> \
91
+ --tokens-in <N> --tokens-out <N> --task "<desc>"
92
+ ```
93
+ Check budget: `specsmith credits summary`
94
+
87
95
  ## Rules
88
96
  - Proposals before changes (no exceptions)
89
97
  - Verify before recording completion
90
98
  - Use execution shims (`scripts/exec.cmd` / `scripts/exec.sh`) for external commands
91
99
  - Keep AGENTS.md under 200 lines
92
100
  - Record every session in the ledger
101
+ - Record credit usage at session end
93
102
  """
@@ -80,6 +80,12 @@ def scaffold_project(config: ProjectConfig, target: Path) -> list[Path]:
80
80
  except ValueError:
81
81
  pass # Unknown platform — skip silently
82
82
 
83
+ # Initialize credit tracking with unlimited budget
84
+ from specsmith.credits import CreditBudget, save_budget
85
+
86
+ save_budget(target, CreditBudget()) # unlimited by default
87
+ created.append(target / ".specsmith" / "credit-budget.json")
88
+
83
89
  # Git init
84
90
  if config.git_init:
85
91
  subprocess.run( # noqa: S603
@@ -127,4 +127,27 @@ def run_session_end(root: Path) -> SessionReport:
127
127
  SessionCheck(name="audit", status="warn", message="Could not run audit")
128
128
  )
129
129
 
130
+ # Credit spend summary for this session
131
+ try:
132
+ from specsmith.credits import get_summary
133
+
134
+ cs = get_summary(root)
135
+ if cs.entry_count > 0:
136
+ report.checks.append(
137
+ SessionCheck(
138
+ name="credits",
139
+ status="ok",
140
+ message=(
141
+ f"Credits: ${cs.total_cost_usd:.4f} total, "
142
+ f"{cs.session_count} session(s)"
143
+ ),
144
+ )
145
+ )
146
+ for alert in cs.alerts:
147
+ report.checks.append(
148
+ SessionCheck(name="credit-alert", status="warn", message=alert)
149
+ )
150
+ except Exception: # noqa: BLE001
151
+ pass # Credits not configured — skip silently
152
+
130
153
  return report
@@ -36,6 +36,9 @@ htmlcov/
36
36
  # Build artifacts
37
37
  .work/
38
38
  *.log
39
+
40
+ # specsmith local data (credits, config)
41
+ .specsmith/
39
42
  {% if project.type.value in ('cli-rust', 'library-rust') %}
40
43
 
41
44
  # Rust
@@ -48,3 +48,14 @@ If a cheaper check fails, fix that before running more expensive checks.
48
48
  - **low** — docs-only, single-file edits, small scaffolds
49
49
  - **medium** — multi-file implementation, routine refactors, standard test runs
50
50
  - **high** — architecture changes, large builds, broad audits
51
+
52
+ ## Credit tracking
53
+
54
+ This project tracks AI credit spend automatically. At the end of each session:
55
+
56
+ 1. Record usage: `specsmith credits record --model <model> --provider <provider> --tokens-in <N> --tokens-out <N> --task "<description>"`
57
+ 2. Check budget: `specsmith credits summary`
58
+ 3. If budget alerts appear, review with: `specsmith credits analyze`
59
+
60
+ Budget configuration: `specsmith credits budget --cap <USD> --alert-pct 80`
61
+ Credit data stored in `.specsmith/credits.json` (gitignored).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: specsmith
3
- Version: 0.1.4.dev34
3
+ Version: 0.1.4.dev35
4
4
  Summary: Forge governed project scaffolds from the Agentic AI Development Workflow Specification.
5
5
  Author: BitConcepts
6
6
  License: MIT
File without changes