Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
5ed5b37
chore(vendor): bump tinyinference submodule
senamakel Nov 14, 2026
b8defe6
chore(vendor): update tinyinference submodule
senamakel Nov 14, 2026
0467053
chore(vendor): bump tinyinference submodule
senamakel Nov 14, 2026
56c04cb
chore(deps): bump tinystoragedrivers to 2.1.2 and add base64 and sha2
senamakel Nov 14, 2026
7b17483
refactor(agentic): carry assets through split evaluation requests
senamakel Nov 14, 2026
45a32a5
feat(agentic): add assets field to evaluation requests and reject box…
senamakel Nov 14, 2026
369d030
feat(flow): handle box questions in flow helpers
senamakel Nov 14, 2026
c12e33d
test(quorum): add empty assets map to evaluation request fixture
senamakel Nov 14, 2026
23fae56
feat(agentic): average box answers by picking the most confident
senamakel Nov 14, 2026
e5f891c
feat(sessions): add screenshot bytes and point press helpers
senamakel Nov 14, 2026
660700e
feat(engine): add image crate for captcha screenshot processing
senamakel Nov 14, 2026
ddc2c90
feat(captcha): add captcha module
senamakel Nov 14, 2026
34098dd
feat(captcha): add scan module for captcha detection
senamakel Nov 14, 2026
c271017
feat(captcha): export viewport type from captcha module
senamakel Nov 14, 2026
905a647
feat(captcha): add captcha solving module
senamakel Nov 14, 2026
09088d2
feat(agentic): add captcha solving module
senamakel Nov 14, 2026
026591c
feat(engine): expose captcha solving types and runner hook
senamakel Nov 14, 2026
6104ddd
feat(safety): add is_bot_check to identify bot-verification gates
senamakel Nov 14, 2026
b12487f
feat(engine): solve captchas automatically before asking a person
senamakel Nov 14, 2026
f68d897
feat(task): cap captchas solved automatically per drive
senamakel Nov 14, 2026
adf378c
test(captcha): add pixel and scan test coverage
senamakel Nov 14, 2026
fab1d67
test(captcha): add solve tests for captcha handling
senamakel Nov 14, 2026
22c8af0
chore(captcha): drop redundant path attribute on test module
senamakel Nov 14, 2026
04beace
test(task): cover captcha solving and human handoff paths
senamakel Nov 14, 2026
65096dc
refactor(task): re-export max solved walls from drive module
senamakel Nov 14, 2026
17169ad
test(task): lengthen captcha retry flow so scripted failures land on …
senamakel Nov 14, 2026
7194c48
test(vote): cover box question framing and surest-box merge
senamakel Nov 14, 2026
d62515f
feat(config): add optional captcha configuration to the contract
senamakel Nov 14, 2026
a3ef2ca
feat(tinybus): wire captcha solver into workspace runner
senamakel Nov 14, 2026
2076aaf
fix(engine): gate MAX_SOLVED_WALLS re-export behind cfg(test)
senamakel Nov 14, 2026
44e187f
test(tinybus): cover captcha configuration and solver gating
senamakel Nov 14, 2026
2093906
test(dispatch): exercise captcha solver directly in service test
senamakel Nov 14, 2026
1fb8952
test(config): cover captcha section wire format and key redaction
senamakel Nov 14, 2026
2bc9771
chore: apply rustfmt formatting across browser and engine crates
senamakel Nov 14, 2026
acb0ec5
refactor(captcha): extract challenge reading into its own function
senamakel Nov 14, 2026
88ac4e2
test(captcha): assert presses equal empty slice in solve tests
senamakel Nov 14, 2026
6ea90fa
test(tinycomputer): update contract version assertion to 3.1
senamakel Nov 14, 2026
6afdcbb
docs(tinycomputer-bus): correct versioning examples to match contract…
senamakel Nov 14, 2026
3622886
feat(journal): redact image data from logged requests
senamakel Nov 14, 2026
f0b7c41
feat(captcha): add captcha solver that tries before pausing for a person
senamakel Nov 14, 2026
168dad6
docs(agents): add captcha solver row to the change-to-docs table
senamakel Nov 14, 2026
2d4e251
docs: document captcha solver configuration and spec
senamakel Nov 14, 2026
9b592cb
chore(deps): bump tinyinference crates to 8a16bfd
senamakel Nov 14, 2026
31ab19e
docs(captcha): clarify checkbox press limit in solve doc comment
senamakel Nov 14, 2026
e9261a3
chore(vendor): bump tinyinference submodule
senamakel Nov 14, 2026
5523232
chore(vendor): bump tinyinference submodule
senamakel Nov 14, 2026
84e7d6f
refactor(agentic): simplify trusted endpoint check
senamakel Nov 14, 2026
4cb7f33
fix(captcha): require a token per checkbox and drop guessed press pos…
senamakel Nov 14, 2026
dadd5ed
feat(task): pass usage and budget to captcha solver
senamakel Nov 14, 2026
68a530f
feat(task): charge captcha solving to the task's budget
senamakel Nov 14, 2026
0c6d400
chore(task): re-export task_usage from drive module
senamakel Nov 14, 2026
d6d25ed
feat(captcha): fall back to widget layout when jev cannot locate targets
senamakel Nov 14, 2026
27ef2fb
feat(captcha): gate solving on a task budget and refuse guessed presses
senamakel Nov 14, 2026
0b5275a
feat(engine): export CaptchaReserve from the task module
senamakel Nov 14, 2026
b3476ee
test(task): cover captcha solver budget reservation and timeout
senamakel Nov 14, 2026
7aa3901
chore(deps): bump tinyinference to cf829339
senamakel Nov 14, 2026
e19de27
test(captcha): give checkbox tests a located tile so presses are exer…
senamakel Nov 14, 2026
bc3aa0a
chore(deps): bump tinystoragedrivers to 2.1.3
senamakel Nov 14, 2026
ce082ed
chore(vendor): bump tinyinference submodule
senamakel Nov 14, 2026
9557b1a
chore(deps): downgrade tinystoragedrivers to 2.1.2
senamakel Nov 14, 2026
9bdd913
test(captcha): register page tests module
senamakel Nov 14, 2026
42f4aeb
docs: document captcha solver limits and journal fields
senamakel Nov 14, 2026
46d46fc
docs(captcha-solver): tighten token, press, and budget rules
senamakel Nov 14, 2026
9bc5548
chore(vendor): bump tinyinference submodule
senamakel Nov 14, 2026
eb9de90
chore(vendor): pin tinyinference submodule to merged cf829339
senamakel Nov 14, 2026
23ac7c7
chore(vendor): bump tinyinference submodule
senamakel Nov 14, 2026
400f312
chore(vendor): bump tinyinference submodule
senamakel Nov 14, 2026
d06d21b
refactor(surface): extract paste steps behind a trait
senamakel Nov 14, 2026
abad949
test(surface): replace per-step failure flags with a failing list
senamakel Nov 14, 2026
758ed25
test(paste): simplify clipboard set step handling
senamakel Nov 14, 2026
cb455ce
fix(captcha): skip checkboxes that already hold a token when picking …
senamakel Nov 14, 2026
347445f
Merge origin/main into captcha-fighter
senamakel Nov 14, 2026
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
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ reading first is cheaper than rediscovering a rule by breaking it.
| change a Jev loop, question, threshold, or budget | [`docs/technical/jev-harness.md`](docs/technical/jev-harness.md), [`docs/technical/decision-loops.md`](docs/technical/decision-loops.md), [`docs/technical/decision-thresholds.md`](docs/technical/decision-thresholds.md), [`docs/technical/specs/jev-wide-turns.md`](docs/technical/specs/jev-wide-turns.md), [`docs/technical/specs/flow-reflection.md`](docs/technical/specs/flow-reflection.md), [`docs/technical/specs/jev-deliberation.md`](docs/technical/specs/jev-deliberation.md), [`docs/technical/jev-questions.md`](docs/technical/jev-questions.md), [`docs/technical/flow-examples.md`](docs/technical/flow-examples.md), [`crates/tinycomputer-engine/src/agentic/flow/README.md`](crates/tinycomputer-engine/src/agentic/flow/README.md), [`docs/technical/specs/jev-intent-flows.md`](docs/technical/specs/jev-intent-flows.md), [`docs/technical/specs/jev-briefing.md`](docs/technical/specs/jev-briefing.md) |
| change `RunGoal` or `ResolveIntent` | [`crates/tinycomputer-engine/src/agentic/README.md`](crates/tinycomputer-engine/src/agentic/README.md), [`docs/technical/jev-harness.md`](docs/technical/jev-harness.md) |
| write, review, or debug a flow | [`crates/tinycomputer-bus/src/flow/guide.md`](crates/tinycomputer-bus/src/flow/guide.md), [`docs/technical/flow-examples.md`](docs/technical/flow-examples.md), [`docs/technical/decision-loops.md`](docs/technical/decision-loops.md) |
| change the captcha solver | [`docs/technical/specs/captcha-solver.md`](docs/technical/specs/captcha-solver.md), "Captcha solver" in [`docs/technical/decision-thresholds.md`](docs/technical/decision-thresholds.md), `crates/tinycomputer-engine/src/agentic/captcha/` |
| change the task API, pausing, budgets, the planner, rescues, or output shapes | [`docs/technical/tasks.md`](docs/technical/tasks.md), [`docs/technical/specs/task-rescue.md`](docs/technical/specs/task-rescue.md), [`docs/technical/specs/task-output.md`](docs/technical/specs/task-output.md), [`docs/technical/specs/unified-agent.md`](docs/technical/specs/unified-agent.md), [`crates/tinycomputer-skills/skills/tinycomputer/SKILL.md`](crates/tinycomputer-skills/skills/tinycomputer/SKILL.md) |
| find out why a run did what it did, or why it was slow | [`docs/technical/jev-journal.md`](docs/technical/jev-journal.md), the failure table in [`docs/technical/flow-examples.md`](docs/technical/flow-examples.md), [`docs/technical/lab.md`](docs/technical/lab.md), "Debugging And Measuring Runs" below |
| change the on-screen cursor | [`crates/tinycomputer-cursor/README.md`](crates/tinycomputer-cursor/README.md), [`docs/technical/specs/virtual-cursor.md`](docs/technical/specs/virtual-cursor.md) |
Expand Down
13 changes: 8 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ tinycomputer-accessibility = { path = "crates/tinycomputer-accessibility" }
# crate of the vendored `vendor/tinyinference` submodule, pinned by its gitlink
# so provider validation and retry behavior are reproducible. Only this crate
# of TinyInference is linked into the module.
tinyinference-decisions = { git = "https://github.com/tinyhumansai/tinyinference", rev = "26af7607d3759f0e6096d3ba8fd3bbd9d1589821" }
tinyinference-decisions = { git = "https://github.com/tinyhumansai/tinyinference", rev = "cf829339c785b952ad99b2dfc275b9bf4242b67d" }
# The optional LLM planner's model client (engine `planner` feature) and the
# lab's author. Naming the shared source lets a host workspace redirect it to
# its single TinyInference copy; standalone builds use the local patch below.
tinyinference-llm = { git = "https://github.com/tinyhumansai/tinyinference", rev = "26af7607d3759f0e6096d3ba8fd3bbd9d1589821" }
tinyinference-llm = { git = "https://github.com/tinyhumansai/tinyinference", rev = "cf829339c785b952ad99b2dfc275b9bf4242b67d" }
# The browser automation engine, linked as a library: `execute_command` over a
# `DaemonState`. Vendored from the tinyhumansai fork until
# vercel-labs/agent-browser#2008 lands upstream.
Expand Down Expand Up @@ -101,6 +101,9 @@ log = "0.4"
cpal = "0.18"
# Unpredictable one-use handles bind host confirmation to a module-held action.
getrandom = "0.4"
# The captcha solver cuts and scales screenshots before Jev reads them. PNG
# only; agent-browser already links the same crate.
image = { version = "0.25", default-features = false, features = ["png"] }
# Held browser outputs travel as base64 chunks with a SHA-256 digest. Same
# versions agent-browser takes, so the lockfile holds one copy of each.
base64 = "0.22"
Expand Down
8 changes: 8 additions & 0 deletions MODULE.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ is optional:
optional `sdk_name`); `endpoint_url` may only repeat that route's approved
base URL; and `rescue_route` (`api_key`, `provider`, `endpoint_url`,
`sdk_name`) gives the rescuer a route and key of its own;
- `captcha`: the captcha solver a task tries before it pauses for a person
at a captcha or "verify you are human" check — `jev` (a Jev route of its
own, a `jev` object whose provider is not `sage`, which cannot locate
things in an image, so its image challenges would all fail while checkbox
handling still works; `model` defaults to `jev-preview`, which reads
images) and `max_attempts` (image challenges per try, default 3, at most
10). Without it such a check pauses the task as before
(`docs/technical/specs/captcha-solver.md`);
- `browser`: how every browser launches — `executable` (the Chrome or
Chromium binary), `user_agent`, `args` (an array of launch arguments),
`perception` (`sight`, the default, or `tree`: how a task reads a page),
Expand Down
40 changes: 39 additions & 1 deletion crates/tinycomputer-browser/src/sessions/artifacts.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
//! What sessions leave behind: held outputs and downloads.

