Skip to content

Commit 5413107

Browse files
author
SentienceDEV
committed
Rebranding to predicatelabs package name
1 parent f64e3cd commit 5413107

File tree

208 files changed

+671
-1092
lines changed

Some content is hidden

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

208 files changed

+671
-1092
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,20 @@ jobs:
4848
- name: Update version in __init__.py
4949
run: |
5050
VERSION="${{ steps.version.outputs.version }}"
51-
sed -i "s/^__version__ = \".*\"/__version__ = \"$VERSION\"/" sentience/__init__.py
51+
sed -i "s/^__version__ = \".*\"/__version__ = \"$VERSION\"/" predicate/__init__.py
5252
5353
- name: Verify extension files are present
5454
run: |
5555
echo "🔍 Verifying extension files are included..."
5656
5757
# Check required extension files exist
5858
REQUIRED_FILES=(
59-
"sentience/extension/manifest.json"
60-
"sentience/extension/content.js"
61-
"sentience/extension/background.js"
62-
"sentience/extension/injected_api.js"
63-
"sentience/extension/pkg/sentience_core.js"
64-
"sentience/extension/pkg/sentience_core_bg.wasm"
59+
"predicate/extension/manifest.json"
60+
"predicate/extension/content.js"
61+
"predicate/extension/background.js"
62+
"predicate/extension/injected_api.js"
63+
"predicate/extension/pkg/sentience_core.js"
64+
"predicate/extension/pkg/sentience_core_bg.wasm"
6565
)
6666
6767
MISSING_FILES=()
@@ -81,15 +81,15 @@ jobs:
8181
fi
8282
8383
# Verify findTextRect function exists in injected_api.js
84-
if ! grep -q "findTextRect:" sentience/extension/injected_api.js; then
84+
if ! grep -q "findTextRect:" predicate/extension/injected_api.js; then
8585
echo "❌ Error: findTextRect function not found in injected_api.js"
8686
echo "The extension may be out of date. Please sync the extension before releasing."
8787
exit 1
8888
fi
8989
9090
echo "✅ All extension files verified"
9191
echo "📦 Extension files that will be included:"
92-
find sentience/extension -type f | sort
92+
find predicate/extension -type f | sort
9393
9494
- name: Build package
9595
run: |
@@ -117,10 +117,10 @@ jobs:
117117
118118
# Check for required extension files in the wheel
119119
REQUIRED_IN_WHEEL=(
120-
"sentience/extension/manifest.json"
121-
"sentience/extension/injected_api.js"
122-
"sentience/extension/pkg/sentience_core.js"
123-
"sentience/extension/pkg/sentience_core_bg.wasm"
120+
"predicate/extension/manifest.json"
121+
"predicate/extension/injected_api.js"
122+
"predicate/extension/pkg/sentience_core.js"
123+
"predicate/extension/pkg/sentience_core_bg.wasm"
124124
)
125125
126126
MISSING_IN_WHEEL=()
@@ -140,14 +140,14 @@ jobs:
140140
fi
141141
142142
# Verify findTextRect is in the packaged injected_api.js
143-
if ! grep -q "findTextRect:" sentience/extension/injected_api.js; then
143+
if ! grep -q "findTextRect:" predicate/extension/injected_api.js; then
144144
echo "❌ Error: findTextRect not found in packaged injected_api.js"
145145
exit 1
146146
fi
147147
148148
echo "✅ All extension files verified in built package"
149149
echo "📦 Extension files found in wheel:"
150-
find sentience/extension -type f | sort
150+
find predicate/extension -type f | sort
151151
152152
# Cleanup
153153
rm -rf "$TEMP_DIR"
@@ -166,11 +166,11 @@ jobs:
166166
tag_name: v${{ steps.version.outputs.version }}
167167
name: Release v${{ steps.version.outputs.version }}
168168
body: |
169-
Release v${{ steps.version.outputs.version }} of sentienceapi
169+
Release v${{ steps.version.outputs.version }} of predicatelabs
170170
171171
## Installation
172172
```bash
173-
pip install sentienceapi==${{ steps.version.outputs.version }}
173+
pip install predicatelabs==${{ steps.version.outputs.version }}
174174
```
175175
draft: false
176176
prerelease: false

.github/workflows/sync-extension.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Sync Extension from sentience-chrome
1+
name: Sync Extension from predicate-chrome
22

