Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ jobs:
echo "Wheel contains generated or temporary script files"
exit 1
fi
unzip -l dist/*.whl | grep 'scripts/dupscore/dupscore.toml'
unzip -l dist/*.whl | grep 'sqlbuild/.agents/skills/sqlbuild/references/docs/CONTENTS.md'
python -m venv /tmp/sqlbuild-wheel-smoke
/tmp/sqlbuild-wheel-smoke/bin/python -m pip install dist/*.whl
Expand All @@ -91,7 +90,6 @@ jobs:
printf 'MODEL();\nSELECT 1 AS id\n' > /tmp/sqlbuild-scope-smoke/models/orders.sql
/tmp/sqlbuild-wheel-smoke/bin/sqb --project-dir /tmp/sqlbuild-scope-smoke scope model:orders --json
/tmp/sqlbuild-wheel-smoke/bin/sqlbuild --project-dir /tmp/sqlbuild-scope-smoke scope model:orders
/tmp/sqlbuild-wheel-smoke/bin/dupscore --help
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.platform.name }}
Expand All @@ -118,7 +116,6 @@ jobs:
echo "Source distribution contains generated or temporary script files"
exit 1
fi
tar -tzf dist/*.tar.gz | grep 'scripts/dupscore/dupscore.toml'
- uses: actions/upload-artifact@v4
with:
name: sdist
Expand Down
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@
- Keep fixes within the requested scope. Do not expand supported behavior, permissions, operational cost, or system ownership without a short product decision from the user.
- Do not add safeguards solely for impossible or unsupported states. Record residual risks when a concern is real but outside the current contract.

## Duplicated Code

- Run `uv run fensu dupes --since origin/main` before review, and `uv run fensu dupes --path '<area glob>'` before adding helpers or logic to an area that may already implement them. The report is advisory: unlike `fensu check`, it never gates and never needs to reach zero.
- Treat a genuine duplicate as evidence of possible wider drift, not only a cleanup task: a missing shared owner, parallel implementations of one concept, logic on the wrong side of a boundary, or copies that have already diverged (use `--diff`; a fix present in only one copy may be a bug in the others). Diagnose and record that wider smell before consolidating, because removing the copies erases the only deterministic signal of it.
- Consolidate genuine duplication the change introduces or touches. Report unrelated findings as follow-ups instead of refactoring them opportunistically.
- Members marked `[forced]` are adapter contract overrides required by `test_strict_adapter.py`. Record other intentional mirrors in `[dupes]` in `fensu.toml` with a reason.

## Bounded Review Process

Orchestrating agents must run reviews as a single bounded cycle, not an open-ended loop:
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ pytest tests/unit/src/sqlbuild/compiler/compile/test_main.py
To check whether a branch introduces copied or drifting code in Python or Rust, run:

```bash
uv run dupscore clones --since origin/main
uv run fensu dupes --since origin/main
```

`make dupscore` reports the whole repository. See `scripts/dupscore/README.md` for options.
`make dupes` reports the whole repository. The report is advisory and never needs to reach zero;
`[dupes]` in `fensu.toml` configures exclusions and contract exemptions. See `fensu dupes --help`.

## Tests

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ check-fensu:
uv run fensu check


dupscore:
uv run dupscore clones
dupes:
uv run fensu dupes


check:
Expand Down
6 changes: 6 additions & 0 deletions fensu.toml
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,9 @@ remediation = "consume SQLBuild-owned SQL fact rows instead of raw parser types"
crate_names = [
"sqlbuild-rules-native",
]

[[dupes.contract_exemptions]]
contract = "src/sqlbuild/adapter/contract/classes/strict_adapter.py:StrictAdapter"
forbidden_owners = ["src/sqlbuild/adapter/contract/classes/base_adapter.py:BaseAdapter"]
paths = ["src/sqlbuild/adapter/contract/classes/*", "src/sqlbuild/adapters/*/classes/*"]
reason = "tests/unit/src/sqlbuild/adapter/contract/classes/strict_adapter/test_strict_adapter.py requires every first-class adapter to define each StrictAdapter method itself instead of inheriting it from BaseAdapter."
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ rivers = [
[project.scripts]
sqb = "sqlbuild.cli.entry.main.entry:main"
sqlbuild = "sqlbuild.cli.entry.main.entry:main"
dupscore = "scripts.dupscore.main.dupscore:dupscore"

[dependency-groups]
dev = [
Expand All @@ -78,7 +77,7 @@ dev = [
"pytest-cov>=7.0.0",
"pytest-xdist>=3.8.0",
"ruff>=0.12.0",
"fensu>=0.22.0",
"fensu>=0.23.0",
"testcontainers>=4.8.1",
"ty>=0.0.1a19",
]
Expand All @@ -90,8 +89,6 @@ python-source = "src"
features = ["extension-module"]
include = [
{ path = "LICENSE", format = ["sdist", "wheel"] },
{ path = "scripts/dupscore/**/*.py", format = ["sdist", "wheel"] },
{ path = "scripts/dupscore/dupscore.toml", format = ["sdist", "wheel"] },
]

[tool.commitizen]
Expand Down
84 changes: 0 additions & 84 deletions scripts/dupscore/README.md

This file was deleted.

1 change: 0 additions & 1 deletion scripts/dupscore/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion scripts/dupscore/_helpers/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion scripts/dupscore/_helpers/clones/__init__.py

This file was deleted.

139 changes: 0 additions & 139 deletions scripts/dupscore/_helpers/clones/clustering.py

This file was deleted.

Loading
Loading