use base64::Engine as _;
use serde_json::{Value, json};
use tinycomputer_bus::browser::{
DownloadId, DownloadInfo, DownloadState, DownloadWaitRequest, OutputChunk, OutputId, SessionId,
DownloadId, DownloadInfo, DownloadState, DownloadWaitRequest, OutputChunk, OutputId,
ScreenshotRequest, SessionId,
};

use super::Browser;
Expand All @@ -11,6 +13,42 @@ use crate::error::Error;
use crate::error::Result;

impl Browser {
/// Takes a screenshot and hands its bytes straight back, holding
/// nothing: for code inside the module that looks at the page itself,
/// such as the captcha solver, rather than a caller collecting it.
///
/// # Errors
///
/// Whatever [`Browser::screenshot`] reports, and a failure when the held
/// image cannot be read back.
pub async fn screenshot_bytes(
&self,
id: &SessionId,
request: ScreenshotRequest,
) -> Result<Vec<u8>> {
let held = self.screenshot(id, request).await?;
let mut bytes = Vec::with_capacity(usize::try_from(held.total_bytes).unwrap_or(0));
let read = loop {
let chunk = match self.read_output(&held.id, bytes.len() as u64, held.total_bytes) {
Ok(chunk) => chunk,
Err(error) => break Err(error),
};
match base64::engine::general_purpose::STANDARD.decode(&chunk.data) {
Ok(data) => bytes.extend_from_slice(&data),
Err(_) => {
break Err(crate::error::Error::failed(
"a held screenshot was not base64",
));
}
}
if chunk.eof {
break Ok(());
}
};
self.release_output(&held.id)?;
read.map(|()| bytes)
}

/// Reads up to `len` bytes of a held output from `offset`.
///
/// # Errors
Expand Down
20 changes: 20 additions & 0 deletions crates/tinycomputer-browser/src/sessions/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,26 @@ impl Browser {
})
}