33
on:
44
repository_dispatch:
55
types: [extension-updated]
66
workflow_dispatch:
77
inputs:
88
release_tag:
9-
description: 'Release tag from sentience-chrome (e.g., v1.0.0)'
9+
description: 'Release tag from predicate-chrome (e.g., v1.0.0)'
1010
required: true
1111
type: string
1212
schedule:
@@ -147,7 +147,7 @@ jobs:
147147
if: steps.release.outputs.skip != 'true'
148148
run: |
149149
# Target directory in sdk-python (inside the package source)
150-
TARGET_DIR="sentience/extension"
150+
TARGET_DIR="predicate/extension"
151151
152152
# Ensure target directory exists and is clean
153153
rm -rf "$TARGET_DIR"
@@ -172,7 +172,7 @@ jobs:
172172
if: steps.release.outputs.skip != 'true'
173173
id: changes
174174
run: |
175-
git add sentience/extension/
175+
git add predicate/extension/
176176
177177
if git diff --staged --quiet; then
178178
echo "No changes detected."
@@ -196,10 +196,10 @@ jobs:
196196
uses: peter-evans/create-pull-request@v5
197197
with:
198198
token: ${{ secrets.PR_TOKEN || secrets.GITHUB_TOKEN }}
199-
commit-message: "chore: sync extension files from sentience-chrome ${{ steps.release.outputs.tag }}"
199+
commit-message: "chore: sync extension files from predicate-chrome ${{ steps.release.outputs.tag }}"
200200
title: "Sync Extension: ${{ steps.release.outputs.tag }}"
201201
body: |
202-
This PR syncs extension files from sentience-chrome release ${{ steps.release.outputs.tag }}.
202+
This PR syncs extension files from predicate-chrome release ${{ steps.release.outputs.tag }}.
203203
204204
**Files updated:**
205205
- Extension manifest and scripts

