Document toolboxDocument toolbox

Auto-application of amendments: known limitations and planned improvements

This page provides the following supplementary information about Lawmaker’s auto-apply feature:

Auto-apply basics

To use auto-apply, refer to the instructions in the user manual here: https://lawmaker.atlassian.net/wiki/spaces/USERMANUAL/pages/25526373

For auto-apply to work, the following prerequisites must be met:

  • a published version of the bill must exist, and that published version must include line numbering

  • the applied amendments must contain accurate clause, line, and page references

  • the applied amendments must consist of well-formed, valid XML

  • the applied amendments' instructions must be insert, leave out, or leave out and insert type amendments

  • the wording of the applied amendments must be correct; for example, an amendment in the form “leave out ____ and substitute ____” will fail, but “leave out ____ and insert ____” will work.

Steps

Within Lawmaker, the auto-apply process consists of the following steps:

  1. Select which amendments to attempt to auto-apply from the Amendment Manager tab. The current status of the amendments (Draft, Submitted, Tabled, Agreed) has no impact on auto-apply; amendments at any stage in their lifecycle can be auto-applied to a bill version.

  2. Click ‘Apply Amendments’ from the Amendment Actions menu, then select whether to ‘Create a new bill version’ or apply to an existing bill version. You can use the latter option to apply additional amendments to an already created amended copy. This gives you more control over the order in which to apply amendments, which can assist with troubleshooting or allow you to apply amendments in batches.

  3. Lawmaker will attempt to apply the selected amendments to the bill version and a green toastie notification will appear in the top-right of the screen telling you how many were successful. You can then open the newly created amended version in the Editor.

  4. In the Editor, successfully applied amendments will appear as red and blue tracked changes in the body of the bill, and will have corresponding numbered cards on the right-hand side of the window, in the ‘Inline Amendments’ pane. Amendments which could not be applied will appear in the ‘Review’ pane, with an error message. The Inline Amendments pane allows you to click a card and jump to the applied amendment.

  5. Assuming you are happy with the applied amendments, you can click ‘Accept all’ on the Inline Amendments pane to apply the changes and remove the track change mark-up from the bill version. This will create a clean ‘as amended’ copy of the bill.

  6. You can make further manual edits to the text of this version, before or after you have accepted the applied amendments, if you need to.

Known limitations and bugs

Lawmaker’s auto-apply function allows a large number of amendments to be applied to a bill version without manual intervention. However, there will always be some amendments which fail to auto-apply for different reasons, and will therefore require manual edits to integrate into the bill version.

If you know which amendments are likely to fail, and the manner in which they tend to fail, you will be better placed to use the auto-apply feature effectively and to avoid creating problems in the resulting bill XML. The details of the known limitations listed below should help you to manage any problematic amendments you encounter when creating an “as amended” version of a bill.

In future Lawmaker releases we intend to fix or refine the behaviours listed here.

Move and Divide amendment instructions

Amendments which ‘move’ or ‘divide’ provisions in a bill can’t be auto-applied at present. We plan to extend auto-apply to these instruction types in future. For now, you will have to apply these amendments manually.

Here is an example of an amendment tabled in the House of Commons which moves a clause to a different part of the Bill:

image-20240430-150617.png

Amendments to Tables

Amendments to rows, columns, and text in specific cells in tables can’t be auto-applied. We plan to extend auto-apply to handle these instruction types in future. For now, you will have to apply these amendments manually. If you do attempt to auto-apply amendments to tables, there is a slight risk that the amendment will appear to apply successfully but produce bad XML in your bill version.

Amendments to the Title

Amendments to the Long Title of a bill are not currently supported and cannot be auto-applied.

Incorrect amendment wording sometimes causes amendments to be applied successfully but disappear from the Editor

Amendments which are worded slightly incorrectly sometimes appear to apply successfully (Lawmaker shows a notification to say they were successfully applied), but when the amended bill version is opened in the Editor the amendments are missing - they have not been applied to the bill text and there is no error message relating to the amendments in the Review pane.

There are two known cases of problematic amendments which suffer from this issue:

  1. “leave out … and substitute”: Amendments which use the word ‘substitute’ in place of ‘insert’ will appear to be applied successfully but may not show up in the Editor

  2. amendments which leave out a phrase beginning with punctuation, such as leave out “, and any other costs”: These will also appear to be applied successfully but may not show up in the Editor

We are in the process of fixing the bug which prevents Lawmaker accurately reporting success and failure of auto-applied amendments like these.

Amendment instructions which end with a full-stop

Amendment instructions do not normally end with a full-stop. For example, consider the following amendment, taken from a list of amendments to a real Bill:

Clause 21, page 17, line 33, after “subsection” insert “, and may make consequential amendments of this section”

When auto-applying amendments in Lawmaker, the presence of a full-stop at the very end of the instruction can prevent the amendment from being applied. So the following amendment may fail:

Clause 21, page 17, line 33, after “subsection” insert “, and may make consequential amendments of this section”.

If you notice an extra full-stop at the end of an amendment instruction, it is worth removing it before attempting to auto-apply the amendment.

Amendments which insert or leave out a combination of sections/paragraphs and Parts, Chapters, and cross-headings

Where an amendment inserts or leaves out a mixture of sections or schedule paragraphs and higher-level headings (like Parts, Chapters, or cross-headings), the amendment may not auto-apply successfully. This is because of how the inserted or omitted headings interact with the other provisions in the bill.

