Skip to content

fix(persona): echo the offending value in validate_persona_version error - #300

Open
4gjnbzb4zf-sudo wants to merge 2 commits into
vibeforge1111:masterfrom
4gjnbzb4zf-sudo:sentinel/ux-friction/persona-version-echo-input
Open

fix(persona): echo the offending value in validate_persona_version error#300
4gjnbzb4zf-sudo wants to merge 2 commits into
vibeforge1111:masterfrom
4gjnbzb4zf-sudo:sentinel/ux-friction/persona-version-echo-input

Conversation

@4gjnbzb4zf-sudo

@4gjnbzb4zf-sudo 4gjnbzb4zf-sudo commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

{
"schema": "spark-compete-hotfix-v1",
"event": "spark-compete-first-event",
"submission_mode": "public_repo_pr",
"submission_target_url": "#300",
"team": {
"name": "SparkThisUp",
"members": [
"ValHallaBuilder",
"Baz707",
"DanFireDash"
],
"github_accounts": [
"4gjnbzb4zf-sudo"
],
"llm_device_holder": "ValHallaBuilder",
"device_holder_github": "4gjnbzb4zf-sudo"
},
"target_repo": {
"id": "vibeforge1111/spark-character",
"source": "https://github.com/vibeforge1111/spark-character",
"owner_surface": "spark-character"
},
"issue": {
"type": "usage_friction",
"severity": "low",
"title": "validate_persona_version raises ValueError without echoing the offending input value",
"actual_behavior": "src/spark_character/persona.py::validate_persona_version raises ValueError('Persona version must match vN, for example v8.') without echoing the value that actually reached the validator after .strip(). Operators passing an unusual version string (typo, env-var with stray whitespace, accidental prefix) cannot tell what their input looked like at the validator boundary.",
"expected_behavior": "Same ValueError type and trigger condition, but the message interpolates the offending value via repr (showing whitespace and quoting visibly), so the operator sees exactly what reached the validator and can self-recover without reading the source.",
"repro_steps": [
"gh pr checkout ",
"from spark_character.persona import validate_persona_version; validate_persona_version(' v8 ') -> AFTER: ValueError('Persona version must match vN (for example v8); got "v8"') -- repr shows the stripped value.",
"validate_persona_version('vEight') -> AFTER: ValueError('Persona version must match vN (for example v8); got "vEight"').",
"validate_persona_version('v8') -> success path unchanged."
],
"affected_workflow": "Operators wiring env-var-driven persona-version selection (or stamping versions from upstream tooling) hit this when a config field has stray whitespace or a typo. The new message shows exactly what reached the validator after the .strip() call, removing the source-read step."
},
"evidence": {
"safe_links_only": true,
"before_after_proof": "Single-file change: src/spark_character/persona.py validate_persona_version raise expansion. The bare 'Persona version must match vN, for example v8.' string becomes an f-string that interpolates the stripped value via repr. The success branch (return value) is byte-identical and the exception type is preserved.",
"links": [
"https://github.com//pull/300"
],
"forbidden": [
"pdf",
"zip",
"exe",
"unknown downloads",
"shortened links",
"archives",
"binaries",
"tokens",
"browser cookies",
"wallet material",
"raw logs",
"raw conversations",
"raw memory",
"raw patches",
"private repo maps",
"private scoring details"
]
},
"proposed_fix": {
"approach": "Replace the bare ValueError message with an f-string: ValueError(f'Persona version must match vN (for example v8); got {value!r}.'). Uses the locally-scoped value (the stripped sys.argv input) so the operator sees the exact failing form.",
"files_expected": [
"src/spark_character/persona.py"
],
"tests_or_smoke": "python3 -m py_compile src/spark_character/persona.py -> clean. Manual: validate_persona_version with a typo/whitespace input; observe the new ValueError shows the stripped value via repr. Success path (valid vN inputs) byte-identical."
},
"pr": {
"branch": "sentinel/ux-friction/persona-version-echo-input",
"title_prefix": "[spark-compete]",
"author_github": "4gjnbzb4zf-sudo",
"body_must_include": [
"packet",
"team",
"pr_author",
"repo",
"actual_behavior",
"expected_behavior",
"repro_steps",
"before_after_proof",
"tests_or_smoke",
"duplicate_notes",
"risk_notes",
"review_claim"
],
"url": "#300"
},
"review_claim": {
"impact_claim": "low",
"evidence_types": [
"redacted_terminal_excerpt"
],
"duplicate_notes": "Pre-flight check returned no open PR touching validate_persona_version's ValueError raise. Other open PRs on persona.py target different surfaces (artifact paths, loader I/O).",
"risk_notes": "Local scope: one message-text edit. Exception type preserved (ValueError). Success branch byte-identical. No new package, no behavior change on valid inputs.",
"review_state_requested": "pr_review"
}
}

…na.vN.md is missing

evolve.find_latest_persona and evolve_persona.find_latest_persona both
raise FileNotFoundError('No persona.vN.md artifacts found.') with no path
and no operator next-step. Operators running evolve against a fresh or
moved ARTIFACTS_DIR get a bare exception that doesn't tell them which
directory was checked or what to do.

Interpolate ARTIFACTS_DIR into the message and add the seed-persona /
ARTIFACTS_DIR-override remediation. Same exception type preserved; only
the message text changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant