methodology-framework 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,29 @@
1
+ # Adopter-side caller workflow for the agent_acus populator.
2
+ #
3
+ # Copy this file into your repo at .github/workflows/populate-story-acus.yml
4
+ # and configure the DEVIN_API_TOKEN secret in your repo settings
5
+ # (Settings > Secrets and variables > Actions > New repository secret).
6
+ #
7
+ # This workflow fires after a PR that touches story files is merged,
8
+ # scans for story files with unpopulated agent_acus fields, fetches
9
+ # ACU data from the Devin API, and opens a follow-on PR to backfill.
10
+
11
+ name: Populate story agent_acus
12
+
13
+ on:
14
+ pull_request_target:
15
+ types: [closed]
16
+ paths:
17
+ - "docs/stories/**/*.md"
18
+
19
+ jobs:
20
+ populate:
21
+ if: github.event.pull_request.merged == true
22
+ uses: whiteout59/methodology-framework/.github/workflows/populate-story-acus.yml@v0.1.0
23
+ with:
24
+ story-path-pattern: "docs/stories/**/*.md"
25
+ default-branch: main
26
+ secrets:
27
+ # Set DEVIN_API_TOKEN as a repository secret:
28
+ # Settings > Secrets and variables > Actions > New repository secret
29
+ DEVIN_API_TOKEN: ${{ secrets.DEVIN_API_TOKEN }}
@@ -0,0 +1,152 @@
1
+ ---
2
+ title: <One-line title — becomes the Jira summary>
3
+ type: task
4
+ labels: [<phase1-backfill | phase2>, <area-1>, <area-2>]
5
+ requirements: [<REQ-...>, <REQ-...>]
6
+ depends_on: []
7
+ parent: null
8
+ tasks: []
9
+ estimate: <2h | 4h | 8h | 16h | 24h>
10
+ jira_key: null
11
+ ---
12
+
13
+ # <One-line title — same as frontmatter>
14
+
15
+ **Requirement(s):** <REQ-...>, <REQ-...>
16
+
17
+ ## Context
18
+
19
+ <Why this story exists, in 1–3 sentences. Cite related docs/stories by path. Don't re-explain `../../docs/alignment.md` or `../../docs/use-cases.md` — link to the relevant section.>
20
+
21
+ ## Goal
22
+
23
+ <The deliverable in one sentence. If you can't, the story is too big — split it.>
24
+
25
+ ## Acceptance criteria
26
+
27
+ - <testable, **concrete** bullet — exact paths, commands, JSON shapes, or expected outputs>
28
+ - <testable, concrete bullet 2>
29
+ - <…>
30
+
31
+ ## Files
32
+
33
+ - `path/to/file.ext` — (new | modified) — short note on the change
34
+ - `path/to/another` — (new | modified) — …
35
+
36
+ ## Validation
37
+
38
+ ```bash
39
+ # concrete commands a reviewer can run to confirm the story is done
40
+ ```
41
+
42
+ Expected: <plain-prose description of expected output>.
43
+
44
+ ## Out of scope
45
+
46
+ - <Thing that looks like this story but isn't — name it explicitly>
47
+ - <Followup or different concern>
48
+
49
+ ## Dependencies
50
+
51
+ - `<slug-of-prior-story>` — short reason
52
+ - (or "None.")
53
+
54
+ ## Execution recipe
55
+
56
+ <!-- Per-story strategy: how Devin goes from cold start to AC-satisfied state for THIS task.
57
+ Strictly additive to the 8 contract sections above. Universal rules (forbidden actions,
58
+ drift-trigger handling, required reading) live in the router playbook — NOT here.
59
+ See methodology/templates/execution-recipe.template.md for the canonical template and
60
+ a filled-in example. -->
61
+
62
+ ### Procedure
63
+
64
+ <!-- 5–15 imperative steps. Action verb first. Reference exact files / commands / strings.
65
+ For verification, reference `## Validation` rather than duplicating its commands. -->
66
+
67
+ 1. <imperative step — action verb first; reference exact files / commands / strings>
68
+ 2. <imperative step>
69
+ 3. <…>
70
+ 4. Run the commands in `## Validation` and confirm green.
71
+
72
+ ### Inputs needed from user
73
+
74
+ <!-- Anything Devin cannot obtain from the repo, the methodology docs, or the Jira ticket.
75
+ Default "None." for a well-scoped story. -->
76
+
77
+ - <input — why it's needed>
78
+ - <or "None.">
79
+
80
+ ### Story-specific advice
81
+
82
+ <!-- Optional. Omit this subsection entirely if there's nothing to add.
83
+ Gotchas / context Devin would not infer from CLAUDE.md, methodology docs,
84
+ the runbook, or the rest of the story body. -->
85
+
86
+ - <tip>
87
+
88
+ ### Story-specific forbidden actions
89
+
90
+ <!-- Optional. Omit this subsection entirely if there's nothing to add.
91
+ Constraints beyond the universal forbidden actions in the router playbook. -->
92
+
93
+ - <constraint>
94
+
95
+ ## Scoping notes (pre-execution)
96
+
97
+ <!-- Written by the agent at session start, before any implementation work.
98
+ Source of truth for the agent's pre-execution understanding. The agent
99
+ populates this section and commits it as the FIRST commit on the
100
+ implementation branch (message: `docs(stories): scope <story-slug>`).
101
+ The Jira scoping comment is a duplicate for operator convenience;
102
+ this section is the canonical in-git record. -->
103
+
104
+ ```yaml
105
+ understanding_of_goal: ""
106
+ implementation_plan: []
107
+ files_expected_to_touch: []
108
+ ac_verification_approach: []
109
+ confidence: "" # HIGH | MEDIUM | LOW
110
+ confidence_reasoning: ""
111
+ ```
112
+
113
+ ## Post-execution notes
114
+
115
+ <!-- Filled by the agent (Devin or similar) after the implementation PR merges.
116
+ Lead reviews on the implementation PR and may edit. Structured YAML for
117
+ DB ingestion alongside cross-project comparison. Use empty list `[]` for
118
+ "none" rather than deleting the field — downstream tooling expects the
119
+ keys. The free-text bullets inside `surprises` are the most important
120
+ field for compounding lessons. See docs/devin-story-format.md § "Feedback
121
+ loop and post-execution notes" for the full spec. -->
122
+
123
+ ```yaml
124
+ actual_hours: 0
125
+ estimated_hours: 0
126
+ estimate_delta_pct: 0
127
+ ac_bullets_clarified: 0
128
+ ac_clarifications: []
129
+ drift_events: []
130
+ rescoping_required: false
131
+ rescoping_reason: ""
132
+ files_touched_outside_spec: []
133
+ surprises: []
134
+ recommended_runbook_updates: []
135
+ ```
136
+
137
+ <!--
138
+ Notes for the author (delete before filing in Jira):
139
+
140
+ - `type: task` is the default. Change to `type: story` ONLY if this ticket
141
+ collects multiple child tasks via the `tasks:` list. See
142
+ `../devin-story-format.md` § "Story vs task — when to bundle."
143
+ - `estimate` cap for tasks is 24h. If your work exceeds 24h, split into
144
+ parent + leaves before drafting.
145
+ - AC must be concrete. "Works correctly" / "looks right" are rejected.
146
+ - The `## Execution recipe` section is mandatory for Phase-2 forward stories.
147
+ Phase-1 backfill stories (those carrying the `manual-gate` label) may omit
148
+ it since they're documentation tickets, not execution tickets.
149
+ - The `<!-- comments -->` are stripped on Jira paste; the YAML frontmatter
150
+ is also not pasted (it's repo-internal). Only the body below the
151
+ frontmatter goes into Jira's description.
152
+ -->
@@ -0,0 +1,264 @@
1
+ Metadata-Version: 2.4
2
+ Name: methodology-framework
3
+ Version: 0.1.0
4
+ Summary: Portable process tooling for agent-driven delivery — scripts, playbooks, templates, and specs.
5
+ Author: whiteout59
6
+ License-Expression: Apache-2.0
7
+ Requires-Python: >=3.12
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: requests<3,>=2.31
11
+ Requires-Dist: python-frontmatter<2,>=1.1
12
+ Requires-Dist: pyyaml<7,>=6.0
13
+ Provides-Extra: dev
14
+ Requires-Dist: pytest<9,>=8.0; extra == "dev"
15
+ Requires-Dist: requests-mock<2,>=1.12; extra == "dev"
16
+ Requires-Dist: ruff==0.15.14; extra == "dev"
17
+ Requires-Dist: mypy<2,>=1.10; extra == "dev"
18
+ Requires-Dist: types-requests<3,>=2.31; extra == "dev"
19
+ Requires-Dist: types-PyYAML<7,>=6.0; extra == "dev"
20
+ Dynamic: license-file
21
+
22
+ # methodology-framework
23
+
24
+ Portable process tooling for agent-driven delivery -- scripts, playbooks, templates, and specs.
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ pip install -e .
30
+ ```
31
+
32
+ ## Package contents
33
+
34
+ - `methodology_framework.sync_stories_to_jira` -- one-way repo-to-Jira story sync
35
+ - `methodology_framework.build_playbook` -- build a concrete playbook from a parameterized body + bindings
36
+ - `methodology_framework.register_playbook_with_devin` -- register a rendered playbook with Devin's API
37
+ - `methodology_framework/playbooks/` -- parameterized playbook bodies (package data)
38
+ - `methodology_framework/templates/` -- story and process templates (package data)
39
+ - `methodology_framework/specs/` -- format specs (package data)
40
+ - `methodology_framework.bootstrap_jira` -- bootstrap a Jira project with the canonical workflow, custom fields, and automation rules
41
+ - `methodology_framework/jira_shapes/` -- canonical Jira shape definitions (YAML, package data)
42
+
43
+ ## Jira Bootstrap
44
+
45
+ Adopting projects provision their Jira project shape from a single CLI command
46
+ instead of manually configuring 30+ admin UI screens.
47
+
48
+ ### Prerequisites
49
+
50
+ - Python 3.12+
51
+ - `pip install methodology-framework` (or `pip install -e .` from source)
52
+ - For `--apply` mode: `JIRA_ADMIN_TOKEN` environment variable set to a Jira
53
+ admin API token or OAuth Bearer token
54
+
55
+ ### Usage
56
+
57
+ ```bash
58
+ # Dry-run (default) — print what would be applied, no side-effects
59
+ python -m methodology_framework bootstrap-jira \
60
+ --project-key=MYPROJ \
61
+ --jira-host=myorg.atlassian.net \
62
+ --dry-run
63
+
64
+ # Export — emit an importable config bundle (YAML); no API calls
65
+ python -m methodology_framework bootstrap-jira \
66
+ --project-key=MYPROJ \
67
+ --jira-host=myorg.atlassian.net \
68
+ --export /tmp/jira-bundle.yaml
69
+
70
+ # Apply — provision the Jira project via admin API
71
+ export JIRA_ADMIN_TOKEN="<your-token>"
72
+ python -m methodology_framework bootstrap-jira \
73
+ --project-key=MYPROJ \
74
+ --jira-host=myorg.atlassian.net \
75
+ --apply
76
+
77
+ # Apply with --force to skip confirmation prompts
78
+ python -m methodology_framework bootstrap-jira \
79
+ --project-key=MYPROJ \
80
+ --jira-host=myorg.atlassian.net \
81
+ --apply --force
82
+ ```
83
+
84
+ ### Flags
85
+
86
+ | Flag | Required | Description |
87
+ |------|----------|-------------|
88
+ | `--project-key` | Yes | Jira project key (e.g. `SCRUM`). Substituted for `{{PROJECT_KEY}}` in shape defs. |
89
+ | `--jira-host` | Yes | Jira Cloud host (e.g. `myorg.atlassian.net`). No `https://` prefix. |
90
+ | `--dry-run` | No | Print what would be applied (default if no mode specified). |
91
+ | `--apply` | No | POST/PUT to Jira admin API. Requires `JIRA_ADMIN_TOKEN` env var. |
92
+ | `--export <path>` | No | Emit importable config bundle at `<path>`. |
93
+ | `--force` | No | Skip confirmation prompts during `--apply`. |
94
+
95
+ ### Environment variables
96
+
97
+ | Variable | When needed | Description |
98
+ |----------|-------------|-------------|
99
+ | `JIRA_ADMIN_TOKEN` | `--apply` mode | Jira admin API token. **Never** accepted as a CLI flag. |
100
+
101
+ ### Shape definitions
102
+
103
+ The three canonical shape files shipped as package data:
104
+
105
+ - `jira_shapes/workflow.yaml` — workflow statuses (To Do, Ready for AI agent,
106
+ In Progress, In Review, Waiting, Blocked, Done, Won't do) and transitions
107
+ with actor permissions
108
+ - `jira_shapes/custom_fields.yaml` — Story File (URL), Requirement IDs
109
+ (labels), Agent Estimate (number)
110
+ - `jira_shapes/automation_rules.yaml` — PR-title-key auto-transition,
111
+ dependency resolution, BLOCKED protection
112
+
113
+ For full methodology context see the methodology requirements doc § 4.13.3
114
+ ("Jira Bootstrap CLI").
115
+
116
+ ## Adopter Integration
117
+
118
+ Adopting projects consume the methodology framework's CI pipelines via
119
+ **reusable GitHub Actions workflows**. Instead of copying workflow YAML
120
+ into each repo, adopters write a thin caller that references the
121
+ framework's workflows by SemVer tag.
122
+
123
+ > **Version pinning requirement:** adopters MUST pin to a specific tag
124
+ > (`@v0.X.Y`), never `@main`. The framework version must be explicit
125
+ > in the caller so updates are deliberate, not silent. This matches the
126
+ > version-pinning model per methodology requirements § 4.13.
127
+
128
+ ### Story sync workflow
129
+
130
+ Syncs story `.md` files from the adopter's repo to Jira. Create
131
+ `.github/workflows/sync.yml` in the adopter repo:
132
+
133
+ ```yaml
134
+ name: Sync stories to Jira
135
+
136
+ on:
137
+ push:
138
+ branches: [main]
139
+ paths:
140
+ - "docs/stories/**/*.md"
141
+ workflow_dispatch:
142
+ inputs:
143
+ mode:
144
+ description: "Sync mode"
145
+ required: true
146
+ default: "since-ref"
147
+ type: choice
148
+ options:
149
+ - since-ref
150
+ - all
151
+
152
+ jobs:
153
+ sync:
154
+ uses: whiteout59/methodology-framework/.github/workflows/sync.yml@v0.1.0
155
+ with:
156
+ project_key: SCRUM
157
+ repo: whiteout59/centralized-pipeline-ui
158
+ story_path_pattern: "docs/stories/{phase1,phase2}/**/*.md"
159
+ cf_story_file: "customfield_10073"
160
+ cf_requirement_ids: "customfield_10141"
161
+ cf_agent_estimate: "customfield_10074"
162
+ mode: ${{ github.event.inputs.mode || 'since-ref' }}
163
+ jira_base_url: "https://myorg.atlassian.net"
164
+ jira_user_email: "devin-sync@myorg.atlassian.net"
165
+ secrets:
166
+ JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
167
+ ```
168
+
169
+ The `mode` input defaults to `since-ref` for routine push-triggered
170
+ runs (preserves the 250-story scale guard). Pass `mode: all` explicitly
171
+ for nightly or `workflow_dispatch` full-corpus syncs.
172
+
173
+ > **Secrets forwarding:** the caller's `secrets:` block must explicitly
174
+ > map each secret the reusable workflow declares. Secrets are NOT
175
+ > inherited by default in reusable workflows. Using `secrets: inherit`
176
+ > works but is brittle — prefer explicit mapping.
177
+
178
+ ### Playbook build + register workflow
179
+
180
+ Builds a concrete playbook from a parameterized body + bindings file,
181
+ then registers it with Devin's API. Create
182
+ `.github/workflows/build-and-register.yml` in the adopter repo:
183
+
184
+ ```yaml
185
+ name: Build and register playbook
186
+
187
+ on:
188
+ push:
189
+ branches: [main]
190
+ paths:
191
+ - "methodology/playbooks/*.body.md"
192
+ - "docs/jira-pickup-config.md"
193
+ workflow_dispatch:
194
+
195
+ jobs:
196
+ build-and-register:
197
+ uses: whiteout59/methodology-framework/.github/workflows/build-and-register.yml@v0.1.0
198
+ with:
199
+ playbook_body_path: "methodology/playbooks/scrum-router.body.md"
200
+ bindings_path: "docs/jira-pickup-config.md"
201
+ secrets:
202
+ DEVIN_API_TOKEN: ${{ secrets.DEVIN_API_TOKEN }}
203
+ ```
204
+
205
+ > **Nesting limit:** GitHub allows reusable workflow nesting up to
206
+ > 4 levels deep. If your repo wraps these workflows in another
207
+ > caller layer, verify the total nesting depth stays within limits.
208
+
209
+ ## PyPI Publishing
210
+
211
+ The package is published to PyPI automatically via OIDC Trusted Publishers
212
+ when a SemVer tag is pushed:
213
+
214
+ ```bash
215
+ git tag v0.1.0
216
+ git push origin v0.1.0
217
+ ```
218
+
219
+ The `pypi-release.yml` workflow builds and publishes using
220
+ `pypa/gh-action-pypi-publish` in OIDC mode -- no `PYPI_API_TOKEN` secret
221
+ is needed. The job uses the `pypi` GitHub environment for protection rules.
222
+
223
+ **Operator setup (one-time):** bind the PyPI project `methodology-framework`
224
+ to the GitHub repo `whiteout59/methodology-framework`, workflow
225
+ `pypi-release.yml`, environment `pypi` at
226
+ [PyPI Trusted Publishers](https://pypi.org/manage/account/publishing/).
227
+
228
+ ## Cost tracking via `agent_acus`
229
+
230
+ The methodology's post-execution notes include an `agent_acus` field that
231
+ records per-story compute cost. Since agents cannot self-report ACU
232
+ consumption mid-session, a post-merge populator workflow backfills the
233
+ value from the Devin API after the session completes.
234
+
235
+ **Adopter wiring (3 steps):**
236
+
237
+ 1. Copy the template caller into your repo:
238
+ ```bash
239
+ cp "$(python -c "import methodology_framework; import pathlib; \
240
+ print(pathlib.Path(methodology_framework.__file__).parent / \
241
+ 'templates/github_workflows/populate-story-acus-caller.yml')")" \
242
+ .github/workflows/populate-story-acus.yml
243
+ ```
244
+ 2. Set the `DEVIN_API_TOKEN` repo secret (Settings > Secrets and
245
+ variables > Actions > New repository secret).
246
+ 3. Pin the framework version in the caller's `uses:` line.
247
+
248
+ The caller fires on merged PRs that touch story files, invokes the
249
+ reusable `populate-story-acus.yml` workflow, and opens a follow-on PR
250
+ with the populated ACU values.
251
+
252
+ ## Development
253
+
254
+ ```bash
255
+ pip install -e ".[dev]"
256
+ pytest tests/ -v
257
+ ruff check src/methodology_framework
258
+ ruff format --check src/methodology_framework
259
+ mypy --strict src/methodology_framework
260
+ ```
261
+
262
+ ## License
263
+
264
+ Apache-2.0
@@ -0,0 +1,20 @@
1
+ methodology_framework/__init__.py,sha256=ESIHybKFnmmZbuf2xuQLs7Vrwcd2VmODwh6EoWPN8eY,369
2
+ methodology_framework/__main__.py,sha256=kXfpMr2bQZLAQUgfAVQXL95Wgu11Ma357PzKs_4QTGI,808
3
+ methodology_framework/bootstrap_jira.py,sha256=ebPWkG4XpB-C5CI0wcNox_QRtb0hM2vORBAEgdKsXms,15963
4
+ methodology_framework/build_playbook.py,sha256=S2y-HCpQF2XntNWe2HnsZFXeGyKEdp4YhMTybkveE-8,5622
5
+ methodology_framework/populate_acus.py,sha256=ROgH5EFHkI10J9OI6ONraTbcRSGmYJlYd5dbti7NoEk,6674
6
+ methodology_framework/register_playbook_with_devin.py,sha256=4W5ImbYVW90CMZX3eMsmKabPwQJhlRHzszygcOLlno0,10225
7
+ methodology_framework/sync_stories_to_jira.py,sha256=j4QTj_h6J5wZqhq34dbQRrhusc5epOtxWgLjtRmY91A,38827
8
+ methodology_framework/jira_shapes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ methodology_framework/jira_shapes/automation_rules.yaml,sha256=Mid3XM-dmk94uL9Euj1bxTjxpEzH2i0r6k451ZfTKYM,3393
10
+ methodology_framework/jira_shapes/custom_fields.yaml,sha256=Hs_sAQhTmY0eAsWLmGgH8J_kV_plhXl6rKbHdawrvXQ,1506
11
+ methodology_framework/jira_shapes/workflow.yaml,sha256=RykoRww1bvG0RF1IVPm_TQ8OkbzVw3GGywm0vBJmVOE,4357
12
+ methodology_framework/playbooks/scrum-router.body.md,sha256=aYjf-ECejMYFR678WxAlfSliiJobcLxnXW66yr3n1-s,28274
13
+ methodology_framework/specs/devin-story-format.md,sha256=UETitaH4Gyk5vAhZc72hB4SFrTLXQOUiIdJQZ_bgThA,43600
14
+ methodology_framework/templates/story.md,sha256=OSlKoO312WgrCpnwpOxI6h6jZ5suacnfX015a_fi0O0,5047
15
+ methodology_framework/templates/github_workflows/populate-story-acus-caller.yml,sha256=MXPPcsoEUWD9-dhww5b9COedimmIU1cfH1fwKHraN0k,1048
16
+ methodology_framework-0.1.0.dist-info/licenses/LICENSE,sha256=gBrcDYRbLYLNFdvs81q_IFs2bT8Rli41A_eKqiNT5ew,1067
17
+ methodology_framework-0.1.0.dist-info/METADATA,sha256=oouBG0-azmm7PN3KwVD17oaq55Y6hQ_yTWr0gybaonU,9123
18
+ methodology_framework-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
19
+ methodology_framework-0.1.0.dist-info/top_level.txt,sha256=Azz1pUEpyIM2qQXNdAfoMGs-E0IhOUWmVoazLTnPxuU,22
20
+ methodology_framework-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 whiteout59
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ methodology_framework