/// Presses the left mouse button at the viewport point (`x`, `y`), in CSS
/// pixels, as a person's hand does: whatever is on top there — a
/// cross-origin frame included — takes it as trusted input. Each of the
/// pointer's events is a raw command, so the action gate and the allowed
/// origins see every one, as they see [`Browser::command`].
///
/// # Errors
///
/// Whatever [`Browser::command`] reports for an event, and
/// [`Error::InvalidInput`] for a point that is not finite.
pub async fn press_point(&self, id: &SessionId, x: f64, y: f64) -> Result<()> {
if !x.is_finite() || !y.is_finite() {
return Err(Error::invalid_input("a point to press must be finite"));
}
for event in convert::press_at(x, y) {
self.command(id, event).await?;
}
Ok(())
}

/// Runs one raw agent-browser command, such as
/// `{"action": "inputvalue", "selector": "@e3"}`, and returns its `data`.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,14 @@ async fn downloads_are_recorded_as_they_finish() {
assert_eq!(browser.list_downloads(&id).await.unwrap(), [finished]);
browser.close_session(&id).await.unwrap();
}

#[tokio::test]
async fn screenshot_bytes_hands_the_image_back() {
let fake = Fake::new();
let (browser, id) = open(&fake, "screenshot-bytes").await;
let bytes = browser
.screenshot_bytes(&id, ScreenshotRequest::default())
.await
.unwrap();
assert_eq!(bytes, crate::fake::png(1280, 800));
}
Original file line number Diff line number Diff line change
Expand Up @@ -908,3 +908,28 @@ async fn a_raw_command_needs_an_action_and_returns_its_data() {
Err(Error::InvalidInput { .. })
));
}

