fix(persona): echo the offending value in validate_persona_version error - #300
Open
4gjnbzb4zf-sudo wants to merge 2 commits into
Open
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
{
"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"
}
}