.github/workflows/test.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ jobs:
3333
shell: bash
3434
run: |
3535
pip cache purge || true
36-
pip uninstall -y sentienceapi || true
36+
pip uninstall -y predicatelabs || true
3737
# Aggressively clean any bytecode cache (cross-platform Python approach)
3838
python -c "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.pyc')]" || true
3939
python -c "import pathlib, shutil; [shutil.rmtree(p) for p in pathlib.Path('.').rglob('__pycache__') if p.is_dir()]" || true
40-
# Also clean .pyc files in sentience package specifically
41-
find sentience -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || python -c "import pathlib, shutil; [shutil.rmtree(p) for p in pathlib.Path('sentience').rglob('__pycache__') if p.is_dir()]" || true
42-
find sentience -name "*.pyc" -delete 2>/dev/null || python -c "import pathlib; [p.unlink() for p in pathlib.Path('sentience').rglob('*.pyc')]" || true
40+
# Also clean .pyc files in predicate package specifically
41+
find predicate -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || python -c "import pathlib, shutil; [shutil.rmtree(p) for p in pathlib.Path('predicate').rglob('__pycache__') if p.is_dir()]" || true
42+
find predicate -name "*.pyc" -delete 2>/dev/null || python -c "import pathlib; [p.unlink() for p in pathlib.Path('predicate').rglob('*.pyc')]" || true
4343
# Ensure source uses assert_ (no auto-rewrite).
44-
python -c "import sys; import io; sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace') if sys.platform == 'win32' else sys.stdout; content = open('sentience/agent_runtime.py', 'r', encoding='utf-8').read(); assert 'self.assertTrue(' not in content, 'Source file still has self.assertTrue('; print('OK: Source file verified: uses self.assert_()')"
44+
python -c "import sys; import io; sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace') if sys.platform == 'win32' else sys.stdout; content = open('predicate/agent_runtime.py', 'r', encoding='utf-8').read(); assert 'self.assertTrue(' not in content, 'Source file still has self.assertTrue('; print('OK: Source file verified: uses self.assert_()')"
4545
4646
# Force reinstall to ensure latest code
4747
pip install --no-cache-dir --force-reinstall -e ".[dev]"
@@ -55,10 +55,10 @@ jobs:
5555
git branch --show-current || echo "Detached HEAD"
5656
echo ""
5757
echo "=== Verify editable install (should point to local source) ==="
58-
python -c "import sentience; import os; fpath = sentience.__file__; print(f'Package location: {fpath}'); print(f'Is in current dir: {os.path.abspath(fpath).startswith(os.getcwd())}'); print(f'Points to source: {os.path.exists(fpath)}')"
58+
python -c "import predicate; import os; fpath = predicate.__file__; print(f'Package location: {fpath}'); print(f'Is in current dir: {os.path.abspath(fpath).startswith(os.getcwd())}'); print(f'Points to source: {os.path.exists(fpath)}')"
5959
echo ""
6060
echo "=== Source file line 345 (from repo) ==="
61-
sed -n '345p' sentience/agent_runtime.py || python -c "with open('sentience/agent_runtime.py', 'r') as f: lines = f.readlines(); print(lines[344] if len(lines) > 344 else 'NOT FOUND')"
61+
sed -n '345p' predicate/agent_runtime.py || python -c "with open('predicate/agent_runtime.py', 'r') as f: lines = f.readlines(); print(lines[344] if len(lines) > 344 else 'NOT FOUND')"
6262
echo ""
6363
echo "=== Installed package assert_done (from imported module) ==="
6464
python << 'PYEOF'
@@ -72,11 +72,11 @@ jobs:
7272
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
7373
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8', errors='replace')
7474
75-
from sentience.agent_runtime import AgentRuntime
75+
from predicate.agent_runtime import AgentRuntime
7676
7777
# Verify it's using local source
78-
import sentience
79-
pkg_path = os.path.abspath(sentience.__file__)
78+
import predicate
79+
pkg_path = os.path.abspath(predicate.__file__)
8080
cwd = os.getcwd()
8181
if not pkg_path.startswith(cwd):
8282
print(f'WARNING: Package is not from local source!')
@@ -120,13 +120,13 @@ jobs:
120120
121121
# Check agent_runtime.py line 345
122122
print("=== Checking agent_runtime.py line 345 ===")
123-
with open('sentience/agent_runtime.py', 'r', encoding='utf-8') as f:
123+
with open('predicate/agent_runtime.py', 'r', encoding='utf-8') as f:
124124
lines = f.readlines()
125125
print(''.join(lines[339:350]))
126126
127127
# Verify assert_ method exists
128128
print("\n=== Verifying assert_ method exists ===")
129-
with open('sentience/agent_runtime.py', 'r', encoding='utf-8') as f:
129+
with open('predicate/agent_runtime.py', 'r', encoding='utf-8') as f:
130130
lines = f.readlines()
131131
for i, line in enumerate(lines, 1):
132132
if 'def assert_' in line:
@@ -135,7 +135,7 @@ jobs:
135135
# Check for problematic assertTrue patterns (should NOT exist)
136136
print("\n=== Checking for assertTrue patterns (should NOT exist) ===")
137137
import re
138-
with open('sentience/agent_runtime.py', 'r', encoding='utf-8') as f:
138+
with open('predicate/agent_runtime.py', 'r', encoding='utf-8') as f:
139139
content = f.read()
140140
# Check for self.assertTrue( - this is the bug
141141
if re.search(r'self\.assertTrue\s*\(', content):
@@ -156,14 +156,14 @@ jobs:
156156
- name: Type check with mypy
157157
continue-on-error: true
158158
run: |
159-
mypy sentience --ignore-missing-imports --no-strict-optional
159+
mypy predicate --ignore-missing-imports --no-strict-optional
160160
161161
- name: Check code style
162162
continue-on-error: true
163163
run: |
164-
black --check sentience tests --line-length=100
165-
isort --check-only --profile black sentience tests
166-
flake8 sentience tests --max-line-length=100 --extend-ignore=E203,W503,E501 --max-complexity=15
164+
black --check predicate tests --line-length=100
165+
isort --check-only --profile black predicate tests
166+
flake8 predicate tests --max-line-length=100 --extend-ignore=E203,W503,E501 --max-complexity=15
167167
168168
- name: Build extension (if needed)
169169
if: runner.os != 'Windows'
@@ -192,7 +192,7 @@ jobs:
192192
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8', errors='replace')
193193
194194
# Check the source file directly (not the installed package)
195-
file_path = 'sentience/agent_runtime.py'
195+
file_path = 'predicate/agent_runtime.py'
196196
if not os.path.exists(file_path):
197197
print(f'WARNING: {file_path} not found!')
198198
sys.exit(0) # Don't fail if file doesn't exist
@@ -248,7 +248,7 @@ jobs:
248248
print("=== Final Pre-Test Verification ===")
249249
250250
# First, verify the source file directly
251-
source_file = 'sentience/agent_runtime.py'
251+
source_file = 'predicate/agent_runtime.py'
252252
print(f"=== Checking source file: {source_file} ===")
253253
if not os.path.exists(source_file):
254254
print(f"ERROR: Source file {source_file} not found!")
@@ -282,11 +282,11 @@ jobs:
282282
283283
# Now check the installed package
284284
print("\n=== Checking installed package ===")
285-
import sentience.agent_runtime
285+
import predicate.agent_runtime
286286
287287
# Verify it's using local source (editable install)
288-
import sentience
289-
pkg_path = os.path.abspath(sentience.__file__)
288+
import predicate
289+
pkg_path = os.path.abspath(predicate.__file__)
290290
cwd = os.getcwd()
291291
if not pkg_path.startswith(cwd):
292292
print(f'WARNING: Package is not from local source!')
@@ -296,7 +296,7 @@ jobs:
296296
else:
297297
print(f'OK: Package is from local source: {pkg_path}')
298298
299-
src = inspect.getsource(sentience.agent_runtime.AgentRuntime.assert_done)
299+
src = inspect.getsource(predicate.agent_runtime.AgentRuntime.assert_done)
300300
301301
print("assert_done method source:")
302302
print(src)

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ Thumbs.db
6161
extension-temp/
6262
playground/
6363

64-
# Allow bundled extension assets under sentience/extension/dist
65-
!sentience/extension/dist/
66-
!sentience/extension/dist/**
64+
# Allow bundled extension assets under predicate/extension/dist
65+
!predicate/extension/dist/
66+
!predicate/extension/dist/**

CHANGELOG.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
#### Agent Tracing & Debugging
13-
- **New Module: `sentience.tracing`** - Built-in tracing infrastructure for debugging and analyzing agent behavior
13+
- **New Module: `predicate.tracing`** - Built-in tracing infrastructure for debugging and analyzing agent behavior
1414
- `Tracer` class for recording agent execution
1515
- `TraceSink` abstract base class for custom trace storage
1616
- `JsonlTraceSink` for saving traces to JSONL files
1717
- `TraceEvent` dataclass for structured trace events
1818
- Trace events: `step_start`, `snapshot`, `llm_query`, `action`, `step_end`, `error`
19-
- **New Module: `sentience.agent_config`** - Centralized agent configuration
19+
- **New Module: `predicate.agent_config`** - Centralized agent configuration
2020
- `AgentConfig` dataclass with defaults for snapshot limits, LLM settings, screenshot options
21-
- **New Module: `sentience.utils`** - Snapshot digest utilities
21+
- **New Module: `predicate.utils`** - Snapshot digest utilities
2222
- `compute_snapshot_digests()` - Generate SHA256 fingerprints for loop detection
2323
- `canonical_snapshot_strict()` - Digest including element text
2424
- `canonical_snapshot_loose()` - Digest excluding text (layout only)
2525
- `sha256_digest()` - Hash computation helper
26-
- **New Module: `sentience.formatting`** - LLM prompt formatting
26+
- **New Module: `predicate.formatting`** - LLM prompt formatting
2727
- `format_snapshot_for_llm()` - Convert snapshots to LLM-friendly text format
28-
- **Schema File: `sentience/schemas/trace_v1.json`** - JSON Schema for trace events, bundled with package
28+
- **Schema File: `predicate/schemas/trace_v1.json`** - JSON Schema for trace events, bundled with package
2929

3030
#### Enhanced SentienceAgent
3131
- Added optional `tracer` parameter to `SentienceAgent.__init__()` for execution tracking
@@ -40,8 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4040

4141
### Fixed
4242
- Fixed linting errors across multiple files:
43-
- `sentience/cli.py` - Removed unused variable `code` (F841)
44-
- `sentience/inspector.py` - Removed unused imports (F401)
43+
- `predicate/cli.py` - Removed unused variable `code` (F841)
44+
- `predicate/inspector.py` - Removed unused imports (F401)
4545
- `tests/test_inspector.py` - Removed unused `pytest` import (F401)
4646
- `tests/test_recorder.py` - Removed unused imports (F401)
4747
- `tests/test_smart_selector.py` - Removed unused `pytest` import (F401)
@@ -87,21 +87,21 @@ agent.act("Click the button") # Now traced!
8787

8888
```python
8989
# Tracing
90-
from sentience.tracing import Tracer, JsonlTraceSink, TraceEvent, TraceSink
90+
from predicate.tracing import Tracer, JsonlTraceSink, TraceEvent, TraceSink
9191

9292
# Configuration
93-
from sentience.agent_config import AgentConfig
93+
from predicate.agent_config import AgentConfig
9494

9595
# Utilities
96-
from sentience.utils import (
96+
from predicate.utils import (
9797
compute_snapshot_digests,
9898
canonical_snapshot_strict,
9999
canonical_snapshot_loose,
100100
sha256_digest
101101
)
102102

103103
# Formatting
104-
from sentience.formatting import format_snapshot_for_llm
104+
from predicate.formatting import format_snapshot_for_llm
105105
```
106106

107107
### Notes

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
include sentience/schemas/*.json
2-
recursive-include sentience/extension *.js *.json *.wasm *.d.ts
1+
include predicate/schemas/*.json
2+
recursive-include predicate/extension *.js *.json *.wasm *.d.ts

0 commit comments

Comments
 (0)