#[tokio::test]
async fn pressing_a_point_moves_presses_and_releases_there() {
let fake = Fake::new();
let (browser, id) = open(&fake, "press-point").await;
browser.press_point(&id, 120.5, 64.0).await.unwrap();
let mice: Vec<Value> = fake
.sent()
.into_iter()
.filter(|command| command["action"] == "mouse")
.collect();
let events: Vec<&str> = mice
.iter()
.map(|command| command["eventType"].as_str().unwrap())
.collect();
assert_eq!(events, ["mouseMoved", "mousePressed", "mouseReleased"]);
assert!(
mice.iter()
.all(|command| command["x"] == 120.5 && command["y"] == 64.0)
);
assert!(matches!(
browser.press_point(&id, f64::NAN, 1.0).await,
Err(Error::InvalidInput { .. })
));
}
28 changes: 28 additions & 0 deletions crates/tinycomputer-bus/src/config/captcha.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//! The captcha solver's configuration.

use serde::{Deserialize, Serialize};

use crate::agentic::JevConfig;

/// The model a captcha configuration asks when it names none: Jev 1.14,
/// the first to read images and answer Box questions.
pub const DEFAULT_CAPTCHA_MODEL: &str = "jev-preview";

/// The captcha solver a task tries before it asks a person to get past a
/// captcha or a "prove you are human" check (contract 3.2).
///
/// Absent means no solver: such a check pauses the task as `needs_human`,
/// as before. `jev` is its own decision route, since the solver needs a
/// model that reads images (`jev.model` defaults to
/// [`DEFAULT_CAPTCHA_MODEL`]); its credential is delivered like the main
/// `jev` one, through confidential module configuration.
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct CaptchaConfig {
/// The image-reading decision route the solver asks.
pub jev: JevConfig,
/// Image challenges submitted before handing the page to a person.
/// Absent means the module's default, 3; at most 10.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max_attempts: Option<u32>,
}
13 changes: 11 additions & 2 deletions crates/tinycomputer-bus/src/config/computer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use serde::{Deserialize, Serialize, de::DeserializeOwned};

