Skip to content

chore: update scripts, docs, .github instructions for drift-engine phase 3 (ADR-100)#712

Open
mick-gsk wants to merge 1 commit into
mainfrom
split/576-664e-scripts-docs-phase3
Open

chore: update scripts, docs, .github instructions for drift-engine phase 3 (ADR-100)#712
mick-gsk wants to merge 1 commit into
mainfrom
split/576-664e-scripts-docs-phase3

Conversation

@mick-gsk
Copy link
Copy Markdown
Owner

@mick-gsk mick-gsk commented May 3, 2026

Split from #576 (ADR-100 monorepo migration). Part of the PR decomposition into atomic, reviewable units.

Copilot AI review requested due to automatic review settings May 3, 2026 17:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 generate driftdrift_engine re-export stubs.
  • Persist gate-check results to work_artifacts/last_gate_status.json and 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

Comment thread pyproject.toml
[project]
name = "drift-analyzer"
version = "2.50.0"
version = "2.49.0"
Comment thread pyproject.toml
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 }
Comment thread CHANGELOG.md
@@ -1,25 +1,28 @@
## [2.50.0] - 2026-05-03
## [2.49.0] - 2026-05-01
Comment thread CHANGELOG.md
- 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
Comment thread Makefile
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)
@github-actions github-actions Bot added documentation Improvements or additions to documentation ci Changes to CI/CD workflows or tooling labels May 3, 2026
@mick-gsk mick-gsk closed this May 4, 2026
@mick-gsk mick-gsk deleted the split/576-664e-scripts-docs-phase3 branch May 4, 2026 05:09
@mick-gsk mick-gsk restored the split/576-664e-scripts-docs-phase3 branch May 4, 2026 05:14
@mick-gsk mick-gsk reopened this May 4, 2026
@mick-gsk mick-gsk added release:maintenance Include this PR under Maintenance in release notes size/XL Diff ≥ 500 lines — consider splitting labels May 4, 2026
@github-actions github-actions Bot added agent-review-requested Agent review was requested automatically lane/standard Fixes and features — standard review path lane/high-risk Signals/scoring/architecture — full gates + audit required has-conflicts PR has merge conflicts with the base branch labels May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-review-requested Agent review was requested automatically ci Changes to CI/CD workflows or tooling documentation Improvements or additions to documentation has-conflicts PR has merge conflicts with the base branch lane/high-risk Signals/scoring/architecture — full gates + audit required lane/standard Fixes and features — standard review path release:maintenance Include this PR under Maintenance in release notes size/XL Diff ≥ 500 lines — consider splitting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants