Skip to content
quarry Artifact [a0184fccac]
Login

Artifact [a0184fccac]

Artifact a0184fccac03fb717ba83e5c38b22e7e81605940dbb3526c63b15683728035e0:

Ticket change [a0184fccac] - Ticket [dd828b32a1] Ticket capability audit against fossil: what we have, what we lack status still Open with 2 other changes by dmestas on 2026-08-19 10:09:24.
D 2026-08-19T10:09:24.249
J comment ##\sAudit:\striage,\smeasured\sagainst\sfossil\n\nRead\sagainst\sfossil's\sown\ssources\sat\s`references/fossil/src`\s(`tktsetup.c`,\n`report.c`,\s`schema.c`)\sand\sagainst\sour\sindex\sschema\sand\sops.\n\n###\sWhat\swe\shave\n\nWe\s**capture**\severything\sand\s**query**\salmost\snone\sof\sit.\n\n`ticket_field`\s(index.go:133)\sstores\severy\sfield\sverbatim,\sone\srow\sper\n(change\shash,\sname),\sand\s`ticket.get`\sreturns\sthem.\sA\sreal\ssqlite\sticket\ncomes\sback\stoday\scarrying\s`severity=Minor`,\s`type=Optimization`,\n`status=Open`,\s`private_contact=<hash>`.\sThe\sdata\sis\sin\sthe\sindex.\n\nBut\sthe\sfolded\ssummary\srow\s—\sthe\sonly\sthing\sthe\slist\sreads\s—\sis\n`id,\screated,\supdated,\stitle,\sstatus,\sprivate`\s(index.go:151),\swith\sa\nsingle\sindex\son\s`updated\sDESC,\sid`.\sSo\s`ticket.list`\sanswers\n`id/title/status/updated`\sand\snothing\selse.\n\nNet\striage\scapability:\shide\sclosed\stickets,\sand\sfull-text\ssearch.\sNo\nfilter\sby\sseverity,\sno\ssort\sby\spriority,\sno\scolumn\schoice,\sno\sview\sthat\ntwo\speople\scan\sagree\sto\scall\s"the\sbug\squeue".\n\n###\sWhat\sfossil\shas\n\nTwo\sseparable\sthings,\sand\sthe\sseparation\sis\sthe\sdesign.\n\n**1.\sVocabulary\s—\sper-repository\sconfiguration,\snot\sa\sbuilt-in.**\n\nThe\sdefault\sticket\stable\s(tktsetup.c:67)\sis\n`type,\sstatus,\ssubsystem,\spriority,\sseverity,\sfoundin,\sprivate_contact,\nresolution`,\swith\schoice\slists:\spriority\s`Immediate/High/Medium/Low/Zero`,\nseverity\s`Critical/Severe/Important/Minor/Cosmetic`,\sstatus\n`Open/Verified/Review/Deferred/Fixed/Tested/Closed`,\sand\stwelve\nresolutions\sincluding\s`Works_As_Designed`,\s`Overcome_By_Events`,\n`Duplicate`,\s`Unable_To_Reproduce`.\n\nCrucially\sit\sis\sloaded\sas\s`db_get("ticket-table",\szDefaultTicketTable)`\s—\nthe\sschema\sis\sthe\s*project's*,\snot\sthe\stool's.\sA\stracker\smay\sadd\sor\sdrop\nfields,\sand\sfossil\srenders\swhatever\sit\sfinds.\sHardcoding\n`severity_choices`\sin\squarry\swould\smean\swe\scannot\sfaithfully\srender\sthe\ntrackers\swe\shave\salready\singested,\swhich\sis\smost\sof\sthe\scorpus.\n\n**2.\sMechanism\s—\ssaved\squeries.**\n\n`reportfmt`\s(schema.c:176):\s`rn,\sowner,\stitle,\smtime,\scols,\ssqlcode,\sjx`.\nA\sreport\sis\sa\snamed,\sowned\sSQL\sSELECT\splus\sa\scolor\skey.\sThat\s*is*\sfossil's\ntriage\sUI\s—\sit\schooses\sthe\scolumns,\sthe\sordering,\sand\sshades\seach\srow\sby\sa\nmagic\s`bgcolor`\scolumn\sthat\sis\scomputed\sand\sthen\snot\sdisplayed.\sThe\nshipped\sexample\scolors\sby\sstatus;\sthe\sdocs\sshow\sthe\ssame\sshape\skeyed\son\npriority\sinstead.\n\n###\sThe\spart\swe\smust\snot\scopy\snaively\n\nReports\sare\suser-authored\sSQL\sagainst\sthe\sforge\sdatabase.\sFossil\scontains\nthem\swith\san\sSQLite\sauthorizer\s(report.c:180),\sand\sit\sis\snot\sdecoration:\n\n-\sonly\s`SELECT`\s(anything\selse:\s"only\sSELECT\sstatements\sare\sallowed");\n-\sreads\srestricted\sto\sa\s13-table\sallowlist\s(`ticket`,\s`ticketchng`,\n\s\s`blob`,\s`event`,\s`tag`,\s`tagxref`,\s`mlink`,\s`plink`,\s`filename`,\n\s\s`backlink`,\s`unversioned`,\s`json_each`,\s`json_tree`)\splus\sany\stable\n\s\snamed\s`fx_*`;\n-\s`sqlite3_stmt_readonly()`\sas\san\sindependent\ssecond\sgate;\n-\sany\scolumn\snamed\s`private_*`\sreturns\s`SQLITE_IGNORE`\sunless\sthe\scaller\n\s\sholds\s`RdAddr`.\n\nThat\slast\srule\sis\sour\s#8518c09b21\sand\s#9561ac07b1,\senforced\sone\slayer\nlower\sthan\swe\sare\sproposing\sto\senforce\sthem\s—\sin\sthe\squery\sengine\srather\nthan\sin\sa\stemplate.\sA\ssaved-query\sfeature\swithout\sthe\sauthorizer\sis\snot\sa\nreports\sfeature;\sit\sis\sarbitrary\sread\saccess\sto\sthe\sforge\sdatabase.\n\n###\sRecommendation\n\nSplit\sthis\sinto\sthe\scheap\s80%\sand\sthe\sgeneral\smechanism.\n\n**Step\s1\s—\sfold\sthe\striage\sfields\sinto\sthe\ssummary\srow.**\sThe\sfold\spass\nthat\swrites\s`title`\sand\s`status`\shas\sthe\sother\sfields\sin\shand\sat\sthat\nmoment,\sso\sthis\sis\sdenormalize-at-write-time\sagain,\snot\sa\snew\ssource\sof\ntruth.\sAdd\sthe\sfields,\sindex\sthem,\sand\sgive\s`ticket.list`\sfiltering,\nsorting\sand\scolumn\schoice.\sReal\striage,\sno\squery\slanguage,\sno\snew\sattack\nsurface.\sKeep\sthe\sfield\sset\sdiscovered\sfrom\sthe\stracker\srather\sthan\nhardcoded,\sper\sfossil's\s`db_get`.\n\n**Step\s2\s—\sreports\s(#aa28c880b6)**\sas\sthe\sgeneral\smechanism,\swith\sthe\nauthorizer\swritten\sin\sthe\sfirst\scommit\srather\sthan\sadded\slater.\n\nStep\s1\sis\smost\sof\sthe\svalue\sand\sis\ssmall.\sStep\s2\sshould\snot\sstart\suntil\nthe\sfield-capability\squestion\s(#9561ac07b1)\shas\san\sanswer,\sbecause\sthe\nauthorizer\sis\swhere\sthat\sanswer\shas\sto\slive.
J mimetype text/x-markdown
K dd828b32a1928fb32d8aed70ab00ddfafb150309
U dmestas
Z bb32355bf684564c8d7d244a552427cc