chore: update scripts, docs, .github instructions for drift-engine phase 3 (ADR-100)#712
Open
mick-gsk wants to merge 1 commit into
Open
chore: update scripts, docs, .github instructions for drift-engine phase 3 (ADR-100)#712mick-gsk wants to merge 1 commit into
mick-gsk wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR advances ADR-100 “Phase 3” monorepo/workspace migration support by adding helper scripts and prompt/docs updates that improve agent workflow onboarding, artifact discoverability, and gate/status visibility.
Changes:
- Add scripts to generate
work_artifacts/index.json, patch test monkeypatch strings, and generatedrift→drift_enginere-export stubs. - Persist
gate-checkresults towork_artifacts/last_gate_status.jsonand add new Makefile targets (task-card,repro-bundle,update-artifacts-index). - Introduce ADR-100 documentation and expand harness/context-engineering prompts & guidance.
Reviewed changes
Copilot reviewed 27 out of 29 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/update_work_artifacts_index.py | New script to generate a machine-readable work_artifacts/ index |
| scripts/quality_loop/demo_corpus/sample_validators.py | Import ordering/formatting updates in demo corpus |
| scripts/quality_loop/demo_corpus/sample_data_utils.py | Import ordering/formatting updates in demo corpus |
| scripts/patch_test_monkeypatches.py | New bulk patcher for drift.* monkeypatch strings to drift_engine.* |
| scripts/mcp_product_health_server.py | Import ordering tweak inside optional dependency block |
| scripts/generate_engine_stubs.py | New generator for src/drift/* re-export stubs pointing at drift_engine |
| scripts/gate_check.py | Persist last gate-check result to work_artifacts/last_gate_status.json |
| scripts/ecosystem_check.py | Remove stray blank line |
| scripts/check_model_consistency.py | Update schema path to new drift-config package layout |
| scripts/ablation_mds_threshold.py | Import ordering tweak |
| pyproject.toml | Add uv workspace config + add drift-* deps + change version |
| docs/decisions/ADR-100-uv-workspace-monorepo-capability-split.md | New ADR-100 document describing workspace/monorepo capability split |
| docs/decisions/ADR-099-vertical-slice-architecture-convention.md | Update ADR-099 status to accepted |
| docs/agent-harness-golden-principles.md | Major expansion of harness engineering guidance |
| Makefile | Add new agent targets and run artifacts index update after handover |
| DEVELOPER.md | Document new make task-card target |
| CHANGELOG.md | Update release notes/version header content |
| AGENTS.md | Add guidance to start tasks with make task-card |
| .vscode/drift-session.json | Update local drift-session output snapshot |
| .learnings/ai-engineer-workshop-2026.md | Minor formatting change |
| .github/prompts/drift-harness-followup.prompt.md | New prompt for harness follow-up runs |
| .github/prompts/drift-harness-engine.prompt.md | Add routing to context-engineering prompt |
| .github/prompts/drift-context-engineering.prompt.md | New context-engineering audit prompt |
| .github/prompts/drift-context-engineering-followup.prompt.md | New context-engineering follow-up prompt |
| .github/prompts/_partials/context-engineering-contract.md | New shared contract partial for context-engineering prompts |
| .github/prompts/README.md | Register new prompts and shared partial |
| .github/instructions/drift-context-routing.instructions.md | Add explicit context compression requirement reference |
| .github/copilot-instructions.md | Add new mandatory “context compression” section |
| [project] | ||
| name = "drift-analyzer" | ||
| version = "2.50.0" | ||
| version = "2.49.0" |
Comment on lines
65
to
+76
| "pydantic>=2.0", | ||
| "gitpython>=3.1", | ||
| "networkx>=3.0", | ||
| "drift-config", | ||
| "drift-sdk", | ||
| "drift-engine", | ||
| ] | ||
|
|
||
| [tool.uv.sources] | ||
| drift-config = { workspace = true } | ||
| drift-sdk = { workspace = true } | ||
| drift-engine = { workspace = true } |
| @@ -1,25 +1,28 @@ | |||
| ## [2.50.0] - 2026-05-03 | |||
| ## [2.49.0] - 2026-05-01 | |||
| - monorepo phase 0+1: uv workspace root + drift-config capability package (ADR-100) | ||
| - monorepo phase 3: drift-engine capability package (signals/scoring/ingestion/pipeline/analyzer, ADR-100) | ||
|
|
||
| ## [2.49.0] - 2026-04-30 |
| TESTS := tests/ | ||
|
|
||
| .PHONY: help install lint lint-fix typecheck test test-fast test-dev test-lf test-contract smoke-pr smoke-nightly test-all coverage check self ci feat-start fix-start catalog gate-check feat-bundle handover changelog-entry changelog-insert audit-diff agent-harness-check markdown-lint package-kpis-github-usage package-kpis-downloads package-kpis-real-public package-kpis-example quality-score clean guard-refresh test-for replay-benchmark repair-eval ab-harness kpi-update kpi-report eval-all | ||
| .PHONY: help install lint lint-fix typecheck test test-fast test-dev test-lf test-contract smoke-pr smoke-nightly test-all coverage check self ci feat-start fix-start catalog gate-check task-card feat-bundle handover changelog-entry changelog-insert audit-diff agent-harness-check repro-bundle markdown-lint package-kpis-github-usage package-kpis-downloads package-kpis-real-public package-kpis-example quality-score clean guard-refresh test-for replay-benchmark repair-eval ab-harness kpi-update kpi-report eval-all |
Comment on lines
+68
to
+70
| dst = src_dir / py_file.name | ||
| if dst.exists(): | ||
| dst.write_text(stub, encoding="utf-8") |
Comment on lines
+9
to
+40
| # Pattern 1: single-line patch("drift.X. ... or setattr("drift.X. ... | ||
| pattern1_str = r'(patch|setattr)\("drift\.(' + "|".join(engine_mods) + r")\." | ||
| pattern1 = re.compile(pattern1_str) | ||
|
|
||
| # Pattern 2: multi-line setattr(\n "drift.X. ... | ||
| pattern2_str = r'(patch|setattr)\(\n(\s*)"drift\.(' + "|".join(engine_mods) + r")\." | ||
| pattern2 = re.compile(pattern2_str) | ||
|
|
||
|
|
||
| def replacement1(m: re.Match) -> str: | ||
| return f'{m.group(1)}("drift_engine.{m.group(2)}.' | ||
|
|
||
|
|
||
| def replacement2(m: re.Match) -> str: | ||
| return f'{m.group(1)}(\n{m.group(2)}"drift_engine.{m.group(3)}.' | ||
|
|
||
|
|
||
| total_files = 0 | ||
| total_replacements = 0 | ||
|
|
||
| for f in sorted(tests_dir.rglob("*.py")): | ||
| content = f.read_text(encoding="utf-8") | ||
| new_content = pattern2.sub(replacement2, content) | ||
| new_content = pattern1.sub(replacement1, new_content) | ||
| if new_content != content: | ||
| count = len(pattern1.findall(content)) + len(pattern2.findall(content)) | ||
| f.write_text(new_content, encoding="utf-8") | ||
| total_files += 1 | ||
| total_replacements += count | ||
| print(f" {f.name}: {count} replacements") | ||
|
|
||
| print(f"\nTotal: {total_replacements} replacements in {total_files} files") |
Comment on lines
+9
to
+40
| # Pattern 1: single-line patch("drift.X. ... or setattr("drift.X. ... | ||
| pattern1_str = r'(patch|setattr)\("drift\.(' + "|".join(engine_mods) + r")\." | ||
| pattern1 = re.compile(pattern1_str) | ||
|
|
||
| # Pattern 2: multi-line setattr(\n "drift.X. ... | ||
| pattern2_str = r'(patch|setattr)\(\n(\s*)"drift\.(' + "|".join(engine_mods) + r")\." | ||
| pattern2 = re.compile(pattern2_str) | ||
|
|
||
|
|
||
| def replacement1(m: re.Match) -> str: | ||
| return f'{m.group(1)}("drift_engine.{m.group(2)}.' | ||
|
|
||
|
|
||
| def replacement2(m: re.Match) -> str: | ||
| return f'{m.group(1)}(\n{m.group(2)}"drift_engine.{m.group(3)}.' | ||
|
|
||
|
|
||
| total_files = 0 | ||
| total_replacements = 0 | ||
|
|
||
| for f in sorted(tests_dir.rglob("*.py")): | ||
| content = f.read_text(encoding="utf-8") | ||
| new_content = pattern2.sub(replacement2, content) | ||
| new_content = pattern1.sub(replacement1, new_content) | ||
| if new_content != content: | ||
| count = len(pattern1.findall(content)) + len(pattern2.findall(content)) | ||
| f.write_text(new_content, encoding="utf-8") | ||
| total_files += 1 | ||
| total_replacements += count | ||
| print(f" {f.name}: {count} replacements") | ||
|
|
||
| print(f"\nTotal: {total_replacements} replacements in {total_files} files") |
| """Parse SignalWeights defaults from src/drift/config/_schema.py using AST.""" | ||
| config_path = _repo_root() / "src" / "drift" / "config" / "_schema.py" | ||
| # ADR-100 Phase 3: SignalWeights lives in drift-config package, not stub | ||
| config_path = _repo_root() / "packages" / "drift-config" / "src" / "drift_config" / "_schema.py" |
Comment on lines
3
to
+5
| "repo_path": "C:/Users/mickg/PWBS/drift", | ||
| "analyzed_at": "2026-04-30T18:51:46Z", | ||
| "drift_score": 0.377, | ||
| "grade": "B", | ||
| "grade_label": "Low Drift", | ||
| "analyzed_at": "2026-05-01T10:00:24Z", | ||
| "drift_score": 0.477, |
|
|
||
| import os | ||
| import sys # unused (F401) | ||
| import hashlib # unused (F401) |
| import re # unused (F401) | ||
| import hashlib # unused (F401) | ||
| import logging # unused (F401) | ||
| import logging # unused (F401) |
| import logging # unused (F401) | ||
| import logging # unused (F401) | ||
| import os | ||
| import re # unused (F401) |
| import logging # unused (F401) | ||
| import os | ||
| import re # unused (F401) | ||
| import sys # unused (F401) |
| import re | ||
| import math # unused (F401) | ||
| import decimal # unused (F401) | ||
| import decimal # unused (F401) |
| import decimal # unused (F401) | ||
| import decimal # unused (F401) | ||
| import fractions # unused (F401) | ||
| import math # unused (F401) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split from #576 (ADR-100 monorepo migration). Part of the PR decomposition into atomic, reviewable units.