=== Tlloancy Source Stamp ===
Contributors: tlloancy
Tags: ai, wordpress ai client, journal, audit log, article 50
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Records WordPress 7.0 AI Client generations in a local journal and stamps the matching post. Technical tool, not legal advice.

== Description ==

Tlloancy Source Stamp listens to the official WordPress AI Client (`wp_ai_client_prompt()` / `wp_ai_client_after_generate_result`). When a generation finishes through that API, the plugin writes a row in a table on **your** database. If a post is saved in the same request, or if exactly one generation is waiting for you, the post is stamped (origin, model, time).

The journal stores metadata only: caller plugin, model, provider, context, token counts when available. Prompt and completion text are never stored.

An optional visitor-facing note can appear on posts the plugin stamped as generated or assisted. Unstamped posts stay silent.

= What it does =

* Listens to `wp_ai_client_after_generate_result` (WordPress 7.0+)
* Writes a self-hosted journal
* Never stores prompt or completion text
* Stamps a post saved in the same request, or from a single waiting generation (15 minutes)
* Optional visitor-facing note **only** on stamped posts
* CSV export of the journal
* Daily prune of rows older than 365 days (filter `ai_helm_retention_days`)

= What it does not do =

* Site-wide chatbot banners or AI-tool scanners
* Image IPTC / C2PA embedding
* Compliance scores, Article 4 checklists, or legal templates
* RAG, budget caps, or model routing

= Honesty about the law =

Installing this plugin does not make a site compliant with Regulation (EU) 2024/1689. Whether Article 50 applies to a given page is a legal assessment for the site operator. This is a technical record of AI Client use.

= Requirements =

Automatic stamps need **WordPress 7.0** (or later) so `wp_ai_client_prompt()` exists. On older versions the journal stays empty; you can still set origin by hand in the editor.

== Installation ==

1. Upload the `tlloancy-source-stamp` folder to `/wp-content/plugins/`.
2. Activate Tlloancy Source Stamp.
3. Open **Source Stamp** in the admin menu. Confirm that the WordPress AI Client is detected.
4. Generate content with any plugin that uses `wp_ai_client_prompt()`, then check the journal.

== Frequently Asked Questions ==

= Does this make my site legally compliant? =

No. It records AI Client use. Legal assessment stays with the site operator.

= Why was my post not stamped? =

The plugin queues runs per user for 15 minutes and auto-stamps only if exactly one run is waiting. Two queued generations: no automatic stamp (wrong metadata is worse than a gap). Cron and logged-out calls are same-request only. **Source Stamp → Test** calls the AI Client directly: Generate, then Create draft in a second request. The editor box remains the manual fallback.

= Do you send data off the site? =

No. The journal lives in your database. There is no account and no phone-home.

= Do you store what the model wrote? =

No. Only metadata (time, caller, model, tokens, post ID).

= Is this legal advice? =

No.

== Changelog ==

= 1.0.0 =
* Initial release: AI Client listener, same-request post stamp, local journal, CSV export, label on stamped posts only.

== Upgrade Notice ==

= 1.0.0 =
First public version. Requires WordPress 7.0 for automatic stamps.