In the bill XML, higher-level headings like Parts are not merely titles; they are XML tags which effectively ‘wrap’ (i.e. completely enclose) the provisions which are under that heading. For example, if a Bill contains two Parts, and Part 2 contains sections 4-6, then in the XML of that Bill sections 4-6 are all contained within an XML tag representing Part 2. If an amendment were to insert a new Part after section 5 (that is, mid-way through Part 2), a slightly complex transformation would be required to wrap or unwrap the provisions under that heading in the XML, so that they are instead enclosed by Part 2.

We plan to improve handling of these types of amendments in future. Not all amendments of this type will fail, but when using auto-apply on these amendments it is best to proceed with caution.

“From beginning to end of line…” or “leave out line…” in an amendment can sometimes create bad XML when applied

Where a sub-section, paragraph, or sub-paragraph exists in a bill and the content of that sub-section or paragraph extends over more than one line, any amendment which leaves out the whole of the first line of that sub-section or paragraph can create bad XML when auto-applied. This is because the amendment instruction is interpreted as though the amendment intends to remove not only the text of that line but the sub-section or paragraph number at the start of the line too - e.g. (1), (2), (a), (b), (i), (ii), (iii). This results in some of the text of that sub-section remaining in the bill but without a number, which is invalid.

This problem does not arise where an instruction leaves out the entirety of a sub-section or paragraph. In those cases, the removal of the number is correct, since the sub-section or paragraph has been left out entirely. The problem only affects amendments which remove the whole of the first line of a multi-line sub-section or paragraph, leaving behind some other textual content of that sub-section or paragraph.

We intend to fix this particular case in future Lawmaker releases.

Amendments which leave out words to the end of a line conflict with other amendments to that line

When auto-applying multiple amendments which affect a similar part of a bill, Lawmaker will not apply any amendments which appear to overlap or conflict with one another.

There are scenarios in which amendments which do not technically conflict will nevertheless fail to apply because of their proximity. For example, if an amendment leaves out words “from ____ to the end of line x”, and another amendment inserts some text at the end of line x, Lawmaker may not auto-apply the second amendment. We plan to refine the conflict-detection logic in a future Lawmaker release.

Adjacent amendments are sometimes erroneously flagged as overlapping and can’t be auto-applied

When one amendment leaves out the end of a section, sub-section, Schedule paragraph or sub-paragraph, and another amendment inserts words in a new provision immediately after that one, the two amendments may be deemed to be overlapping and the latter amendment will not auto-apply. Refinements to conflict-detection should help to resolve this problem in a future Lawmaker release.

Amendments which replace lines containing structure with simple text

Where an amendment leave out multiple lines of structured text (for example, paragraphs (a) and (b) in a subsection) and inserts a new simple line of text, auto-apply may produce unexpected results. The screenshots below show an example of this.

image-20240927-205936.png
An applied amendment which leaves out several lines and inserts a single piece of text
image-20240927-210114.png
The traditional wording of the amendment
image-20240927-210205.png
The result when accepting the amendment in the Editor

Currently, applying and accepting this amendment will result in the newly inserted text disappearing. We intend to fix this problem in a future Lawmaker release.

“Accept all” producing unexpected changes

Sometimes amendments are auto-applied successfully, and the deleted and inserted text all appears correctly in the new bill version in the Editor, but clicking “accept all” to consolidate those changes into your bill version produces unexpected results. We have identified the following scenarios in which “accept all” behaves unexpectedly:

  • Amendments which span the end of a sub-section and the start of a new sub-section which introduces a quoted structure, as in the following example:

image-20240307-143405.png
  • Amendments which span the whole of a sub-section containing a Quoted Structure and part of the start of the following sub-section:

image-20240307-143507.png
  • Amendments which span the end of a sub-section and the start of the following sub-section where some of the omitted text contains cross-references:

image-20240307-143727.png
  • Amendments which span the end of one definition and the start of another:

image-20240307-143918.png

In each case, auto-applying and accepting these amendments may produce unexpected outcomes: text may be duplicated after accepting, or empty XML elements may be left behind.

When applying amendments such as these, it is advisable to note down the numbers and locations and re-check them after accepting all amendments.

Incorrect application of amendments which leave out a particular Schedule and insert another one

An amendment in the form “leave out Schedule x and move the following Schedule--” may produce unexpected output when auto-applied: the new Schedule will be placed at the end of the bill, the omitted schedule will be marked as deleted, but the intervening schedules (between the omitted Schedule and the new Schedule at the end of the bill) will also be marked as deleted.

Hints and tips

Create a duplicate working version before clicking “Accept all”

After auto-applying a set of amendments, and after you have checked all the amendments which were successfully auto-applied, we recommend creating a backup copy of that working version before clicking “accept all” to consolidate them into your bill text.

To do this, save and close the Editor, then use the Actions menu next to your ‘as amended’ bill version on the project tab to Duplicate that version; see also https://lawmaker.atlassian.net/wiki/spaces/USERMANUAL/pages/688280

This will ensure you have a backup version you can return to if you find that accepting the amendments results in unexpected textual changes.

If amendments fail to auto-apply, check the wording and the clause, line, and page information

Small errors in the instruction text of an amendment may prevent auto-application from working - for example, if the line reference is wrong. Additionally, the structure of the XML in the target location of the amended bill may mean that certain amendments fail to apply, for any of the known limitations listed above.

If you notice something in an amendment which may need to be changed before applying it (such as incorrect amendment wording or problematic interaction of the amendment XML and bill XML), consider creating a copy of that amendment and opening it in a temporary list to make changes to the wording; see https://lawmaker.atlassian.net/wiki/spaces/USERMANUAL/pages/25526551/Moving+or+copying+amendments+to+a+different+stage+including+ping+pong+motions#How-to-copy-amendments-or-motions-to-another-stage

After editing the copied amendment, you can attempt to apply it.