<?php
require 'examples/boot.php';
require_once dirname(__DIR__).'/Support.php';
use Cognesy\Tell\Tell;
use Cognesy\Tell\TellRequest;
$project = TellHarnessExample::project();
try {
$tell = Tell::open($project);
$tell->workspace()->initialize();
$review = $tell->conversation('release-review');
$review->send(TellRequest::prompt('Record the current release decision.'));
$before = $review->history()->head;
$prompt = 'Challenge that decision and describe the strongest alternative.';
$experiment = $tell->run(
TellRequest::prompt($prompt)
->conversation('release-review')
->transient(),
);
$after = $review->history()->head;
echo "=== Transient Result ===\n";
echo $experiment->text(), "\n";
echo 'Transient: '.($experiment->isTransient() ? 'yes' : 'no')."\n";
echo 'Conversation head unchanged: '.($before === $after ? 'yes' : 'no')
."\n";
assert($experiment->isTransient(), 'Expected a transient result.');
assert(
$before === $after,
'A transient run must not move the conversation head.',
);
} finally {
TellHarnessExample::remove($project);
}