Commit 12743f5
cowork-bot: automated improvements (cowork/improve-configdrift) (#43)
* cowork-bot: fix severity inference to use substring match instead of startswith
Critical keys with embedded sensitive terms (db_password, jwt_token,
app_secret_key, mysql_auth_url, oauth_token, connection_endpoint,
main_api_key_id) were incorrectly classified as WARNING or INFO instead
of BREAKING.
Root cause: _infer_severity_{added,removed,changed}() used
key.lower().startswith(p) which only catches keys that *begin* with
a critical prefix. Real-world config keys overwhelmingly embed the
sensitive term (e.g. 'db_password', not 'password_db'), so the heuristic
almost always missed them.
Fix: change to substring check -- p in key.lower() -- so the severity
gate fires correctly for any key containing a critical term.
Non-sensitive keys (cache_ttl, log_level, port, retry_count) are
unaffected since none of the critical terms appear as substrings.
Regression tests: 11 new cases in TestSeveritySubstringMatch, including
an end-to-end diff_configs assertion that has_breaking fires.
114/114 tests pass; ruff clean.
* cowork-bot: seed cowork-auto-pr.yml workflow for automated PR creation
* cowork-bot: fix severity inference with word-boundary matching for critical terms
Supersedes substring match (p in key.lower()) which:
- Fixed nested keys like services.database.password (TRUE positive)
- But over-flagged false positives: author->auth, secretary->secret, tokenizer->token
New algorithm splits flattened keys into words (dot/snake/kebab/camel) and
matches critical terms as contiguous word sequences. Also handles concatenated
forms for multi-word terms (apikey -> api_key).
+30 tests for word-boundary behavior: nested TRUE-positives,
concatenated TRUE-positives, and 10 false-positive regressions.
All 141 tests pass; ruff clean.
* fix(marketing): correct install to self-hosted --index-url (package not on public PyPI); remove false PyPI badge
* fix: replace dead --index-url install with verified-working git+ (2 occurrences)
* fix(scan): use Path.name instead of Path.stem to preserve dots in env names
Closes #37. Path.stem strips the final dotted segment of directory names,
causing silent collisions for dirs like "prod.v2" and "prod". Path.name
preserves the full basename.
* fix(ci): gracefully handle gh pr create permission failure in cowork-auto-pr workflow
The default GITHUB_TOKEN may lack pull-requests:write in some org
configurations, causing the ensure-pr step to fail with exit code 1.
Add || echo fallback so the job stays green; the PR can be opened
externally by the orchestrator agent.
* fix: restore graceful fallback in cowork-auto-pr.yml (was lost in merge resolution)
---------
Co-authored-by: cowork-bot <cowork-bot@revenueholdings.dev>
Co-authored-by: DevForge Engineer <engineer@devforge.dev>1 parent c76ed98 commit 12743f5
3 files changed
Lines changed: 40 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
25 | | - | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
408 | 442 | | |
409 | 443 | | |
410 | 444 | | |
| |||
0 commit comments