use crate::agentic::JevConfig;

use super::{BrowserConfig, PlannerConfig};
use super::{BrowserConfig, CaptchaConfig, PlannerConfig};

/// The configuration shared by hosts and the loaded `TinyComputer` module.
///
/// Credentials in `jev` and `planner` must be delivered through `TinyBus`'s
/// Credentials in `jev`, `planner` and `captcha` must be delivered through `TinyBus`'s
/// confidential module-configuration path. Omit an unset `jev`, `planner`, or
/// `browser` section; an explicit `null` is rejected. `trace_path` retains the
/// desktop adapter's historical behavior where `null` means unset. The nested
Expand Down Expand Up @@ -37,6 +37,14 @@ pub struct ComputerConfig {
skip_serializing_if = "Option::is_none"
)]
pub browser: Option<BrowserConfig>,
/// The captcha solver tasks try before asking a person, when configured
/// (contract 3.2).
#[serde(
default = "missing_option",
deserialize_with = "deserialize_present_option",
skip_serializing_if = "Option::is_none"
)]
pub captcha: Option<CaptchaConfig>,
/// The desktop trace file path, when tracing is enabled.
#[serde(skip_serializing_if = "Option::is_none")]
pub trace_path: Option<String>,
Expand All @@ -61,6 +69,7 @@ impl std::fmt::Debug for ComputerConfig {
.field("jev", &self.jev)
.field("planner", &self.planner)
.field("browser", &self.browser)
.field("captcha", &self.captcha)
.field(
"trace_path",
&self.trace_path.as_ref().map(|_| "[REDACTED]"),
Expand Down
27 changes: 27 additions & 0 deletions crates/tinycomputer-bus/src/config/config_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,30 @@ fn computer_config_rejects_null_sections_but_keeps_nullable_trace_path() {
serde_json::from_value(json!({"trace_path": null})).expect("legacy null trace path");
assert!(config.trace_path.is_none());
}

#[test]
fn a_captcha_section_pins_its_wire_form_and_redacts_its_key() {
let config: ComputerConfig = serde_json::from_value(json!({
"captcha": {"jev": {"api_key": "secret-key", "model": "jev-preview"}, "max_attempts": 4}
}))
.unwrap();
let captcha = config.captcha.as_ref().unwrap();
assert_eq!(captcha.max_attempts, Some(4));
assert_eq!(captcha.jev.api_key(), "secret-key");
assert_eq!(captcha.jev.model.as_deref(), Some("jev-preview"));
assert!(!format!("{config:?}").contains("secret-key"));
let wire = serde_json::to_value(&config).unwrap();
assert_eq!(wire["captcha"]["max_attempts"], 4);
assert_eq!(
serde_json::from_value::<ComputerConfig>(wire).unwrap(),
config
);
assert!(
serde_json::to_value(ComputerConfig::default())
.unwrap()
.get("captcha")
.is_none()
);
assert!(serde_json::from_value::<ComputerConfig>(json!({"captcha": null})).is_err());
assert_eq!(super::DEFAULT_CAPTCHA_MODEL, "jev-preview");
}
2 changes: 2 additions & 0 deletions crates/tinycomputer-bus/src/config/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
//! Typed configuration passed when the `TinyComputer` module is loaded.

mod browser;
mod captcha;
mod computer;
mod planner;

pub use browser::{BrowserConfig, BrowserPerception, BrowserSettle};
pub use captcha::{CaptchaConfig, DEFAULT_CAPTCHA_MODEL};
pub use computer::ComputerConfig;
pub use planner::{ModelRoute, PlannerConfig};

Expand Down
4 changes: 2 additions & 2 deletions crates/tinycomputer-bus/src/version/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! release workflow bumps, which tracks the shipped artifact.

/// The wire contract version this crate defines.
pub const CONTRACT_VERSION: (u32, u32) = (3, 1);
pub const CONTRACT_VERSION: (u32, u32) = (3, 2);

/// Returns whether a host holding [`CONTRACT_VERSION`] can bind to a module
/// reporting `module`.
Expand All @@ -22,7 +22,7 @@ pub const CONTRACT_VERSION: (u32, u32) = (3, 1);
/// ```
/// # use tinycomputer_bus::{is_compatible, CONTRACT_VERSION};
/// assert!(is_compatible(CONTRACT_VERSION));
/// assert!(is_compatible((3, 1)));
/// assert!(is_compatible((3, 2)));
/// assert!(!is_compatible((3, 0)));
/// assert!(!is_compatible((2, 29)));
/// assert!(!is_compatible((1, 8)));
Expand Down
9 changes: 6 additions & 3 deletions crates/tinycomputer-bus/src/version/version_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use super::{CONTRACT_VERSION, binds, is_compatible};

#[test]
fn the_shipped_contract_version_is_pinned() {
assert_eq!(CONTRACT_VERSION, (3, 1));
assert_eq!(CONTRACT_VERSION, (3, 2));
}

#[test]
Expand All @@ -16,10 +16,13 @@ fn the_contract_binds_to_itself() {

#[test]
fn a_newer_minor_on_the_module_side_binds() {
assert!(is_compatible((3, 1)));
assert!(is_compatible((3, 2)));
assert!(is_compatible((3, 97)));
// 3.2 adds the optional `captcha` module configuration. A 3.1 module
// rejects it as unknown, so a 3.2 host cannot bind to one.
assert!(!is_compatible((3, 1)));
// 3.1 adds the optional `browser.profile` module configuration field. A
// 3.0 module rejects it as unknown, so a 3.1 host cannot bind to one.
// 3.0 module rejects it as unknown.
assert!(!is_compatible((3, 0)));
// The history below is the 2.x line, which 3.0 no longer binds at all.
// 2.24 adds same-task flow-to-planner handoff to StartTask.
Expand Down
5 changes: 3 additions & 2 deletions crates/tinycomputer-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub use records::{
rank, rank_closest,
};
pub use safety::{
Consequence, FieldHint, PaymentEvidence, adjusts_a_count, consequence, human_needed,
payment_evidence, screen_payment_evidence,
Consequence, FieldHint, PROVE_YOU_ARE_HUMAN, PaymentEvidence, SOLVE_THE_CAPTCHA,
adjusts_a_count, consequence, human_needed, is_bot_check, payment_evidence,
screen_payment_evidence,
};
Loading
Loading