Skip to content

Commit 491fd9b

Browse files
authored
Merge pull request #323 from Integration-Automation/dev
Release: merge dev into main (feature docs v4–v114, 130+ headless utils)
2 parents b9e57ad + 7439587 commit 491fd9b

682 files changed

Lines changed: 56070 additions & 607 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ __pycache__/
1313
build/
1414
develop-eggs/
1515
dist/
16+
node_modules/
1617
downloads/
1718
eggs/
1819
.eggs/

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Run before every commit; fix all new findings:
229229
pip install ruff pylint bandit radon
230230
ruff check je_auto_control/
231231
pylint je_auto_control/
232-
bandit -r je_auto_control/ -x je_auto_control/test
232+
bandit -c pyproject.toml -r je_auto_control/ # uses [tool.bandit] excludes/skips
233233
radon cc je_auto_control/ -a -nc # flags functions with CC >= C (>10)
234234
```
235235

README.md

Lines changed: 886 additions & 0 deletions
Large diffs are not rendered by default.

README/README_zh-CN.md

Lines changed: 875 additions & 0 deletions
Large diffs are not rendered by default.

README/README_zh-TW.md

Lines changed: 875 additions & 0 deletions
Large diffs are not rendered by default.

autocontrol-lsp/vscode/package-lock.json

Lines changed: 108 additions & 108 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

autocontrol-lsp/vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"devDependencies": {
9898
"@types/node": "^20.0.0",
9999
"@types/vscode": "^1.85.0",
100-
"esbuild": "^0.25.0",
100+
"esbuild": "^0.28.1",
101101
"typescript": "^5.4.0",
102102
"vscode-languageclient": "^9.0.1"
103103
}

dev_requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ qt-material==2.17
99
mss==10.2.0
1010
defusedxml==0.7.1
1111

12+
# Office I/O ([office] extra) — exercised by the headless Office tests.
13+
openpyxl==3.1.5
14+
python-docx==1.2.0
15+
python-pptx==1.0.2
16+
1217
# Quality tooling — used by .github/workflows/quality.yml and locally.
1318
ruff==0.15.14
1419
bandit==1.9.4
1520
pytest==9.0.3
1621
pytest-timeout==2.4.0
22+
pytest-rerunfailures==15.1
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Near-Duplicate Text Detection (SimHash / MinHash)
2+
=================================================
3+
4+
``fuzzy.fuzzy_dedupe`` is O(n²) pairwise ``SequenceMatcher`` with no stable
5+
fingerprint, and ``image_dedup`` only hashes pixels. This adds text
6+
fingerprints — SimHash (Hamming-distance near-dup) and MinHash (estimated
7+
Jaccard) — that scale and give a reusable signature, the text analog of the
8+
perceptual image hash.
9+
10+
Pure standard library (``hashlib`` / ``re``); imports no ``PySide6``. A fixed
11+
hash (``blake2b``, not the salted built-in ``hash()``) keeps fingerprints
12+
deterministic across runs and CI.
13+
14+
Headless API
15+
------------
16+
17+
.. code-block:: python
18+
19+
from je_auto_control import (
20+
simhash, near_duplicates, minhash_signature, minhash_similarity,
21+
)
22+
23+
h1 = simhash("the quick brown fox jumps over the lazy dog")
24+
h2 = simhash("the quick brown fox jumps over the lazy dogs")
25+
# small Hamming distance ⇒ near-duplicate
26+
27+
clusters = near_duplicates(docs, max_distance=12) # groups of indices
28+
29+
sig_a = minhash_signature(text_a)
30+
minhash_similarity(sig_a, minhash_signature(text_b)) # ~ Jaccard
31+
32+
``simhash`` returns a ``bits``-wide fingerprint from word shingles;
33+
``hamming_distance`` (shared with ``image_dedup``) measures bit difference.
34+
``near_duplicates`` clusters texts whose SimHashes are within ``max_distance``
35+
bits, returning a partition of indices (singletons included).
36+
``minhash_signature`` / ``minhash_similarity`` give a MinHash signature and a
37+
Jaccard estimate for set-overlap style dedup. Run ``normalize_text`` first for
38+
accent/form-insensitive fingerprints.
39+
40+
Executor commands
41+
-----------------
42+
43+
``AC_simhash`` returns ``{simhash}`` for a ``text``; ``AC_near_duplicates``
44+
returns ``{clusters}`` for ``texts`` within ``max_distance``. Both are exposed
45+
as MCP tools (``ac_simhash`` / ``ac_near_duplicates``) and as Script Builder
46+
commands under **Data**.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Single-Series Anomaly Detection
2+
===============================
3+
4+
``data_drift`` answers "did the *distribution* shift between two batches" — it
5+
cannot point at *which* value in one live series is anomalous — and
6+
``slo.burn_alerts`` only thresholds error-budget burn, not arbitrary metric
7+
values (latency spikes, cost spikes, CPU). This flags outliers in a single
8+
series via z-score, robust MAD (modified z-score), and an EWMA control chart.
9+
10+
Pure standard library (``math`` / ``statistics``); imports no ``PySide6``. Every
11+
function is pure (values in, flags out), so it is fully deterministic in CI.
12+
13+
Headless API
14+
------------
15+
16+
.. code-block:: python
17+
18+
from je_auto_control import detect_anomalies, mad_anomalies, ewma_control
19+
20+
series = [10, 11, 9, 10, 12, 10, 95, 11, 10] # index 6 is the spike
21+
mad_anomalies(series) # [6] (robust)
22+
detect_anomalies(series, method="mad")
23+
# [{index, value, score, is_anomaly}, ...]
24+
25+
ewma_control(values, alpha=0.5, target_mean=10, target_sigma=1) # shift indices
26+
27+
``detect_anomalies`` scores each value (``mad`` default, or ``zscore``) and flags
28+
those past the threshold (3.5 for MAD, 3.0 for z-score). ``mad_anomalies`` /
29+
``zscore_anomalies`` return just the flagged indices, and ``mad_scores`` /
30+
``zscore_scores`` the raw scores. MAD (Iglewicz-Hoaglin modified z-score) is
31+
robust to outliers inflating the spread, so it stays sensitive where a plain
32+
z-score would not. ``ewma_control`` is an EWMA control chart for sustained
33+
level shifts — pass ``target_mean`` / ``target_sigma`` for an in-control
34+
baseline (else the series' own stats).
35+
36+
Executor command
37+
----------------
38+
39+
``AC_detect_anomalies`` takes a ``values`` list (optional ``method`` /
40+
``threshold``) and returns ``{results}``. It is exposed as the MCP tool
41+
``ac_detect_anomalies`` and as a Script Builder command under **Data**.

0 commit comments

Comments
 (0)